Necessity is the mother of invention. It is also true that invention necessitates learning new things. And such was the case on the stormy Tuesday morning our story begins. Distant echos of thunder reverberated in the small 8 x 16 workshop, drawing my attention to the surge suppressor powering my bench. With only a few vacation days left, my goal of finishing the hacked dancing Santa Claus toy was far from complete. It was for a Secret Santa gift, and I wanted to impress. The Santa moved from side to side as it sang a song. I wanted to replace the song with a custom MP3 track. In 2008, MP3 players were cheap and ripe for hacking. They could readily be picked up at local thrift shops, and I had picked up a few. It soon became clear, however, that I would need a microcontroller to make it do what I wanted it to do.
I had never used a microcontroller before. I knew what they were however, and had several PIC16F84s that I removed from some old scrap boards I acquired from my day job. So I scoured the internet for PIC tutorials until I found what I thought was a good one. It was here where I became instantly set in my ways – If you want me to try out your fancy shmancy microcontroller – you will walk me though setting up the IDE and writing/compiling/uploading code for the blinkenlights. If you can’t do that, keep your microcontroller because I don’t want it.
The tutorial I chose did not do this, which made it virtually useless. But I kept searching until I found a suitable one. I already had MPlab and a programmer setup to load hex files for my job. The tutorial showed me how to use the wizard to setup the IDE for assembly programming of the 16F84. Within an hour or so, I had everything on the breadboard wired up.
My heart was thumping as I applied the 5 volts. Would it work? Had I just programmed my very first microcontroller? Would it all end in tears? Alas, it did not work. It took me about half an hour before I realized I left the master clear floating. With the insertion of one wire, it worked! Light the fireworks!
I probably stared at that blinking red LED for fifteen minutes. I had done this. Not only was this microcontroller doing exactly what I told it to do, I understood how it was doing it. And thus began a lifelong learning process into the world of embedded computing. So next time you’re uploading your 2,000 line program into your 32 bit ARM controller, think back and remember how it all started.
And now it’s your turn. Tell us about your very first microcontroller project.