For anyone following along, the power domains are:
- constant 5V supplied via plugged-in AC cord (VDD on schematic)
- switched 5V to R Pi Zero W via load switch on PCB (V5P on schematic)
- switched B+ DC and filament AC via volume control switch contacts
The PIC micro is powered from constant 5V, and its main job is to manage the power to the R Pi Zero W - removing supply only after shutdown is complete. The mechanism for this is inspired by the (excellent) writeup by James Lewis on a Raspberry Pi Soft Power Controller circuit. When the volume knob power switch is turned on, the PIC detects the filament voltage via optocoupler U1 and applies V5P to the R Pi. When the filament voltage goes away (volume knob power switch turned off) the PIC will assert the GPIO pin to the process running on the Pi to request a shutdown, and then manage the V5P rail accordingly.
Sure, it's silly to have both the hardwire control for power management and the I2C link for the knob rotation info ... but it's a heck of a lot easier to debug the hardwire interface, and I can just steal the Pi side process code rather than having to worry about duplicating that functionality in I2C land merely in order to get the R Pi running... Maybe I'll migrate it all to I2C in the future. But I suspect that this will be another case of "the working is the enemy of the planned".
So, next step is to get some rudimentary code written for the PIC to implement filament voltage detection and power management handshake stuff, and throw in the Neopixel driver stuff too (reused from 10 MHz Rb Standard project) because who doesn't like a status LED?