Need step-by-step guide for idiots on how to flash Emisar D4 with Anduril

Ok got some ideas about the computer issue. Installing the USBasp driver first might help. Or if that doesn’t work doing a system restore hopefully to a point before Windows decided to ban AVRdude.

But I realized I have another problem: I have the USBasp and the SOIC clip. But my clip came pre-wired, and I understand the wiring needs to be changed for each chip.

I found a map on this site showing the wiring positions for the ATiny13. But have no idea what the wiring positions should be for ATiny25. The map on the D4S page doesn’t help since my goal is to flash a D4 and the D4 doesn’t have the ports on the bottom of the driver for flashing.

I need a map showing exactly which pin on the coupling coming out of the USBasp is supposed to correspond to which point on the SOIC connector. And how the SOIC connector should be oriented when attached to the ATiny85.

I’m a total noob at this stuff and would prefer not to destroy my D4’s ATiny85. :weary:

Did you get the ribbon cable

I ordered a dupont cable with the separate sockets for each wire so I can change up the wire positions. It’s coming from Amazon so should arrive in 2 days.

What I have now is the USBasp 2.0 (from Amazon) and an SOIC clip that came pre-wired with its own ribbon cable and socket that mates with the one on the USBasp. The SOIC clip can plug-in as-is into the USBasp, but without being able to change the wiring, I’m sure the wiring would be wrong. Once my dupont connector arrives I can insert is in the middle and use it to change wiring positions (I hope).

However, in the meantime I have absolutely no idea what positions the wires are supposed to be in. Even if by some miracle the ribbon connector that came with my SOIC clip were wired correctly I wouldn’t even know what orientation is the correct one to attach the clip to the ATiny85.

You will have to set them up like in Hoops photo

the colors don’t matter as long as they are the same on both ends. My colors don’t match Hoops but they work.

I used that photo for the Attiny85 so I think they are all the same.

Do you have a link to Hoops photo?

This is what I used to hook mine up. Post 2.

There are no pictures in Post 2. Do you mean this picture from Post 1? I understand that was for the ATiny13a. So the same wiring works for the ATiny85?

Yes. 13A, 25/45, 85, they’re all the same pinout.

I marked my clip with a dot of paint, that way I know that side goes on the side of the MCU with pin 1-4 and don’t have to figure it out by tracing wires every time I want to use it.

Yeah, sorry beer. Thats the photo I used.

Thanks.

Good Idea on marking them. I have hooked my upside down several times. If its wrong the light on the programmer goes off.

Wire 5 goes on the dot.

Drat.

Installing the USBasp driver doesn’t allow AVRdude run. And unfortunately, I waited too long to system restore and no longer have a restore point from before Windows blocked AVRdude.

Currently, when I type “AVRdude” from the command prompt I immediately get “does not have permission” and a pop up window saying the app will not run on my computer (even though I have the latest version of AVRdude installed). I even get the same result even after uninstalling AVRdude if I go to the command prompt and type “AVRdude”.

I haven’t found any way to bypass this apparent “feature” of Windows and allow AVRdude to actually run.

However, I did download AVRdudess and at least it launched when I tried running the app.

Unfortunately, I have no idea how to use AVRdudess. I can’t just cut and paste from Zeroflow’s guide into a command line since its a graphical windows interface with tons of options to fill in.: “avrdude.exe -p attiny85 -c usbasp -Uflash:w:anduril.YYYY-MM-DD.EMISAR_D4S.hex:a”

Hey guys, I think I can help here. This guide should work for anyone using Windows10.

Step 1: get your appropriate driver from: Index of /torches/fsm , rename it something easy like D4S.hex (or what ever your light is)

Step 2: get WinAVR from: https://sourceforge.net/projects/winavr/ , install it to the root of your C: drive. Take your hex file from the previous step and copy it into the WinAVR folder
that has now been installed on your C: drive.

Step 3: get Zadig from: https://zadig.akeo.ie/ , don’t worry, it’s a safe program, and quite handy.

Step 4: plug your USBasp in

Step 5: run the zadig.exe file, in the window that opens, click the “Options” menu and click “List all devices”. In the dropdown menu, USBasp should appear, if it doesn’t, select it. (if it
isn’t there, check all your connections).

Step 6: what ever the driver listed is, select “libusbK” from the menu to the right of the green arrow, and click the “Replace Driver” button. Congratulations, you have now circumvented
98% of Microsoft’s bullshit.

Step 7: use the connection guide from earlier in the thread or here: AVR Drivers - Flashlight Wiki , make your connections to your solder pads or clip, which ever you are using.

Step 8: open a command prompt (click start menu, type “cmd”, enter) and type “cd \” enter. (do not type the quotation marks). Now type “cd WinAVR” and press Tab, the rest of the
name of the folder will fill in, then press enter. Your command prompt should now show “C:\WinAVR-20100110>”

Step 9: hook everything up and test your connection by typing the following: avrdude -p t85 -c usbasp -n , if your connections are successful, you will get a message that says “device
initialized and ready to accept instructions” along with a progress bar and some other stuff. Ignore the warning about not being able to set sck period.

Step 10: assuming you are successful up to this point, you are almost done! Now enter in your command prompt: avrdude -p t85 -c usbasp -u -Uflash:w:FILENAME.HEX:a ,
and obviously replace “FILENAME.HEX” with the name of your file that you saved. The flash should begin immediately and take no more than 10-12 seconds. You will see
two progress bars, one writing and one verifying. Once it’s finished…

Step 11: bask in the glory of your new firmware. Or fume at your lack of success, in which case post back here and I will try to help you!

Edit: I do not know how to format on forums :frowning:

Excellent guide, very short i clear, i have successfully flashed my D4. Thank you!
Also, there are so many hex file in the link in step 1, do you know where can i get some description for each file?

They are mostly sorted by date I believe. I just scroll to the bottom and get the most recent one for my light. The one with lower muggle ceiling has just that: a lower max for muggle mode making it safer to give to kids and such.

Yes, when sorted alphabetically, they also end up sorted by date. But it’s generally a good idea to click the “Last Modified” column to actually sort by date, just in case there’s something which doesn’t follow the naming convention.

http://toykeeper.net/torches/fsm/?C=M;O=D

This guide was really helpful for flashing my D4S.

Is there something similar for flashing the FW3A? I’d like to put in the latest “fancy (2-level) lockout momentary moon.”

The process is identical, save for using a clip on the chip instead of the PCB pads. And of course, the proper firmware

FW3A also uses an ATiny85… the same MCU in the D4 v1.

The guide in this thread for the D4 should work perfectly for flashing the FW3A. Only difference is getting to the MCU is a bit easier since the driver is held in via retaining ring rather than glue.

i used the instructions at the top of the page to update mine today to Anduril so much nicer being able to do the lockout on 4 clicks instead of 6