In: Electrical Engineering
In UART protocol, how many bits are NECESSARILY added into a data package for the interfacing to be successful? What is the function of those bits?
For a UART to successfully interface, without losing data, each data packet should have 1 START bit, 1 STOP bit and a minimum of 5 DATA bits.
START bit:
For UART, a Low-level voltage at the transmitting end, depicts that
data is being transmitted. Hence, High Voltage for no data
transmission and Low Voltage for active data transmission.
Function - As data transmission begins,
the UART detects the High to Low Voltage change and the START bit
allows it to start reading data from the data frame.
STOP
bit: When the data transmission stops, the voltage
level of UART changes from Low to High, for two-bit durations. This
signal is detected by the Stop bit.
Function - Stop bit ensures to mark the
data read operation as complete and depict the end of data.
DATA bit: 5
to 9 Data bits constitute the data frame. Actual data exists on the
data frame.
Function - Data bits are responsible for
allowing serial read operation for data to be transmitted to the
receiving UART.
PARITY
bit: Optional bit. Parity bit defines the oddness
of the data ready for transmission.
Function - If the value of data changes,
when it is received, the Parity bit is the bit that allows for that
change to be seen. The parity bit can either give 0 (for Even
number) or 1 (for Odd number).