Personal tools
You are here: Home Forums M16C U1brg Register Setting

U1brg Register Setting

Up to M16C

U1brg Register Setting

Posted by Akif Akgül at August 26. 2008

How can I do u1brg register setting?

for example , u1brg = 0x6E (bit rate 19200)

0x6E or 19200 .. where is it from?

I look datasheet,but I didn't understand..

Thanks.

Re: U1brg Register Setting

Posted by FrankL at August 26. 2008

bitrate = UART clock divided by 16 divided by (ubrg+1)

Re: U1brg Register Setting

Posted by Akif Akgül at August 27. 2008

  Thanks , but where is 0x6E from?

  Is a formula?

  I have 16 Mhz clock frequency.

  How can I do now? 

Re: U1brg Register Setting

Posted by Icecap at August 28. 2008
Well, all is clear in the datasheet, when i look in "62eum.pdf" it says i 2.5.1 that the UART clock is based on CPU-clock divided by 1, 8 or 32, then divided by 16 and last divided by the BRG. In figure 2.5.8 the exact formula is shown in the notes. So, as with som much else: read the datasheet, it's in there!

Re: U1brg Register Setting

Posted by Akif Akgül at August 29. 2008

Thanks..

Powered by Ploneboard