This project implements a UART (Universal Asynchronous Receiver Transmitter) driver using register-level programming in Embedded C.
The driver enables reliable serial communication between microcontroller and external devices by handling both transmission (TX) and reception (RX) operations.
This project focuses on low-level peripheral control, without using any external libraries or HAL.
- UART Initialization (Baud rate configuration)
- Data Transmission (TX)
- Data Reception (RX)
- Polling-based communication
- Register-level programming
- Lightweight and efficient implementation
- Embedded C
- STM32 / Generic Microcontroller
- UART Protocol
- Register-Level Programming
uart-driver/
│
├── inc/
│ ├── uart.h // Function declarations
│ └── uart_reg.h // Register definitions
│
├── src/
│ ├── uart.c // UART logic implementation
│ └── uart_reg.c // Register configuration
│
├── main.c // Example usage
└── README.md
UART is an asynchronous serial communication protocol, meaning no clock signal is shared between devices.
- Data is loaded into the transmit register
- Converted into serial bits (start + data + stop bits)
- Sent over communication line
- Receiver reconstructs data from incoming bits
- Configure baud rate
- Enable UART peripheral
- Enable TX and RX
- Load data into transmit register
- Wait until transmission is complete
- Wait for data availability
- Read data from receive register
void UART_Init(void);void UART_SendChar(char data);char UART_ReceiveChar(void);void UART_SendString(char *str);#include "uart.h"
int main()
{
UART_Init();
UART_SendChar('H');
UART_SendChar('i');
UART_SendString(" UART Working\n");
char data = UART_ReceiveChar();
while(1);
}- Characters successfully transmitted via UART
- Data received correctly from serial terminal
- Verified communication between devices
- Serial communication between microcontrollers
- Debugging using serial monitor
- Sensor data transmission
- Communication with modules (GPS, Bluetooth, etc.)
- Register-level programming
- UART protocol implementation
- Embedded system communication
- Peripheral interfacing
- Interrupt-based UART
- DMA-based communication
- Error handling (parity, framing errors)
- Integration with RTOS (FreeRTOS)
Naga Rohit Anudeep N Embedded Systems Engineer
Embedded C, UART Driver, STM32, Firmware Development, Register-Level Programming
