Dept. Logo
Lab Home page
Department of Microelectronic Systems, Faculty of Electronics, Telecommunications and Informatics, Gdansk University of Technology Logo Wydziału
Flaga PL Polska wersja

Port RS-232

Task: Design RS-232 transmitter and receiver for the following transmission parameters: 8 data bits, no parity bits, 1 stop bit, transmission speed 9600bps, no flow control.
Connect the modules of the transmitter and the receiver to obtain adding constant value of 20(hex) to received data, after that the result must be immediately transmitted by the transmitter.
Inputs:
clk_i - clock 50MHz,
rst_i - asynchronous reset,
RXD_i - data input,
TXD_o - data output.

Write a testbench.
Before implementing the design, a simulation must be run using the testbench.
To test the design, connect port COM1 of PC and Spartan-3 board, run Hyperterminal and set the transmission parameters the same as above. Pressing a key on the PC's keyboard should result in displaying the character of increased ASCII code. Adding 20h changes lowercase letters to the uppercase.

Transmitting and receiving signals in RS-232 RS-232 provides serial transmission and reception of data, using two lines, separate for receiving and transmitting. High level on the line means no transmission. Start of the transmission is signalized by start bit (logical "0" for the period of 1/transmission_speed, here 1/9600[sec])). All the remaining data is also transmitted with the same period. After start bit, data bits are transmitted, starting from LSB bit (D0-D7). Then the optional parity bit can be sent, calculated as XOR on all data bits (D0-D7). End of transmission is indicated by 1-2 stop bits. In Fig 1. transmission of 01010011 is presented.

RS-232 Transmission
Fig. 1 Example of transmitting 01010011 using RS-232


Additional information on RS-232:
http://en.wikipedia.org/wiki/RS-232

UCF file, Digilent Spartan-3, Spartan-3 3S200 FT256-4:
# Clock:
NET "clk_i" LOC = "T9" ; # 50 MHz clock
# Push-buttons:
NET "rst_i" LOC = "L14" ; # pressed high BTN3
# RS232:
NET "TXD_o" LOC = "R13" ; # RS 232 TXD
NET "RXD_i" LOC = "T13" ; # RS 232 RXD