Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PIC16F877A Embedded Control Projects (2014–2017)

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.

Projects

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

Toolchain

  • 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

What I would do differently today

The same three themes run through all three projects:

  1. 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.
  2. goto for 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.
  3. 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.

Author

Nguyen Quoc Dung Phan — B.S. Software Engineering, UT Dallas (expected Dec 2027)

About

Bare-metal PIC16F877A control projects in CCS C: line-following robot, traffic light controller, and sensor-based product counter

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages