So, judging from what i read here, most of us like “off-time” memory better than “on-time” memory
(the latter meaning that a mode is memorized after it has been on for at least a specified amount of time, while the former means there is a mode change when the flashlight has been off shorter than a certain threshold time).
The Nanjg 105c implements the unloved on-time memory, and driver programmers (as in, programming people, not the devices) mention that there need to be hardware changes made to implement off-time memory. Those changes are usually very unspecific like “you need to add a diode, capacitor and resistor”. Now, i think i now what to do with those items. The capacitor will power the microcontroller while the battery is disconnected, the diode prevents the led from being powered by the capacitor (which would drain it way too fast), and the resistor either limits the current through the capacitor at turn-on, or acts as a pull-down for the input pin that will detect the switch-off state while powered from the capacitor.
But then i looked at the Nanjg 105c pcb, and it already features a capacitor and a diode that seem to be connected just as needed for off-time memory. Maybe the capacitor value is too low for that purpose, i guess it is there just as an input filter. But it seems to me that it would suffice to change that capacitor to a higher value.
The current draw of the driver, when not powering the led, seems to be 0.3mA or less. The Atmel is specified to work down to 1.8V, and i measured the capacitor at 11uF. So from, lets say 4V down to 1.8V at 0.3mA it will last for
11uF*(4V-1.8V)/0.3mA = 0.08s. So why not just exchange that one for a 100uF one?
Ok, the Atmel still has to know when it is capacitor-powered. But it has low-voltage detection, which could be used for that.
So, to those who have actually done it, how did you change your Nanjg to off-time memory? And do you have a software driver for that?