Uart Universal Asyncronous Communication

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

UART

UNIVERSAL ASYNCRONOUS COMMUNICATION


Serial Communication???
 serial communication is the process of sending data one bit at a
time, sequentially, over a communication channel.

 Short Distance Serial DATA Communication System

 Can connect to any Microcontroller, Microprocessor or a


Computer

 Easy 3 wire - 7 wire Communication Method

 Data Transmitted in ASCII Format

 Global Standard Protocol.


Serial DATA Communication
Methods:
RS232 System:

Voltage Levels
RS-232 TTL Logic

-15V … -3V +2V … +5V High

+3V … +15V 0V … +0.8V Low


HYPER TERMINAL:
 Hyper Terminal is a Computer software

 Used for Dial up network connection.

 It can connect to computer ports like: Rs232,USB Ports etc.

 Text Data or Voice Data can be transmitted or received


through Hyper Terminal.

 Can be used for testing RS232 data Transmission and


Reception.
RS232 Port Settings:
Registers:
 UxLCR(Line Control Register)

 UxDLL(Divisor Latch LSB)

 UxFCR(FIFO Control Register)

 UxLSR(Line Status Register)

 UxRBR (Receiver Buffer Register)

 UxTHR (Transmit Holding Register)


Program:
Void initialization()
{
U1LCR=0X83; //Line control Register for
Lenght,Parity

U1DLL=93; //Baud Rate 9600


U1LCR=0X03; //Set Length and clear
DLE
U1FCR=0X03; //FIFO Enable
}
Transmission:

Void uart_transmitting(unsigned int transmit_data)


{
U1THR= transmit_data; //Transmitting Data
while(!(U1LSR&0X40)); //Waiting for
Transmission End
U1LSR=0; //Clear Flag
}
Receiving:
Unsigned int uart_receiving()
{
unsigned int receiving_data; //Variable decleration
while(!(U1LSR&0X01)); //Waiting for Data
Receiving
receiving_data=U1RBR; //Receive the Data
U1LSR=0; //Clear the Flag
}

You might also like