Serial Communications Interface Module

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

Serial Communications Interface Module

Jump to solution
1,278 Views
JPSB
Contributor I
Hi, 

I'm trying to do a simple RS-232 link that must work at 9600bps.

The problem is that the xtal conected to my cpu (MC68HC908AP64A) has a frequency of 4MHz. And according to the cpu datasheet the baud rate is given by the following formula:

baud rate = CGMXCLK / (64 x PD x BD)

Since PD allowed values are 1; 3; 4 or 13, and BD allowed values are 1; 2; 4; 8; 16; 32; 64; or 128, there is no combination that results at approximately 9600. The maximum speed that I can successfully transmit/receive is 4800bps. Strangely I've already seen the same hardware configuration working at 9600bps!

How can I manage to do that?
Is there any way to double the internal clock speed using the same xtal?

King Regards.
Labels (1)
0 Kudos
Reply
1 Solution
546 Views
peg
Senior Contributor IV

Hello and welcome to the fora JPSB.

 

Firstly, please DO NOT post the same question in multiple places. Pick what you think is the most appropriate one and post it there.

 

Presumably you are not using the PLL and so the source for your baud clock is direct from the OSC module. Like this you are limited to 4800 baud as you need the 13 divisor to come close.

 

There is a bit in CONFIG2 that allows you to use the BUSCLK as the source for your baud clock (SCIBDSRC). Now I think you can configure (I have not confirmed it entirely, left for you) the PLL for the maximum bus frequency of 8Mhz with a 4MHz xtal. With this and the same baudrate divisor setup you will get 9600.

 

View solution in original post

0 Kudos
Reply
2 Replies
546 Views
bigmac
Specialist III

Hello,

 

To generate standard baud rates, there would be far more flexibility if a crystal frequency of either 3.6864 MHz or 4.9152 MHz were to be used.  Crystals of both frequencies should normally be readily available as "standard" frequencies.

 

Regards,

Mac

 

0 Kudos
Reply
547 Views
peg
Senior Contributor IV

Hello and welcome to the fora JPSB.

 

Firstly, please DO NOT post the same question in multiple places. Pick what you think is the most appropriate one and post it there.

 

Presumably you are not using the PLL and so the source for your baud clock is direct from the OSC module. Like this you are limited to 4800 baud as you need the 13 divisor to come close.

 

There is a bit in CONFIG2 that allows you to use the BUSCLK as the source for your baud clock (SCIBDSRC). Now I think you can configure (I have not confirmed it entirely, left for you) the PLL for the maximum bus frequency of 8Mhz with a 4MHz xtal. With this and the same baudrate divisor setup you will get 9600.

 

0 Kudos
Reply