Close

Oops...

A project log for Well well

Monitoring the monitor that monitors the well

darrin-bDarrin B 01/04/2024 at 18:230 Comments

Testing the device, means that I'm playing a videogame. There's not much that can I do while waiting for the well to cycle. Sometimes, though, I am looking over the code for potential bugs. I did find a pair of minor ones, and I corrected one I considered a show stopper. One other bug still eludes me. While looking for it, a possible power saving idea came to me, turn the on-chip crystal driver off. Since the device is using an external oscillator, this should not be a problem, right?

Wanting to test the bug fixes, I flashed the new code in to a device. Maybe it flashed, I don't recall the exact error message that came back from the dev studio but the device seemed to be dead. A few more unsuccessful attempts to re-flash the device convinced me to build a new wire harness to connect the board to the debug system. With that in hand I resumed the quest.

Still no luck. Could it be that I killed the oscillator, or something else, while poking around the board with the voltmeter? Warm up the o-scope, one probe on the Z8's clock input and the other on the debug input. There's the 20 MHz signal, the Z8 should be running. Oddly, there was no activity on DBG. Poke, prod, oopsie, just shorted two pins with the probe. What? The status LEDs just lit up. That could mean that my code is executing. How odd. Didn't I read something about...

The actual clock signal used inside the Z8 is derived from the signal on the XOUT (Crystal Output) pin, not the XIN (Crystal Input) pin that the oscillator is attached to. Shorting XIN and XOUT forces a clock signal in to the chip, allowing everything to function and re-flashing the chip possible. Connecting two outputs got the job done!

Now that all of the non-functioning devices have been reflashed and the new code is monitoring my well, I'm again waiting for the pump to cycle. I think I should go slay some rodents of unusual size and leave the option bits alone.

Discussions