Anduril ... 2?

:+1:

You can ignore that or wrap/move it (line 66 “static inline void ADC_voltage_handler();”) in a #ifdef USE_LVP section

file fsm-adc.h

#define VOLTAGE LOW 29 to whatever you like like 22 ( 2.2V)

Thanks but I needed to completely disable it.

When it will not compile, no way ;))

Currently Anduril doesn’t compile without LVP, because things like battcheck depend on USE_LVP. A workaround is to start with the official source code and remove the content of low_voltage() in anduril.c.

Well what bitew told me worked (thanks again) and I could test my driver, it works very well aside from the Vbatt voltage divider pin, I don’t exactly know what is the issue with it. Before disabling LVP I had the Anduril boot up flash but the button was unresponsive, no Enable or DAC signal so I suspected it was LVP/voltage divider.
The driver has a regulated boost converter for powering the MCU at 3V, below 3Vbatt Vcc=3V and above 3Vbatt Vcc=Vbatt, so of course a voltage divider is needed to read the battery voltage. Except at 3Vbatt and under I measure 2.34V on the voltage divider pin, and it increases slightly above 3Vbatt. With the 330k/100k divider I should get 0.7V at 3Vbatt, it looks to me that it is being pulled up by the MCU. No short with the pins (pulled up) directly next to it, maybe it’s the voltage divider pin that is pulled up, maybe a mistake in my hwdef file, or maybe the pin is defective ??

Here’s my hwdef file

The SP10S PRO hwdef has some fuse settings, I don’t know what they’re for.

Edit : I just realised that for testing without LVP I could have just removed the voltage divider code and the MCU would have read VCC=3V or higher at all Vbatt.

The only non-default fuse setting should be enabling BOD while active. Sofirn noticed that if you smack the SP10 Pro on a table a few times, eventually the momentary loss of power could lock up the MCU and you’d need to break the power to get it to come back on. Enabling BOD addressed this.

I just took a quick glance at the hwdef, I don’t see anything glaringly wrong. You could probably decrease the MCU clock speed, but that shouldn’t have much affect on standby drain since the MCU is sleeping. It does still need to wake up and take ADC readings, so that contributes some to standby drain.

OK thanks for checking.
I just tried banging my PL09, it also has a button so that can disconnect the power, it always turn on without issue, so it’s probably something specific with the SP10 Pro rather than the T1616.
Regarding undercclocking, there is dynamic underclocking, so 2.5MHz at the bottom of the ramp IIRC.

I reflowed another T1616 and now it works :slight_smile:

I just finished assembling my nimh/li-ion FWAA and I noticed the AUX LEDs don’t work with Nimh :frowning: I guess the LVP for the AUX doesn’t take into account the second lower working voltage range ?

Shoot, good catch! I need to add that in. AFAIK, you now have the first Anduril AA light with aux. And now that aux LVP (mostly) works…

Yeah :smiley: , and I guess there’s no RGB voltage mode for Nimh ?, though I’m not sure it would work very well with the flat voltage of Nimh.

I have an Anduril 2 question. I’ve been trying to get Hybrid Memory Mode setup and seem to be having issues. I have 2 D4V2’s running the same anduril.2021-12-13.emisar-d4v2.hex firmware. On both lights I was able to do 10c from on to activate manual memory and save current brightness, and this works fine on both lights. But, only one of the lights will take the setting for the manual memory timer. If I do 10h from on, then after the 2nd flash do 5 clicks, it should be set to last used brightness for 5 minutes, then revert back to the saved manual memory. This works on one light, but not the other. The other still stays at manual memory. So I guess what I’d like to know, am I even doing this right?

yes,
you are using the same steps that work for me to set manual memory, and memory timer, on my Anduril 2 lights… FWAA, TS10, SP10, SC21…

I cannot explain why it only works on one of your lights

Thanks for at least confirming I’m on the right path. Let me do another factory reset and try again just to make sure I didn’t miss something.

Right now it misses the dual voltage check like here: ~toykeeper/flashlight-firmware/anduril2 : contents of ToyKeeper/spaghetti-monster/fsm-adc.c at revision 659

We could hook into low_voltage() to reduce code duplication. When the voltage is low, it would turn off the aux LEDs, but would not turn them on again when the voltage recovers.

Factory reset didn’t help, and I tried setting it up on another one of my lights, a DT8. I get the same thing. Manual Memory works, but the memory timer (hybrid memory) doesn’t take. When you go through the motions of 10h from on, wait 2 blinks and click for how many minutes, it looks like it is doing it correctly. However, turning the light on, it only goes to the manual memory saved setting.

After some playing around, I think I have a repeatable method for getting hybrid memory to work for me.

Factory Reset
10c from On to Activate Manual Memory and save current brightness. Light operates as Manual Memory.
10h from On, release after 2nd flash, click 5 times for 5 minute timer. Still operates as Manual Memory.
10h from On, release after 1st flash, click 1 time to disable manual memory. Light operates as Hybrid Memory with 5 minute timer.

If I reverse the last 2 steps, after 10h from On, release after 1st flash, click 1 time to disable manual memory, it will work in Hybrid Memory, but I don’t know what the minutes would be set at since they have not been set. So the last step would make sure its a 5 minute timer. So, following the order above, I can have working Hybrid Memory with correct timer everytime.

I haven’t gone through all my Anduril lights yet, but 4 lights in and this is working each time. Maybe this will help someone else who is also struggling with Hybrid Memory.

I just pushed a fix for this to my branch, rev 626. The only change is in aux-leds.c. I don’t have a test light for this, so if you would, give it a shot and let me know how it goes.

This fix is only for single-color aux. I’m with you in that I don’t think the voltage-based RGB would work too well with NiMH.

That was fast :smiley:

So do I need to test with only one aux led instead of RGB ?