Guide: how to flash ATtiny13a based drivers (NANJG, QLITE, etc.) with custom firmware

Awesome MRsDNF. :smiley:

The Pomona 5250 is definitely a good choice. It is well made and should last through a whole lotta flashes.

There are some projects which replaced the star code with other things, but I don’t think there are any which merely removed the solderable star bits.

For example, the s7.c code works on a stock nanjg driver, and blf-a6/tk-otc.c works on a FET+1 with room intentionally left for easy modding. But I don’t have a “STAR minus the stars”.

Out of curiousity, I just tried removing all the blinkies from s7.c (except for battcheck, which I downgraded to the simple 4-bar version), and it compiles at 452 bytes. Plenty of room left to add other stuff. Or 564 bytes with the volts+tenths battcheck. Or 836 bytes with that plus a suite of other blinkies.

BTW, that’s not strictly necessary if you only want to sense short and long presses. An unmodded nanjg can use the noinit memory decay trick to do the same thing. It doesn’t let you choose how long the threshold is though, and it’s usually about half a second.

That’s what I do with the 105D, that don’t have stars to solder an OTC on. Would be a PITA to attach that OTC somewhere else while keeping it flashable I guess. Don’t like the 105D for that reason, but I want to use the stuff I already have.

I haven’t tried it in a light yet, but I did try a memory decay firmware on the bench today. It seemed to work great, very nice! I’m looking forward to doing some more testing with it in an actual flashlight.

failing miserably. Got everything. Switched wires on clip.

Cant get a connection on chip.

error: programm enable: target doesn’t answer. 1
initialization failed. rc=–1
double check connections and try again. or use -F to override
this check

thank you

I’m far from an expert on programming but I did not have any luck recognizing the chip until I hooked a battery up to the driver the chip was on.

thanks, gave it a try, are you leaving the battery hooked up while flashing?

If you’re using the cheap clip, make sure the wires haven’t came off of the pins under the heat shrink at the point of connection at the back of the clip. Give them a gentle tug and see if they stay put. Also, use the 5.5v jumper position on the programming board.

Yes.

Wires have all been checked, broke some, repaired. I don’t see anything on the programmer about 5.5 volts.

EDIT- Have this programmer

There is 2 leds ds1 and ds2 2 holes with JP1 is this were I use a jumper ?

DS1 led on

If you’re using the USBASP, there’s a jumper.

JP1 ??? Was editing post when you posted Hoop

The jumper can be seen at the lower edge of the programmer in the picture here.
https://www.fasttech.com/products/1002900

Yup, JP1. I guess its 5V not 5.5v.

thanks will try that

Just jumped JP1 with wire and solder. No luck. Wondering if I got the right programmer.

I don’t see anything about 3.3 or 5 volts like on the fastech programmer.

I just have JP1

My USBASP boards have come with a plastic jumper that can be moved from the 3.3v position to the 5v position. That is JP1.

You’re sure all of your clip connections are going to the right place? Maybe try bending the pins inward a little bit at the end of the clip.

The voltage setting shouldn’t make any difference at this stage.

If you are sure the wiring is correct, & have tested each lead with a multi meter, then it’s likely to be an issue where it’s clipping onto the ATtiny pins.

I’ve had to bend out the clip contacts a few times to get a good connection. Also, give the chip legs a good clean, as flux can also prevent connectivity.

I never have any power connected to the driver when I flash. This may however depend on driver design. I have noticed that capacitors directly on MCU pins can interfere with flashing. If the driver is powered it would have an off time cap charged, and therefore not quickly short on first flash attempt.

I had to move an off time cap to another pin once. I guess I could have tried flashing with the light on before I moved it but I didn’t think about it at the time. I just moved it and have since then always put all voltage input stuff on PB4, works fine for ATtiny85Vs at least.