I AM GETTING CRAZY, ANYONE CAN HELP? set baud rate to 300

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

I AM GETTING CRAZY, ANYONE CAN HELP? set baud rate to 300

1,187 Views
bitasobhani
Contributor III

Hi all

 

I am working on 13213 NCB with HCS08 microcontroller. The board baud rate can only be set from 1200 to 38400. The BUSCLK is 16MHz.  How can I change the baud rate to 300?

I added the line:

         #define gUARTBaudRate300_c     ((UartBaudRate_t) 0x0D05)

to existing baudrate table. But some bytes are received with error and some bytes are missed (I am using receive interrupt).

Can you please give me a code example?

Thanks

Labels (1)
0 Kudos
Reply
1 Reply

419 Views
drummerboy
Contributor I

Like most micro's, the baud rate control is created using internal fixed counts from the clock.   Even if you slow up the clock, you may not hit the right number of counts to get to 300 baud, and it will make the entire system slow.

The easiest solution is to use a hardware patch, (and its pretty cheap too), using a SOIC PIC16F54 microcontroller to take the 300 baud and boost it up to the minimum 1200 baud for your system.

The PIC16F54 has 12 I/O lines; more than enough for all the handshale lines if you are using them.

The chip is about 50 cents, small, and easyto program.   If this sounds like something you could live with, I'll send yo the software for 300 baud.

 

Steve Apelman,  Macro Electronics Corp.

macrocorp@optonline.net

0 Kudos
Reply