NLITE, a free firmware for NANJG drivers

Thank you JonnyC.

That fixed the problem.

Sweet!

I always perform erase before writing new sw. I found that without this driver often acts like nothing happened, writing was good, no errors but retains previous sw behavior!!!

Yeah, that's exactly what was happening to me without the erase. Although I think I did notice that it was failing verification after the write but I just wasn't noticing the message.

Do you do the erase separately or just add -e into the command to flash?

avrdude -p t13 -c usbasp -u -e -Uflash:[...]?

I always just issue it first before doing any flashing.

If I bridge all stars to ground I get: HMLM and no memory… right?
Is no memory, no memory or short cycle memory?…If I am in low and want to go to moon is this possible?

I am also confused about the avrdude commands above, I read here
“Recommended fuses are low: 0x75, high: 0xFF.”

but i read in this thread 0x79…?

Another issue I had lately is that if I am in a a mode i needed to doubleclick to change to next mode, was this always the case on nanjgs??? Because i find that weird.

Yup, because these don't measure the "off" time and can only measure "on" time, after the light is on for more than two seconds to get to the next mode you have to turn it off and on twice. You can add a capacitor so the driver can utilize brown-out detection (others have done this), but I just haven't bothered. But I agree, the drivers that come with my Solarforce drop-ins for example have a nicer UI (if off for a split second it will come on in the next mode).

The string I use for flashing this one is:

avrdude -p t13 -c usbasp -u -Uflash:w:nlite.hex:a -Ulfuse:w:0x79:m -Uhfuse:w:0xed:m

and never had any issues or errors. The fuses for flashing luxdrv are different, -Ulfuse:w:0x75:m -Uhfuse:w:0xFF:m

-----

I've added DIP switches for my drivers running NLITE. You can alter the config just by removing the battery and reaching in with a pencil/scribe/pointed stick/etc.

:)

the dip switches are really nice.

just tested it with the correct fuses 75 and FF :wink:
and I get 2.8A,0.7A,0.1,moon from a standard nanjg105c
no memory is indeed short cycle memory I curse 18650 for inventing it…

Some nanjg arent flashable and I havent figured why…

Some of them are locked permanently and can't be reflashed at all ever, some just need an erase before flashing [avrdude -p t13 -c usbasp -u -e].

edit: And they can't be flashed if one of the stars is closed, I think it's #3, wish I could remember who here discovered that...

Any of them CAN be erased… there is no permanent lock against erasing. There is the possibility of programming the RESET disable fuse bit in a way that inhibits ISP programming. High voltage serial programming mode would be required to erase the chip.

There is also the possibility that circuitry on pins 1/5/6/7 of the processor could inhibit programming. You might want to try reducing the speed of the programming clock in that case…

And yes, connecting a star 3 (processor pin 5) to ground will inhibit programming.

I am not sure why some are not programmable, it has something to do with the soic clip.
How to reduce the speed?

I unsolder them, flash, solder on again like I did before I got the clip…just takes a few minutes more…

Let’s remind people about this subject :slight_smile:

Is my understanding correct that nlite canNOT be programmed onto a driver if ANY of the stars have been bridged?

I bridged the 2nd star on an AK-47 and for whatever reason, cannot program nlite on this board. minidrv on the other hand programs as expected.

Thank you.

For what it’s worth. I receive the following message when trying to erase the drive (also does not seem to be working) using Comfy’s line: avrdude -p t13 -c usbasp -u -e

avrdude: Device signature = 0x2e8007
avrdude: Expected signature for ATtiny13 is 1E 90 07
Double check chip. or use -F to override this check.

avrdude done.

Is it a chip compatibility issue?

Star 2 must not be bridged when flashing, 3 and 4 are not relevant. Can't explain the wrong signature. Does it always show 2e8007 or does that vary?

Apologies, a typo on my part.

It shows: 0x1e8007. It has also shown 0x1e8003 when trying to flash nlite on the same board.

Thanks

Those device signatures are not what you should get with an ATtiny13a. Should be 0x1e9007.

Try the 'test connection' command in avrdude: avrdude -p t13 -c usbasp -n

Here's what I get with that one:

D:\lights>avrdude -p t13 -c usbasp -n

avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9007

avrdude: safemode: Fuses OK

avrdude done. Thank you.

http://flashlightwiki.com/AVR_Drivers#Test_the_connection

Comfy - thanks for the response.

When running the test connection command I get an identical readout (including device signature of 0x1e9007) with the following exceptions:

Reading took 0.03s

and

avrdude: safemode: Fuses OK (E:FF, H:EF, L:79)

This board was last programmed with minidrv if that is of consequence.

Also, this is an AK-47 board with TINY13A chip. I was under the impression that this would run on the same programming.