Wasted an hour trying to set up a timer on the PIC microcontroller. The frequency was always wrong by an order of magnitude, I kept fiddling with the clock generators, PLLs, prescalers, and fuses. Only an hour later I found the real problem... I simply forgot that a 8-bit timer has 256 counts, not 1 count. :blobcatwoozy:
Just finished the high-voltage controller firmware in 500 lines of C. It's mostly just housekeeping tasks. The actual interesting part of the circuit board is the analog circuitry under control, which I finally can start testing tomorrow... The low-voltage controller also needs a firmware, but for now I can simulate that using a stub program on the computer... #electronics