Académique Documents
Professionnel Documents
Culture Documents
UART !!!
DATA FIELD
STOP BIT
PARITY BIT
USART packet format: 1 start bit, 8 data bits, 1 parity bit, 1 stop bit.
Data Bits : 5-8 bits Stop Bit: 0 or 1 or 2 Parity Bit : Optional (Even or Odd)
BAUD RATE : The number of Symbols transmitted per second Typical Values are 1200, 2400, 9600, 19200 etc..
Mode Of Transmission: Asynchronous : No Clock Sharing Between Receiver And Transmitter Synchronous: Receiver And transmitter Works With Same Clock Frequency
Rx Tx
Serial Port
It is a set of 9 PINS used for serial data communication between two Cs or between C and a Computer.
RS-232
The RS-232 standard defines the voltage levels that correspond to logical one and logical zero levels in serial communication.
Valid signals are plus or minus 3 to 15 volts. The range near zero volts is not a valid RS-232 level.
Logic one is defined as a negative voltage and logic zero is positive.
Voltage Levels in Our Microcontroller are Logic High= 5Volt Logic Low= 0 Volt How Can a microcontroller communicate by using RS-232 Standard ?? Solution is MAX 232 IC
UDRE bit in UCSRA Register should be set and transmitter to be enabled for Data Transmission.
RXC bit is set when data is available in the receive buffer and cleared when the receive buffer is empty.
TXC bit is set when data transmission is complete. UDRE bit is set when transmit buffer (UDR) is ready to receive new data
RXCIE: Receive Complete interrupt will be generated if RXCIE bit is set. TXCIE: Transmit Complete interrupt will be generated if TXCIE bit is set. UDRIE: Data Register Empty interrupt will be generated if UDRIE bit is set. RXEN: To enable the USART receiver . TXEN: To enable the USART transmitter. UCsZ2: To set the character size in combination with bit UCZ1 and UCZ0.
URSEL: This bit must be one to write the UCSRC. UMSEL: To select between Asynchronous and Synchronous mode.
UPM1 & UPM0: To Select Parity Bit.
This Register Stores The Value of Baud rate . To write in the UBRRH , URSEL bit must be zero.
THANK YOU!!!