Flashing Anduril to a Haikelite MT09R?

I know the MT09R is kind of old news to most people here, but I just got one and would really like to get Anduril running on it. Narsil is alright, but after having Anduril on some other lights, I’m spoiled and want it on this one too!
In theory it should be possible but I don’t quite know enough yet to get it done.

I ran across this post that says the MT09R uses a similar driver to the Astrolux MF01S which uses Anduril, and some people said that version of the code might work on the MT09R too.
I know some of the pinout definitions may need to be altered in the code to get this to work, but I’m not exactly sure what needs to change if anything. The thing that worries me the most is that the MF01S appears to use a dual FET + resistor array driver, while the MT09R seems to only have a single FET + resistor array. Apprently there are actually two FETs, I just wasn’t looking in the right place.

Another question I have has to do with the programming pins on the MT09R driver board. They are all labeled “Test” so I don’t know what pin needs to be connected to what for flashing new firmware. If anyone can answer that, it’d be a huge help. Nevermind, see my comment.

Here is a picture of the driver on my MT09R if it helps. Notice the single FET in the picture (but, strangely enough, it has a spot for a 2nd one?). Nevermind, there are two FETs, I just didn’t know they looked different.

So essentially I need to know if it’s possible, and if so, what do I need to change to make it happen. I’ll happily share the code if I can get it to work so that others can benefit too.

Ignore my question about the “Test” pins on the board. Originally I thought I’d need some sort of pogo-pin style connector for programming, but I learned about the SOIC8 clip and will use it instead. In fact, those test points may not even be for programming at all…

I’m still curious how to configure Anduril to work with this light though.

Ahh! I was wondering what that was! Thanks, that makes a lot more sense now.

So then I guess this might be easier than I originally thought. Just a matter of making sure the pinouts of the chip are correct in the code and flashing the firmware. Maybe.

Yeah, double check pinouts, but otherwise it should be easy. To get it nice, you’ll have to spend some time playing with the ramp configs…

I searched a little bit, and I don’t see anything for pinouts or Anduril on the driver. But, Texas_Ace made them, and if we’re lucky he might pop in this thread before you go probing with your DMM. Pins 3, 5, and 6 are what you need to worry most about. If it’s based on previous designs, pin 2 would be SW, pin 3 would be Switch LED, pin 5 and 6 would be the FETs, and pin 7 would be a voltage divider. But for layout reasons that could’ve changed.

The more I look at it, the more it looks like he just modified his SRK driver. Moved from 7135s to the U4 fet to control low modes, since 7135s aren’t suitable for the multi-cell voltage. So the pinout is probably what I stated above - look to verify that rather than just figure it out from scratch first. If that is the case, it’s a close fit to at least the BLF GT hwdef file. You can reference that to figure out how to implement the voltage divider properly, anyway.

Thanks! That actually helps a ton and gives me a good starting point.

I dug around a fair bit too and didn’t see any documentation for it either. That was kind of the conclusion I came to as well regarding the pinouts, but having some confirmation would be nice. The hwdef file for the BLF GT looks very similar to the file for the MF01S I was thinking of modifying so that’s some nice reassurance. Either way, I have a few days to keep learning before my programmer arrives in the mail, maybe I’ll discover something between now and then.

As far as ramp configs go, that shouldn’t be too big of a deal besides some trial and error. Just to be sure I understand, those configs are for calibrating the transition between the two output channels, correct? Once I get the core functionality working I can fine tune the details.

Another question I just thought of has to do with the values on lines 49 and 52 (ADC readings) of the hwdef file. They seem to be some sort of an offset for voltages maybe? Do these matter? Need to do more research…

Right - the ramp configs define PWM levels for the separate channels. So the first value represents the PWM level of that channel at ramp level 1, and the last value represents ramp level 150, and there should be 150 total values per PWM level. The values themselves are based on making the transitions look acceptable, and having the brightness ramp in a way that feels linear. I say “feels” because it’s probably some kind of exponential function, since 4x the lumens “looks” twice a bright. Basically I’m pretty sure somewhere in the process used to develop the ramping levels, there has to be witchcraft involved.

As for the ADC readings, if you’re referring to VOLTAGE_FUDGE_FACTOR, yeah it’s an adjustment for how the driver’s voltage readings differ from reality. Another “trial and error” thing if you have issues, like your fully charged cells reading 4.0 or something.

That makes sense. I found this python script by ToyKeeper and wondered if it was related. It seems like it’s used to generate the ramp levels so that may save me some time from having to just test it manually a ton.

I was actually looking at these lines in the code:
// Raw ADC readings at 4.4V and 2.2V (in-between, we assume values form a straight line)
#ifndef ADC_44
#define ADC_44 (234*4)
#endif
#ifndef ADC_22
#define ADC_22 (117*4)
#endif

Specifically, the numbers after the ADC_44 and ADC_22, since these are different depending on which hwdef file you look at.

I have an HT70 I’ve been meaning to put Anduril on—I think the driver is the same as an MT09R. So, following.

Any luck getting Anduril on this light?

Yes actually! Sorry for not making an update post. I got busy and kind of forgot.

I will do a more detailed explanation later tonight (I ran into some unrelated issues), but essentially it was as simple as connecting the programmer and flashing the MF01S .hex firmware file onto the MT09R and it worked perfectly. I didn’t feel the need to modify any of the configuration options or anything, though some people may.

Yes, it would be great if you could post a how-to. I’m surprised you didn’t have to compile anything.

I tried this today, -looks like turbo output is less than the original……
Anyone have any tips on how to adjust this ?
I prefer the Anduril2 firmware but this light is all about turbo…

EDIT - MF01S .hex works fine after I re-did thermal config.

-Dan