Three bare-metal microcontroller projects built during my Electrical Engineering and Automation coursework at Ho Chi Minh City University of Transport. All three were built as working hardware, not simulations only.
I am publishing them as-is, with the original code unchanged, plus notes on what I would do differently today. The bugs are still in the source — they are documented, not fixed, because the point of this repository is an honest record of where I started.
| Project | Platform | What it does |
|---|---|---|
| Line-Following Robot | PIC16F877A | Six-sensor line tracking with hardware PWM motor control and a UART remote-control mode |
| Traffic Light Controller | PIC16F877A | Two-road intersection with multiplexed seven-segment countdown and runtime-configurable phase timing |
| Product Counter | PIC16F877A | Sensor-based production counter with keypad target entry and an HD44780 LCD |
- MCU: PIC16F877A, 20 MHz HS crystal
- Compiler: CCS C (PIC C Compiler)
- Simulation: Proteus Design Suite (schematics included where I still have them)
- Configuration:
NOWDT, PUT, HS, NOPROTECT, NOLVP
The same three themes run through all three projects:
- Blocking delays instead of timer interrupts. Every project builds its timebase out of
delay_ms()calls inside the main loop. This makes timing imprecise and leaves the system unresponsive while it waits. Timer1 with an interrupt would fix all three. gotofor control flow. The traffic light and counter both use labels and jumps where a state machine with an explicit state variable would be clearer and easier to test.- No separation between logic and I/O. Counting logic, display driving, and input scanning are interleaved, so none of it can be unit tested off-hardware.
Nguyen Quoc Dung Phan — B.S. Software Engineering, UT Dallas (expected Dec 2027)