So tonight it was Barry's turn to induct us into the deep metallurgy of small microprocessors, the ones you program once for some permanent job in a car engine or, in Barry's case, a DC light dimmer.
Boats are wired for DC but don't come with a dimmer switch, usually. Barry's gizmo, a coventure, takes DC into a pulse width modulator, written in software, and matched with code to the interface, in this case either one or two switches, and rather complex behaviors.
A feature of this Motorola HC05 series chip is a ripple counter with some flag bits, such as COP. Unless you "kick the dog" every few cycles, COP'll flip and send a reset; useful for when poorly written code enters an infinite loop or whatever. You don't want simple coding errors to devalue the hardware, or maybe the code makes intelligent use of dog kicking internally. Either way, nice to know that COP is there.
So the boat owner chooses to wire either one or two switches, then meters DC power at tiny calibrations, or full on, though even this max brightness setting includes sleeping, i.e. going to low voltage for short intervals.
Given all the interrupts in this picture, 109 cycles a second mas o meno, with 256 intervals within each of those, there's lots of pushing registers to stack, running off someplace, coming back and popping the stack. Nesting subroutines is a source of subtle errors and stack overflows so Barry's code stays pretty flat. He's pretty much self taught, and being a smart guy, he made sure he did a good job of teaching it.
Safe to say, this was pretty unfamiliar stuff for a lot of those present, and Barry didn't get to the graphical (windowed) debugger until close to the end. That actually gave us stepped execution, break points, on a simulated chip, with registers, a next program line pointer (under 500 max lines), other flag indicators, and the very limited 64 bytes of RAM (right Barry?), all conveniently displayed.
I appreciated Barry's willingness to not hold back about the nitty gritty details, even though he knew we weren't tracking in all cases.