Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   VHDL (http://www.velocityreviews.com/forums/f18-vhdl.html)
-   -   Uart and clock (http://www.velocityreviews.com/forums/t23776-uart-and-clock.html)

 Neil 06-25-2005 02:06 AM

Uart and clock

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

 Dave Higton 06-25-2005 03:33 PM

Re: Uart and clock

"Neil" <zjneil@gmail.com> wrote:

> 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

 All times are GMT. The time now is 01:00 PM.