Standard Nanjg driver in dual-switch lights

I can't possibly have really discovered anything original here, just haven't seen it mentioned before. The plain, standard firmware 105Cs can be used in dual switch lights (tail clicky for on/off, momentary side switch for modes) just by wiring the side switch between the MCU's RESET pin & ground. When RESET pin is grounded, MCU shuts off just the same as when you break power with the tail switch. So a single short press of the side switch will cycle through the modes. On/off still has to be done with the tail switch, but other than the switch connections nothing on the driver or in the FW needs to be changed.

It should work on other non-Nanjg drivers as well, if their MCU has a RESET pin and you can find documentation as to which pin it is.

Nice comfy!! Very useful! Now I know what to do with my T13 that has a blown driver. I wanted to develop my own driver to support the electronic swithc input on PB3 for example, just can't find the time to do so, but this will work in the mean time.

Nice find. This would make a good option for side switching a Minimag.

Thanks, very helpful info.

Very good information indeed! Not only does it make my T13 easily rebuildable but even the awesome Convoy L4 can be easily upgraded with a Nanjg driver. w00t!!

great info on the that option for Nanjq 105c drivers ! now i have some more mod ideas for lights. :slight_smile:

Nice find comfy! This opens up so many more mod possibilities.

Bravo Comfychair

Awesome and then some. You ROCK!

I feel like whenever I think of a 105c driver question Comfychair appears with an answer! I was just thinking about the side switch the other day then I logged on and saw this! Thanks for sharing, this kind of stuff is why I love it here.

I used some of this the other day to help me fix a broken tablet/game console it was a JXD s5100b that was hard bricked. Nothing but a power light would come on and it couldn’t be recognized via the USB. I found the reset on the 8gb nand chip. I shorted it with a thumb tack, between the 4 and 5 pin while plugged it into the USB hitting the power button and the -volume (the normal way to flash firmware on a soft bricked device). I think this disabled the write protection. I then flashed new firmware from the JXD site powered it up and it’s running fine. I then flashed Skelrom’s firmware and it’s better than new.

Funny how some small thing can click enough to make sense. Once I knew the chip had a reset button I thought it might work. I gave it a 10% chance but it did the trick.

I wonder how many people have a hard bricked android that this would work on? I’m sure it would void your warranty but if you don’t have a warranty and nothing else works you have nothing to lose.

Just wondering if comfy (or anyone) knows or did this -- so if I take the standard luxdrv source code, add a mode that is 0 for the PWM value, plus use my other standard modes, and install this in a light like the Convoy L4, wouldn't the tail switch act as a lockout, and now you can turn the light ON/OFF from the side switch? Think the downside is you have to cycle through all modes to turn it off and you get the parisitic drain of course.

I was thinking the same thing Tom. I remember reading in the Attiny 13a datasheet that it has a sleep mode (or something like that were it consumes very little power). I've been wanting to try to write that into one of the modes, but time (or lack there off) is always the enemy .

How the hell do I miss these threads? CC, you gotta start sending out PM’s for stuff like this!

Wish I'd have known about this a few lights ago... Great find!

Yes, I thought about suggesting the '0% mode for off' thing, but then figured anybody capable of writing the FW (i.e.: not me) would also be capable of just writing a standard momentary switch firmware and not need the RST pin trick.

Werner's FW (beta) that I'm using on the SRK-style drivers in fact does that very thing, there's a 0% mode for OFF, but it uses a dedicated switch input and not the RST pin (meaning it changes mode without shutting the MCU down). Parasitic drain is less than 1mA using a standard 105c as a host board for the attiny13. Short press steps up to the next mode, long press steps down to the previous one. Short press from OFF gives the lowest mode, long press goes back to 0%. Long press when OFF effectively just goes to the previous mode, which is 100%... and a short press goes forward to the 0% OFF again. Very neat, very intuitive.

Oh, another drawback compared to a dual switch dedicated FW, the tail switch won't work in momentary mode, it'll still change modes the same as the standard driver in a tail clicky light.

Anyone try this on a Dry Driver?

Missed this thread too, thanks for the info comfy, I will use it some day :-)

Dunno, I have one on order but it's not here yet. Are there readable markings on the controller and a datasheet on it? No guarantees the pin layout will be the last word though, some of these things use the pins for different things depending on the firmware.

This momentary switch trick could possibly work even on controllers without a reset pin. If the controller is shut down and then powered back up within the time range for whatever it requires for a mode change, it should change modes. Limiting resistor inline with the power input to the controller, and a momentary switch between the input pin and ground. The resistor has to be high enough that current through the switch will be limited but still allow the switch to drain away enough voltage to cause the controller to shut down.

On the new ones the mcu is located under the toroid so I can’t read print (if any). I just checked and the momentary switch from laser modules just spans(outside to outside) the reset and gnd pins of the Attiny 13A so it could be soldered then potted since the switch is meant to lie flat instead.