Communicating over UART
UART is an asynchronous communication technique in which parties use a predetermined data transmission rate or baud rate for communication. I2C and SPI are called synchronous because there is a common clock provided by the bus master, which is usually an MCU, and all other devices in the bus use this common clock to send/receive data. On the contrary, in UART communication, the parties have their own independent clocks and data transmission is achieved by the common UART settings in the applications running on the devices. Those settings or UART parameters are as follows:
- Baud rate: This is the speed at which parties exchange data. For example, 9600 baud means 9,600 bits of data can be sent in a second.
- A packet definition.
A packet definition shows the following:
- The number of bits in a packet.
- Whether the parity bit exists. Parity is to ensure that no bit is changed during the transmission.
- The number of stop bits: 1 or 2...