MC9S08GB60 Clock Options for SCI Baud of 31.25K

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

MC9S08GB60 Clock Options for SCI Baud of 31.25K

Jump to solution
613 Views
danielhembree
Contributor III

I am using an MC9S08GB60 as part of a system that will communicate to external devices via the SCI at 31.25K baud rate. The development board I have has a 32.768 external crystal. The code I have written thus far is configuring the ICG for a 4.19MHz bus frequency in FEE mode. I took this section of code directly from the data sheet. I have noticed what appears to be quite a bit of jitter (instability) on the SCI bit stream, and consequently, many communication errors with my receiving device. The question(s) I have are 1) Is there a more accurate clock scheme (such as FBE mode), and 2) can I get to 4.19MHz bus frequency using the external crystal in FBE mode. The information I have found covering the ICG is not completely intuitive, and my attempts to use FBE mode have been unsuccessful.

 

Also, is there something else that could be causing the instability withe the SCI bitstream?

 

Thanks in advance.

 

Dan

Labels (1)
0 Kudos
1 Solution
420 Views
danielhembree
Contributor III

Solved.

I figured out that you CAN"T use a 32.768KHz external crystal in FEE or FBE modes to achieve a bus clock that will divide in the baud rate divide register (SPI) down to a rate close enough to produce a 31.25K baud rate. It took five minutes to come up with a configuration in FEI mode that satisfies the requirement.

My head hurts.

View solution in original post

0 Kudos
3 Replies
420 Views
bigmac
Specialist III

Hello Dan,

To achieve an accurate SCI baud rate at 31250, you will need a bus frequency that is a multiple of 0.500 MHz.

For FBE mode, a crystal frequency of 16 MHz would give a maximum bus frequency of 8 MHz.
For FEE mode, you might choose a crystal frequency of 4 MHz for possible bus frequencies of 8, 12, 16 or 20 MHz.

For FEI mode, using the standard reference trim setting of 243 kHz, the multiplier factor would need to be 18 to achieve a DCO frequency very close to 40 MHz.  The bus frequency can then be one of 5, 10 or 20 MHz.

Regards,

Mac

0 Kudos
420 Views
danielhembree
Contributor III

Thanks for the reply, Mac. I'm leaning toward using an external clock oscillator module and configuring for FBE mode. For the remainder of development I'll stick with the solution came up with using the internal config and a 5MHz bus clock. I suppose I'll ultimately need to use a 10MHz oscillator module as I believe this gets divided by two within the ICG.

Thanks again,

Dan

Thanks again

0 Kudos
421 Views
danielhembree
Contributor III

Solved.

I figured out that you CAN"T use a 32.768KHz external crystal in FEE or FBE modes to achieve a bus clock that will divide in the baud rate divide register (SPI) down to a rate close enough to produce a 31.25K baud rate. It took five minutes to come up with a configuration in FEI mode that satisfies the requirement.

My head hurts.

0 Kudos