Post by Belal Sabha

Mechatronics & Embedded Systems Engineer | Bare Metal Firmware | Driver Development | Hardware Interfacing & System Design

šŸš€ From Theory to Hardware: Building my Bare-Metal USART Driver I didn’t want to just use a peripheral , I wanted to master it .Ā  My journey started with a deep dive into the USART protocol understanding start bits , parity, stop bits and the physics of asynchronous communication. But I didn’t stop at theory. I took the challenge to the next level by implementing a full MCAL-level USART driver for the STM32F103 (Blue Pill) from scratch. No HAL, no CubeMX just the STM32 Reference ManualĀ and pure Bare-Metal C. Key Features Implemented:Ā  šŸ›  Clock Tree Mastery Built a custom RCC driver to calculate real-time frequencies (SYSCLK , HCLK , PCLK1/PCLK2) directly from registers. šŸ“ˆ Baud Rate Precision Developed BRR mantissa & fraction calculation without floating point math to keep the code lightweight and efficient. āš™ļø Hardware Abstraction Clean configuration layer for Data Size (8/9 bits), Parity, and Stop bitsĀ exactly as defined in the TRM. ⚔ Interrupt-Driven Logic NVIC integration with user defined callbacks for non blocking RX communication. šŸ–„ Simulation Verified Validated the logic on Proteus to ensure timings and register writes behave exactly as expected. šŸ’” The Real Lesson :Ā  It wasn’t just about making UART workĀ it was about fighting through the TRM. Moving from reading registers to seeing data flow in simulation and eventually on real hardware is where the real engineering happens. šŸ›  Tech Stack : C | STM32F103 | Bare-Metal | Proteus Simulation | ARM Cortex-M3 šŸ”— Full Source Code & Documentation in the first comment below! šŸ‘‡ #EmbeddedSystems #STM32 #BareMetal #Firmware #USART #LowLevel #CProgramming #ARM #Engineering #Microcontrollers #Proteus

Post content

Video Content