RS-232 Comm
RS-232 Comm
Aim: write a ASM program to transmission and reception of data using RS232 communication in
kileuvision.
Description:
RS-232 is a serial communication protocol used for transmitting and receiving data one bit at a
time over a single wire.
It is commonly used to interface microcontrollers (e.g., 8051) with PCs, GSM modules, GPS
receivers, or other devices.
The 8051 microcontroller uses UART (Universal Asynchronous Receiver-Transmitter) for
serial communication.
Feature Description
Voltage Levels ±12V for RS-232 (converted to 0-5V TTL for 8051)
Data Frame Start bit (1) + 8 Data bits + Parity (Optional) + Stop bit (1 or 2)
Note: Since RS-232 operates at ±12V, a MAX232 IC is used to convert signals to 0-5V TTL
levels.
Running the Program in Keil
3. Create a new ASM file, paste the above program, and save it as RS232_Comm.asm.
4. Add the file to Source Group 1 (Right-click Source Group → Add Files).
MOV TH1, #0FDH ; → Loads TH1 = 0xFD (-3 in decimal) to generate Baud rate 9600 for 11.0592
MHz crystal
END
OUTPUT:
When you open the UART Serial Window in Keil, you should see printed in the terminal.
HELLO