UART RS232

Serial communication is often used for general applications is RS232. This module is a modification of the module that was created by Dan Pederson, Digileninc, 2004.

Here I made some modifications to the baudrate of the rx / tx can be set manually. Setting baudrate usual through a combination of a switch or a schematic. If you wish to make modifications, please write your profile included in the program comments.

Source code

 

How it works

I will first explain the function of each pin of this module, namely:

  1. BAUD(2:0)
    This pin is 3 bits serves to set baudrate of the TX and RX. There are 8 kinds of combinations baudrate from 000 to 111 are 1200, 2400, 4800, 9600, 19200, 38400, 115200, 115200. Last baudratenya same, so there are only 7 different baudrate. Parity used is odd, 8bits data, stop bit 1.
  2. TX
    This pin is used for transmit data by serially at current baudrate.
  3. RX
    This pin is used for receive data by serially at current barudrate.
  4. CLK
    As base clock at 50MHz.
  5. DBIN
    This pin is used as an 8bits parallel data will bel transmittesd  by serially via the TX pin. This data is provided when TBE = 1 means the bus was empty and ready to accept new data.
  6. DBOUT
    This pin will contain 8bits data has been received by serially via RX pin.  This data will ready if RDA=1.
  7. RDA – Read Data Available
    This pin is used as a flag that the serial data has been received from the RX when RDA=1.
  8. TBE – Transfer Bus Empty
    This pin is used as a flag that the byte to transmit is empty and ready to get a byte again.
  9. RD
    As Read control to get a byte from DBOUT when RDA=1. Active as logic 1.
  10. WR
    As Write control to write a byte to DBIN when TBE=1. Active as logic 1.
  11. PE, FE, OE
    As an indicator of the process of the module.
  12. RST
    As control to reset module and start using baudrate of setting.

Testing

To test this module, additional modules required as a “Top of Module” in ISE. Top module serves to bypass the data from DBOUT sent to DBIN. This means that data is as internal loop. If you use hyperterminal as a tool, then typed data provided in the keyboard will be accepted back as an echo character. Here you will be able to check the function of the module right or wrong.

Source code of top module as follow.

Testing

To test this module, additional modules required as a “Top of Module” in ISE. Top module serves to bypass the data from DBOUT sent to DBIN. This means that data is as internal loop. If you use hyperterminal as a tool, then typed data provided in the keyboard will be accepted back as an echo character. Here you will be able to check the function of the module right or wrong.

Source code of top module as follow.

 

 

Last updated by at .

Avatar of Bambang Siswoyo

About Bambang Siswoyo

I am a college lecturer since 1988 at UB (University of Brawijaya) in the electronics department. My experience: Applications of Microprocessor system, Applications of Control System, Applications of Field Programmable Gate Array, Computer Programming in computer instrumentations. My hobby: Music especially playing the saxophone, hiking and exploring the countryside.
This entry was posted in Electronics, fpga and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>