A Microchip PIC16F84 LED Sequencer – Part 1

With the start of a new decade, a pandemic where we are on lock-down and the arrival spring, it was a perfect time to go through the office and reorganize. While I was sorting and organizing, I came across an old LED Sequencer that I had built back when I was 17 years old which was a little more than 20 years ago. The LED Sequencer, which you can see below, was based on a Microchip PIC16F84 and introduced me to low-level assembly language which provided me the foundation on which I’ve built my embedded systems career. After finding this old gem, I thought it would be fun to write-up a small series that resurrects this relic and dives deep into how microcontrollers work and perhaps even to dive into assembly language. Before we dive deep into microcontrollers, I’ll use this post to describe a little bit about the LED Sequencer, it’s circuitry and what the heck the deal is with the way this board is assembled.

Now this little board is not the first LED sequencer I had built, but it was the first that used what I like to call a “professional” microcontroller. Prior to building this, I had helped build and programmed a rather elaborate LED sequencer containing several interconnected panels that each contained a set of eight tri-color LEDs. We used these LED panels for our high school F.I.R.S.T robotics teams robot cart that we used to wheel our robot from the pit to the playing field.

I built this little sequencer as an experiment platform to help me learn how to program the Microchip PIC16F84. I had been using a Basic Stamp controller previously which allowed me to write in Basic, but I wanted to learn how to write in assembly and use a “professional” microcontroller. I had recently discovered in a magazine a “No Parts PIC Programmer” and had built it in order to get started programming these parts. I recall spending several weeks trying to figure out how to program the microcontroller because to me, a novice at the time, didn’t realize you had to apply both 5 volts and 3.3 volts to the part during the programming cycle. I thought you only applied 5 volts to erase and program and then 3.3 volts to run the device. I was close, you could run the device on 3.3 but you had to apply both voltages to erase and program it!

This experimenters board was assembled on a perf board which twenty years ago was what we used over low cost, quick turn PCB’s. You can see that there is an 18-pin socket that I used to insert the microcontroller onto the board. If I wanted to reprogram the chip, I’d remove it from the DIP socket and place it into the programmer I had built! This was a very dangerous process which often resulted in bent microcontroller pins. You can see though that I tried to make the board as clean as possible. Using the LED leads to bridge connections (even though the soldering job on this looks horrible!) and lining up the resistors and capacitors so that it looked clean and “professional”.

Looking at this board, it’s a bit interesting to see that there is NOT a crystal oscillator on-board. A PIC16F84 typically uses a 4 MHZ or 20 MHz crystal oscillator. Undoubtedly, this board is using the RC circuit option to generate a clock for the microcontroller. This certainly has the advantage of being lower cost, but RC oscillator circuits inherently are not very accurate, and they can vary quite a bit with temperature. For a simple LED sequencer though, this trade was probably okay for a cash strapped high school student. I would bet back then the oscillators were several dollars and back then minimum wage was ~ $4.10 per hour. The trade-offs between cost and quality never cease!

Now that we understand at a high-level the hardware that we are working with, next month I will dive into the details on the PIC16F84 and explore how we can setup a modern development environment to write a quick C based program to see if this hardware relic will still function. If it does, the next steps will be to dive into the instruction set and start playing with some assembly language programming!

Share >

4 thoughts on “A Microchip PIC16F84 LED Sequencer – Part 1

  1. Gosh – This is exactly how I started in embedded, single chip processors in about 1994.
    – Basic Stamp, proved it worked to me and that I could use the raw PIC chips.
    – Bought the CCS C compiler for $99.00 and a $69.00 PIC16C programmer from Fred Eady (They were called PIC16 ‘C’ chips at that time)
    – and I was off!

    Now I work with 32 bit processors @ 250 MHz with 2MB flash and 512 kB ram – runs faster than my 386SX PC did in 1994 and the 386SX only slightly edges it out on ram at 640k.

    • Awesome! I don’t know why I never bought the CCS C compiler. I either never found it or the $99 seemed like to much money at the time lol.

      Thanks for sharing!

  2. Thanks for sharing, this was a lot of fun to read.
    When I was a similar age, I was playing with TTL (plain, not LS).
    At least those parts only needed 5V, but they sure did use a lot of current.
    Please keep sharing more stories!
    Glenn

  3. I started with the PIC16F84 too!
    I learned about microcontrollers using the old 8051, but I started building things with the 16F84.
    I built my programmer as well, it worked like a charm with PTH components, but for some mysterious reasons, the SMD version never worked out. It’s a shame that I do not have the circuit or the schematics anymore to debug it nowadays.

Leave a Reply to Jacob Beningo Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.