It is just proof of concept code but you could try this:
#define F_CPU 4800000UL #include <avr/io.h> #include <util/delay.h>#define FET_PIN PORTB1
int main(void)
{
while( 1==1 )
{
/* Empty the gate. */
DDRB |= (1 << FET_PIN);
_delay_ms( 1 );
DDRB &= ~(1 << FET_PIN);for( uint16_t i = 0; i < 150; ++i ) { /* Charge a bit. */ PORTB |= (1 << FET_PIN); PORTB &= ~(1 << FET_PIN); _delay_ms( 200 ); } }
}
It's a slow ramp on the FET gate charge which repeats forever. It goes from 'invisible' to 'a bit too bright to look at directly' on a BLF-A6 FET+1 driver. From the spec sheet, your small FET should charge much more quickly as the gate charge is about 1/8th. You can avoid the higher end by reducing the '150' loop counter. Slow down the ramp by increasing the '200' delay. If the steps are too large, a CPU frequency of 9.6 MHz instead of 4.8 MHz should help. And if it's still too bright, PWM could be done with some work. Oh and keep an eye on the FET if you run this, it could get fairly hot at moderate output.
How this would behave with a depleting cell depends on the output voltage of the boost circuit at near zero load (ie. I don't have a clue). On a li-ion setup I can compensate for the lower voltage with more charge. Could perhaps do something similar here if there was a voltage readout, which I understand would be tricky to fit in there. The other "fix" is to just have more modes.
Also, I've never tried this but the weird code could be probably replaced with regular PWM and a resistor of the right value between the PWM pin and the FET gate. I'm not sure about the component sizing (not my domain and seems very tight) but ideally, I think you could keep pin 6 as it is and connect pin 5 to the FET gate via through a resistor, or the other way around. That would make one PWM channel pulse the FET full on for the high modes and the other give the FET only partial charge for the low modes. It would be much easier to adapt current dual-PWM firmware that way. A simple matter of disabling output of the unused PWM pin for any given mode.
A completely different option would be to keep the "full on" short FET pulse but with lower frequency to reduce the PWM duty cycle. You can get N times lower output by decreasing PWM frequency by a factor of N. But it will become ugly at some point. It is also somewhat annoying to code, like what I posted above.
Anyway, this long rambling post is just to say there are options so don't worry too much about current lack of a very low mode. I hope I didn't write anything too crazy :)