Proposal: since these requirements are so different from what we originally thought and the program structure will need to change significantly, I think we should just start a new project called power_select
that implements these requirements.
Requirements
Read ADC values for all these things:
All of these values will require a scaling factor applied (TBD from onsite testing), then sent over CAN for telemetry. Note that these values are all uint16_ts, so we can hopefully pack it all into just 2 CAN messages.
DCDC fault will go high on fault, register an interrupt and send a CAN message on fault.
Valid pins
These are active-low and show if a power supply is connected. Pending onsite testing for which pin corresponds to which supply, but just print all of these on minicom. Mostly just for debugging.
Note about validation
Due to hardware shenanigans, to actually power the board, jumper cable the controller board from the programmer, then turn on power (12V power supply or whatever), then un-jumper the programmer.
Rough notes from a meeting with hardware:
Idea: has priority system that depends on hardware config that allows switching between input supplies
Three inputs:
Aux power
Dcdc power
Power supply
Hardware automatically selects which supply is highest prio
Priorities:
Power supply
DCDC
Aux
Output of this board is front and rear power distribution
Things firmware has to do
PB8 Enable - just leave it for now, it’s pulled up internally. Pull down if we want to disable hardware prioritisation (basically never)
Take a bunch of sense measurements
All the ADC readings listed on schematics
DCDC Fault - it will pull high on fault, send CAN message
VALID pins: will tell which supplies are connected (active low), good for debugging, so just minicom log it
SHDN: don’t do anything for now, eventually trigger it if overcurrent from the ISense pins. It’s pulled high internally, so to trigger it pull down, but for now just don’t do anything.
Validation note
Needs a jump start from the controller board power, so jump it with a programmer jumper