How To Build a Flashlight With Perfect Modes (picture heavy)

I bought the one Tom mentioned a month ago and it’s been working fine for me.

Thank you Tom and SigShooter, that is exactly what I will do today, absolutely…
I might have saved myself a few hours by just asking here outright but didn’t want to bother anyone.
Thank you again and have a wonderful day… oh, also, Tom thank you for the lead and link to Hoops thread, very helpful as always, along with SigShooter’s endorsement, fantastic, that’s solved…!
One thing I knew was Hobby King is a China company but has Stateside warehouses and that one I pointed out was in Oregon warehouse, so it would have gotten here quicker, but quicker is not always better…
Thanks all,

- yea, think someone bought something similar a while back, wound up being wired differently - think it was actually an old design compared to the V2.0 - think they ended up buying the 2.0 anyway.

That would most certainly have been my luck and would have been such a disappointment and right out of the gate,
So I am glad I used my head for more than a hat rack and decided to ask first.
I still have an old list you had given me in a post a long time back, but it was only the names of required equipment and that was it, but I’ve been sitting on that info Tom and finally decided to move ahead after watching the work you’ve been doing and wanting some of the UI’s available but no means to flash them to my lights, So thank you very much Tom

If you have a PC with parallel port you can build a programmer in less than 15 minutes. Just connect a few wires and 4 resistors as shown here and then you can use Ponyprog which has much friendlier user interface than avrdude + some GUI, especially when working with fuses. I've been using such a 'programmer' for years without a single issue.

That is really great… Thank You Chupo…!!
I should be able to use a Parallel DB25 M/2F Y-Splitter so I can keep using my printer, I think this is a DB25 parallel, well it’s stock with system so generic, thinking out loud sorry, and with your recommendations that should work perfectly and doesn’t appear complicated at all, thanks again greatly appreciated. Wow, that is some really great information you linked, thanks once again…

I am glad you find it useful. After the first launch of Ponyprog under Setup > Interface Setup select Parallel, AVR ISP I/O and probably LPT1 and everything else unchecked. Then run Setup > Calibration and that's it. Be careful with the fuse bits not to lock the µC by disabling the internal oscillator (checked = programmed = zero). If you by accident disable the internal oscillator then you will have to connect the external crystal or use high voltage programmer to reprogram the fuses to reenable the internal oscillator so you could use ISP programming again.

I have cut and pasted this to my note book, and I’d bet this would have been something I surely would have messed up since I believe I am accident prone :stuck_out_tongue: ,
So thank you again, you’ve been so helpful…!

That sounds cool

Can you use an old Jetdirect with parallel ports?

Unfortunately I don't think that might work because PonyProg uses direct I/O access and it doesn't work well even with PCI parallel adapter card. In that case it is not possible to select AVR ISP I/O option and AVR ISP API option has to be used resulting in very slow programming speed (minutes instead of seconds). On the other hand, a 'real' parallel port works really well. I have both USBasp programmer and JTAG ICE debugger and I can use USBasp with both the PC and Raspberry Pi and I can program AVRs even directly (without programmer) using Raspberry Pi's I/O lines but I mostly use parallel port + PonyProg. I use USB programmers only when parallel port is occupied by CNC machine.

Thanks for the explanation. :slight_smile:

Ran into a new problem running a reflash of STAR, although I suspect my problem has nothing to do with STAR.

Have not updated any drivers or or changed the pinouts on the USBASP. They’re all soldered and in great shape. No shorting between pins either.

Any ideas?

avrdude -p t13 -c usbasp -u -Uflash:w:TaskLightAlkaline28.65.130.250.hex:a -Ulfuse:w:0x75:m Ha-Uhfuse:w:0xFF:m

Solved the above issue with a reboot but have run into a new problem.

At the end of programming I’m now getting the following message:
avrdude: verifying …
avrdude: verification error, first mismatch at byte 0x0000
0x00 != 0x09
avrdude: verification error; content mismatch
avrdude done. Thank you.

After this, the driver does not output any power.

Really stumped here. Trying to program the same piece of code I successfully programmed a few times in January.

The verification is critical to get to pass. I've gotten this error many times, always could get it resolved with re-clipping, cleaning the clip and I/O pins w/isop. alcohol, retrying, etc.

Critical indeed. Thanks for your input.

Tough to believe but another reboot and the problem went away. Nothing like have to reboot a PC twice just to program the thing!

isn’t this method easier than using a usbasp?

Usually the chips are reflashed without unsoldering them from the driver PCB. For example, on a BLF Q8, remove the two driver screws, tilt the driver out, and the MCU should be exposed. It’s easy to clip onto and reflash without soldering anything.

Great, so if I use a SOP8 Clip + and Ardiono uno in isp mode then I can Upload Firmwares normally ?
This method seems simpler, Correct me if I’m wrong :slight_smile:

The USBasp is simply the same, just with a clip you snap on the chip, if you bend the MCU legs for less wide pads the clip holds without any pressure

it makes not much difference if the chip is soldered or not to flash a MCU with the clip,
while for SOP8 you need a special adapter to flash it like in the video
also flashing Narsil with LVP and Temperature calibrated you need 2-4 flashes in total

Hi Lexel and all,
I am using flashlight for Lightpainting and are active in our local youth club.
Last weekend I have given a Lightpainting workshop for 10-15 year old kids and the kids were happy.
But I realized that the multi mode switches of the cheap flashlights has made it much more difficult to paint nice pictures.
Now I am wondering if I can replace the chip of all three flashlights with another programmable chip or a simple single mode chip.
I am experience in Arduino programming and electronics, because I am a retired electronic engineer.

Any answer will be appreciated. German is my native language and emails/PM are welcome.

best regards
Peter