I've been screwing around with MCC (nope, I'm not going to use it to generate code) to see what could be done with a 16F1704 and here's what I managed to come up with so far:
Use two ADC channels to monitor input voltage (for UVLO) and output voltage and maybe trigger the conversion using one of the available timers.
Use one of the op amps to amplify the voltage across the switching MOSFET's current sense resistor and feed it into one of the comparators which will be used to trigger the auto shutdown of the COG module used to drive the gate. This comparator will have the other input connected to the internal voltage reference.
The other comparator will be used for the constant current loop regulating the current through the LED, monitoring the voltage across a low-side shunt while having its other input connected to the DAC output internally.
I'm wondering if I can assign the same pin to both the op amp output and comparator input, that would be handy.
Does this look like it's not going to work?
EDIT: Might use the CLC module too if I want the COG auto-shutdown to be triggered from multiple sources which might result in a simpler control loop.