UART Implementation

Discussion in 'VHDL' started by Anand P Paralkar, Jun 26, 2003.

  1. Hi,

    I need to implement a simple UART. By simple, I mean the UART only needs
    a transmitter which would take parallel data and shift it out serially at
    a fixed baud rate. The receiver receives serial input data at the same,
    fixed baud rate, which must be output in parallel, one byte at a time.
    In short, the UART should look something like:

    +---------------+
    --->| |
    Parallel Data In | |-----> Tx to RS232 line driver
    --->| |
    | |
    <---| |
    Parallel Data Out | |<----- Rx from RS232 line driver
    <---| |
    | |
    | |
    +---------------+

    The UART should perform:

    1. Start bit detection/generation.
    2. Stop bit detection/generation.
    3. Data bits sampling/transmitting.

    The UART does NOT need to have:

    1. Programmable baud rate.
    2. Programmable character length (6, 7 or 8 bits per character).
    3. Programmable stop bit length (1, 1.5 or 2 bits per character).
    4. Parity checking.
    5. RTS/CTS based or any other type of flow control.
    6. Buffering (using Rx and Tx FIFOs).
    7. Interrupt generation.

    Could you please suggest a design for the receiver section. (I have seen a
    few articles on the Internet, but most of them are "datasheets" of UARTs.
    None of them discuss the internal design.)

    I would be particularly interested in knowing how to determine the
    required clock frequency for a given baud rate in the receiver section.

    Why do people choose 3X or 16X clocks (times baud rate) in typical UART
    implementations?

    Thank you for your time.

    Thanks,
    Anand
     
    Anand P Paralkar, Jun 26, 2003
    #1
    1. Advertising

  2. Anand P Paralkar

    Mario Trams Guest

    Anand P Paralkar wrote:

    <snip>

    > Could you please suggest a design for the receiver section. (I have seen a
    > few articles on the Internet, but most of them are "datasheets" of UARTs.
    > None of them discuss the internal design.)


    Did you ever heard about this magic tool called "google"
    Searching for vhdl+uart returns tons of links.

    > I would be particularly interested in knowing how to determine the
    > required clock frequency for a given baud rate in the receiver section.
    >
    > Why do people choose 3X or 16X clocks (times baud rate) in typical UART
    > implementations?


    This is because you somehow have to "hit" the middle of the bit frames
    and syncronize the receiver with the incoming stream. That is, you wait
    for the start bit (sampled by the oversampling clock), then you wait
    half the time and sample the stop bit (i.e. you sample it at the 8th
    oversampling clock assuming a 16x clock). Then you wait another 16
    cycles and sample the first data bit etc.

    Assuming absolutely precise (constant) aligned sender and receiver
    clocks, you would not need this oversampling at all.
    If you know the worst case clock difference between the sender and
    the receiver and the bit length of a transmitted word, then you can
    calculate how much oversampling is required in order the guarantee
    a flawless operation. Of course, when the clocks are totally out of
    sync the oversampling won't help.

    Regards,
    Mario
     
    Mario Trams, Jun 27, 2003
    #2
    1. Advertising

  3. Anand P Paralkar <> wrote in message news:<>...
    > Hi,
    >
    > I need to implement a simple UART. By simple, I mean the UART only needs
    > a transmitter which would take parallel data and shift it out serially at
    > a fixed baud rate. The receiver receives serial input data at the same,
    > fixed baud rate, which must be output in parallel, one byte at a time.
    > In short, the UART should look something like:
    >
    > +---------------+
    > --->| |
    > Parallel Data In | |-----> Tx to RS232 line driver
    > --->| |
    > | |
    > <---| |
    > Parallel Data Out | |<----- Rx from RS232 line driver
    > <---| |
    > | |
    > | |
    > +---------------+
    >
    > The UART should perform:
    >
    > 1. Start bit detection/generation.
    > 2. Stop bit detection/generation.
    > 3. Data bits sampling/transmitting.
    >
    > The UART does NOT need to have:
    >
    > 1. Programmable baud rate.
    > 2. Programmable character length (6, 7 or 8 bits per character).
    > 3. Programmable stop bit length (1, 1.5 or 2 bits per character).
    > 4. Parity checking.
    > 5. RTS/CTS based or any other type of flow control.
    > 6. Buffering (using Rx and Tx FIFOs).
    > 7. Interrupt generation.
    >
    > Could you please suggest a design for the receiver section. (I have seen a
    > few articles on the Internet, but most of them are "datasheets" of UARTs.
    > None of them discuss the internal design.)
    >
    > I would be particularly interested in knowing how to determine the
    > required clock frequency for a given baud rate in the receiver section.
    >
    > Why do people choose 3X or 16X clocks (times baud rate) in typical UART
    > implementations?
    >
    > Thank you for your time.
    >
    > Thanks,
    > Anand



    Check out our web site, we provide a free IP core of
    a simple UART.

    Regards,
    rudi
    --------------------------------------------------------
    www.asics.ws --- Solutions for your ASIC/FPGA needs ---
    ----------------- FPGAs * Full Custom ICs * IP Cores ---
    FREE IP Cores --> http://www.asics.ws/ <-- FREE IP Cores
     
    Rudolf Usselmann, Jul 7, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Treseler

    Re: vhdl UART

    Mike Treseler, Aug 8, 2003, in forum: VHDL
    Replies:
    1
    Views:
    3,934
    SneakerNet
    Aug 10, 2003
  2. Shashi

    Issues on clockless UART

    Shashi, Apr 21, 2004, in forum: VHDL
    Replies:
    3
    Views:
    702
  3. Shashi
    Replies:
    0
    Views:
    619
    Shashi
    Apr 21, 2004
  4. Konstantin Dols

    UART receiver

    Konstantin Dols, Dec 12, 2004, in forum: VHDL
    Replies:
    0
    Views:
    3,042
    Konstantin Dols
    Dec 12, 2004
  5. Neil

    Uart and clock

    Neil, Jun 25, 2005, in forum: VHDL
    Replies:
    1
    Views:
    654
    Dave Higton
    Jun 25, 2005
Loading...

Share This Page