Uart and clock

N

Neil

Hi, All,
While programming UART, I encounter a problem: if the baud rate is
9600, how to calculate the ferequence for receive/transmit data of
UART? I get a expression: freq = 9600/(systemClock * 16). but where
the 16 comes from? why it is 16? How to get...? Thank you!

Regards!
-- Neil
 
D

Dave Higton

In message <[email protected]>
Neil said:
Hi, All,
While programming UART, I encounter a problem: if the baud rate is
9600, how to calculate the ferequence for receive/transmit data of
UART? I get a expression: freq = 9600/(systemClock * 16). but where
the 16 comes from? why it is 16? How to get...? Thank you!

It's conventional to clock the receiver at 16 times the baud rate,
to make it easy to sample the bits close to the middle. Remember
that the receiver is not normally synchronised to the transmitter.

There's no need to clock the transmitter faster than 1 times (or 2
times if you need one and a half stop bits, but no-one has used
that in years), but you only usually want to provide one clock rate
for both Rx and Tx.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top