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!