I have been stalled in my work on my robot. Current bug just seems insurmountable. I would come home and avoid the thing like the plague. So I decided to purposefully work on something else for a while.So I looked around my shop and dug up the partially completed projects. The one that caught my eye was a Sailboat Race Starter that I had gotten stuck on. Every time the horn would blow, the MSP430 processor would reboot. I would like to have this for summer fun so I decided to give the system a new brain.
I picked a PIC16F627A that I had from another project. Not the ideal PIC for this task, but it would do. I got a breadboard going and quickly had the processor up and running. Next I rehosted the code from the MSP430 and got the basic logic working. For this I had to learn the peripherals on the PIC. This took a few evenings.
Once this was working, I hooked up a FET to drive the relay that will in turn turn on the car horn. Got this working without the horn (need to save my hearing!) first. Then around 9:30PM I plugged in the horn, and was horrified to see the processor reboot again just like the MSP430.
But it was getting late so I went to bed. Little good that did as I tossed and turned all night with the problem going through my head. At work I discussed it with friends, and no one had ideas as to the problem, but they did give me things to look at.
So tonight, I tidy up the workbench, instrument the circuit to monitor various voltages, get all the scope trigger points adjusted without the horn plugged in, and then I plug in the horn.
Guess what, I can’t make it fail. It is working like a charm. Just as designed and envisioned. Now I am really confused. Why did it fail last night but not tonight? What might I have changed? What might I change in board layout that might make this problem come back again?