16f628a Simple Programmer
PIC16F627A/628A/648A DS40044F-page 2 © 2007 Microchip Technology Inc. Pin Diagrams 20 19 18 17 16 15 14 13 12 11 PDIP, SOIC SSOP 27A/628A/648A RA7/OSC1/CLKIN RA6.
LED Chaser for PIC16F84A and 16F628A. This simple circuit functions as a 12 LED chaser. A single illuminated LED 'walks' left and right in a repeating sequence, similar to the effect seen on, the car in the TV series. Fully commented source code and programmer ready HEX files are provided for the PIC 16F84A and 16F628A at the bottom of this page.
Simple Programmer Blog
The circuit has been constructed on a PCB but can easily be built on strip-board, or a solderless breadboard. This project has been put together for anyone starting with their first PIC and the source code is heavily commented with references to the PIC datasheets and the MPASM assembler user guide. Although the PIC 16F84A is really obsolete and I wouldn't normally do a project using it, this chip is used extensively throughout education and for many people this will still be their first step into the world of PICs. I've also written a version for the PIC16F628A which is a pin compatible replacement for the 16F84A and I would recommend that if you intend to develop your interest in PIC microcontrollers you start using this device rather than the 16F84A. Please note that the 16F84 and 16F628 are not suitable for this project. You must use the 16F84A or 16F628A parts.
The heart of the LED chaser is the PIC microcontroller, IC1. This can be either a PIC16F84A or PIC16F628A as software code is provided for either device. The program that runs on this chip controls the LEDs attached to the output port pins. Resistors R1 thru R12 limit the current through LED1 - LED12 to a safe level that won't damage the PICs I/O ports or LEDs. The value of the resistors has been selected to be safe rather provide maximum brightness.
If you decide to use high brightness blue, green or white 5mm LEDs you may need to change these from 270ohms to 100ohms. For all other 5mm LEDs the 270ohm resistors will be fine. Crystal Q1 and capacitors C1 and C2 connect to the oscillator circuit inside the PIC. This generate a stable 4Mhz clock which is used by the PIC to control the timing of the microcontroller core. If you are using the PIC 16F628A you can omit these three components and use the PICs internal RC oscillator.

However, you will also need to make a change to the source code before programming the PIC so it knows to use it's internal oscillator. Capacitor C3 is used to decouple the 5 volt power supply rail. If you are building the circuit on a breadboard or stripboard you should ensure it is located close to the PICs Vdd connection (pin 14 ). The input voltage can be anywhere form 9 to 12 volts but the PIC requires a precisely controlled 5 volt supply. This is provided by IC2, a 78M05 3-terminal 5 volt regulator. Capacitor C4 decouples the input to the regulator. Diode D1 protects the circuit from accidental reverse polarity of the input voltage.
Simple Programmer Blogging Course Workbook

24c16 Simple Programmer
You can buy all the parts needed to build this project from most component suppliers world wide. In the UK you can get everything from and I've included a parts list with their part numbers below. All Rapid parts/descriptions correct at 04-Sept-2008. You should check part# and descriptions are correct when ordering in case I've made a mistake transferring them onto this page. To use with the on their home page.