Process flow for configuring a UART in a microcontroller involves several steps,
• Initialize the UART peripheral
• Configure the UART
◦ Baud Rate
◦ data bits
◦ Stop bits
◦ Parity
◦ interrupt based or blocking?
• Test the UART with loop back between Tx and Rx
• Transmit or Receive the data
What happens during the UART data transmission?
• DATA to be sent is copied to TX Buffer
• Loads byte into shift register
• Sends bits serially on TX pin
What happens during the UART data receive?
• DATA is sampled on RX pin
• Byte is constructed
• Byte is placed in RX FIFO
In UART, interrupt-driven communication uses hardware interrupts to signal the CPU only when data is ready (receive) or sent (transmit), letting the CPU do other work; this is efficient and non-blocking. Blocking (or polling) communication means the CPU must constantly check the UART status register (busy-wait) until data is ready, halting other tasks until the check passes, which wastes CPU cycles.
0 Comments