Weird Baud rate change in HCS08

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Weird Baud rate change in HCS08

1,159 Views
Eel
Contributor I

Hello All,

 

I am new to Codewarrior and HCS08.  A part of my project is to use the UART on the HCS08 mc and send data to hyperterminal on PC through bluetooth via bluesmirf module. The weird problem that I am facing is that, I am expecting the baud rate to be 9600bps. However, when I first program the mc using the IDE link, the data on hyperterminal is correct. However, if I switch off the mc and start it again, the baud rate changes and garbage values are sent to the hyperterminal.

The UART init code has been included in the System init function. I am not able to troubleshoot this problem.

 

I also tried seeing  the output on oscilloscope and the baud rate change is visible on it. I do not understand why the baud rate setting changes?

 

Any suggestions are welcome. Thanks!

Labels (1)
0 Kudos
Reply
2 Replies

520 Views
belskyc
Contributor III

Hi Eel,

 

I'm not sure how much help this will be, but here's a few basics about using the SCI (Serial Communication Interface):  refer to the SCI module section in the data sheet for your particular uP (you didn't state which uP you're using).  As an example, the HCS08DZ60A has two baud-rate registers (SCIxBDH and SCIxBDL) that you initialize during power up.  The SCI control registers must also be configured during initialization to setup features such as parity and loop mode.  The data sheet actually walks you through pretty well on how to setup these registers.  As long as you have an initialization routine that runs every time your device powers up, it should configure the SCI to the correct baud rate and configuration. 

 

Also, make sure your MCG (multi-purpose clock generator) is configured and initialized properly as well for the BUSCLK. 

 

Good luck,

~Belskyc

0 Kudos
Reply

520 Views
Eel
Contributor I

Thanks. That helped. I forgot to initialize the ICSTRM and ICSSC register from the non volatile memory locations (0xFFAF & 0xFFAE resp)

 

Thank you!

 

Eel

0 Kudos
Reply