E-switch UI Development / FSM

I have a MTN-17DDm already set for Eswitch, would Anduril be a pretty easy job to compile and flash over? Build pretending it is a D4 driver?

Andúril won’t fit on the ATtiny13 or ATtiny25.

Does your MTN driver have the ATtiny85 upgrade?

If you’re unsure, check the printing on the MCU chip with 8 legs.

Yes, it has a Tiny85

It should be pretty easy to run it on a Mtn FET+1 driver if it has tiny85. There may be unusually high parasitic drain though, if the voltage divider resistors are still there. Those aren’t needed for single-cell FSM-based lights, but if they are there IIRC they allow current to leak.

It may also be relevant to tweak calibration for VOLTAGE_FUDGE_FACTOR or perhaps the ramp shape, if the default Emisar D4 build doesn’t give the right battcheck readings or if moon doesn’t light up.

BTW, I’ve been doing a bunch of code refactoring today, to make hardware definitions easier. It’s not done yet, but I’ve been trying to put hardware-specific values and options into their own files, named after the driver type. Really, this is overdue… but better late than never I guess.

I think building the D4 flavor of Andúril should work, especially since Mountain offers that driver with the D4’s stock UI.

Remember to enable dual switch support if your light has dual switches.

If you can, I suggest making the emitter & switch wires long enough to allow easy access to the driver for future updates of Andúril. TK keeps adding more awesome features. :slight_smile:

What light are you building?

EDIT: I see you got TK’s blessing and advice while I was typing. :partying_face:

Thanks TK. Yes this particular example does have the voltage divider removed.

I also have another 17DDm like driver where I plan on swapping to a tiny85 and converting to eswitch, ill be sure to remove the voltage divider resistors.

Sofirn C8F where I want to drill some holes and put a ring of Yuji in the blank space in the reflectors. This is a bit of a long term project especially since I need to mod the driver a bit to enable independent dual channels (cut trace), and modify the host as well. That and work :slight_smile:

Sounds cool! Yuji 5mm?

Good luck, and be sure to post your build in the What did you mod today? thread. :+1:

You could also maybe drive those from the aux LED pin, using the existing facilities for that. Maximum power is lower though, like maybe 30 mA instead of 350 mA. And it’s not really dimmable except for high/low/off. But, for designs like this, I recently added some support for making the aux LEDs and main LEDs mutually exclusive, so it won’t have both on at the same time. It would still be a little awkward though, since that would mean the aux LEDs are only on while the driver is asleep, like in “off” mode or lockout mode.

Ideally I want to drive the Yuji off the 7135 channel, changing the ramp to accommodate them. They will be a pre throw warm flood. They will also serve candle mode.

The niggle with them is they really only like 30ma each so the PWM values will all be low. I am guessing MAX_1x7135 should set the max 7135 PWM value for the strobes?

Yes sir, 5mm 3200k :slight_smile:

The MAX_1x7135 value determines which ramp level is the highest before the FET activates. It does not determine the PWM value.

If the emitters can only handle 30mA each, and there are three of them, it may not be a good idea to drive them with a 350mA chip. Even with PWM to reduce the average current, the momentary current will still be about 4X the safe level.

But if you try it, it looks like the 7135 part of the ramp should max out at 65/255. (3 * 30mA / 350mA) * 255 = 65. So, after calculating a ramp, multiply all the 7135 ramp values by about 0.257 to scale them down to the desired ceiling level.

Or you could maybe replace the 7135 chip with something lower-powered… or put a lower-powered chip on the aux LED pin and treat it as a 3-channel driver.

What does FSM stand for?

Frightening Spaghetti Monster.
Or Finite State Machine.

That is better answers than Wiki gave me. :+1:

Do these drivers have the voltage divider resistor? There are two resistors clearly shown on the fourth picture. It it near the 7135 chip or on the opposite side?

Finite State Machine, or [F-word] Spaghetti Monster.

Why? Because it takes the mess of spaghetti code typically associated with low-level firmware and locks it away in a box where people don’t have to care about the monster inside. Instead it presents a more user-friendly interface in the form of a finite state machine, because that’s typically how people describe flashlight UIs. A finite state machine is basically a flowchart.

Suggested F words include:

  • Flashlight
  • Flying
  • FSM
  • Feisty
  • Filthy
  • Fabulous
  • Funky
  • Fancy
  • Fetid
  • Fortuitous
  • Frightening
  • Flirtatious
  • Flimsy
  • Frustrating
  • Formidable
  • Flaccid
  • Fantastic
  • Feculent
  • Friendly

Or people can probably think of a few other choice F-words. :wink:

Yes, the one labelled R1, connected to pin 7, is along the path which allows current to leak. Removing it would stop the leak.

For BLF-A6 and Bistro, this is a good thing. The offtime measurement depends on current leaking out at a predictable and high enough rate. And for multi-cell serial lights it’s necessary to scale voltage down to a usable range. But for single cell e-switch lights it’s not desirable.

Those banggood drivers don’t have a tiny85 though, so they can’t run FSM.

Thanks TK for all the explanations. I have put Attiny 85’s on a couple of these drivers and run the eswitch between pin 2 and earth.
When I read through these posts I feel like a Friggin Scared Moose. :stuck_out_tongue:

I figured that what else it could be while laying in bed thinking about this. Too far into this hobby where this ends up happening…

I would definitely need to test this on the bench with the PWM to see how it behaves. I have seen a test of these where at 120mA they start to go blue… Are there lower power 7135s?

There should be lower-power chips of the same general type. I’m just not familiar with them.

Lots of code updates lately, though most of them aren’t UI changes. Most are to keep code cleaner and more manageable, splitting hardware-specific bits out into their own files and such. This way, new drivers can be added more easily with less clutter. Drop in a hardware layout definition and a UI config file, and it should be pretty much done.

Due to the way the C preprocessor works though, it does typically still require adding a couple lines to the main source files. But the changes there are a lot smaller than they used to be, and easier to read.

Anyway, I paid off some technical debt so I’m done for the evening.