Summer is over! But even as cool weather sets in, the Oscilloclock.com lab is smoking hot, preparing for…
Visit the Oscilloclock.com booth, and check out the luxury 2013 edition Model 1S – to be announced in this blog at end October. One unit will go on sale at the event!
There are probably many people who think that microcontrollers are bug-free. After all, they are glorified integrated circuits; a hard-wired jumble of infinitesimal transistor logic gates. There should be no unexpected behavior, as long as you operate the device within the rated voltage and temperature parameters….
Wrong!
What we tend to forget from our CPU architecture classes is that a CPU actually has a program inside. Known as microcode, its primary function is to interpret each instruction into the right electrical signals to drive the various parts of the CPU. For example, an addlw 0x7F instruction might involve directing the ALU’s input to the next word in program memory (0x7F), and then telling the ALU to add it to WREG, with output set back in WREG. The microcode for addwf MyVar would be different again; it needs to get a value in RAM, and set the result back there too.
Well, where there is a program, there will definitely be bugs.
My first experience with a microcontroller bug cost me several weekends of frustration, fretting, and frantic but fruitless rework. Here’s how it happened:
Oscilloclock Gone Wild
It was the early days of the Prototype, And things were looking great! My dream was coming to fruition! Except… every once in a while, the clock would go absolutely berserk. Seemingly at random, it would start displaying crazy, meaningless images, and controls would cease to function. Sometimes it would recover; other times, it would exhibit brain death – requiring a hard reset.
April Fool’s? No – it’s a PIC bug!
No amount of testing or experimentation could tell me what the problem was. I rewrote huge blocks of code. I removed massive chunks to simplify the code. I drank more and more coffee. Sleepless nights and grumpy days ensued, wasting my precious youth!
Oscilloclock.com proudly presents a new feature – Seasonal Treats !
This month, the ghosts come out of the attic and merge with the electron stream, leaving their telltale prints in the phosphor… but if you get too scared? Just push the button and blow them up!
I personally delivered the StokesScope Model 1 clock in late 2010. The excitement! The fervour! We were so giddy we had to take a break in the middle.
All went well except for 1 major mishap, which I will share in a future post. Subscribe so you don’t miss the gory details and lessons learned.
To be ‘green’ I re-used an old printer boxUnwrapping the control unitOoos and ahhhsSleek anodized aluminium knob gives great contrastTime for a break! (No, it’s not Hong Kong yet)Not as delicate as it looksCRT all set up…Let’s plug it in… with military spec connectorsLet the GPS settle in, and .. Voila!A year later… after a move… and Midnight in Hong Kong