Want to learn how to reprogram my own drivers. Got the interface parts today

First of all, I know other members here will program drivers for me. There is lots of support here, but I just need to be able to do it myself, if you know what I mean.

I want to reprogram drivers such as:

The Qlite

The Kaidomain V2 - 8x7135

Some of the Oshpark drivers that we have in the Oshpark thread, like the 7135 based drivers and the FET based drivers

I understand they use different controllers, so I would probably need different software and connectors for them.

I use Windows 8.1 now, So....

I need to know what software I have to get and what cables, connectors, etc. to get. I have found so far, that almost anything that works with XP sp3, will work with 8.1 if it's set up as an XP generation software program.

Then, all I can hope for, to begin with, is to learn to "make changes" on existing programs, because I do not, nor will I probably ever understand "doodly squat", when it comes to this stuff, but it seems like I could change a line or two and save it. Do you follow my drift?

I just figured that out of the different replies I get, I might work out exactly what I need.

I really, seriously want to start selling modified flashlights locally and I need to be able to do custom modes. I could see a light with a forward clicky and two modes - fast strobe and high, for "tactical" and so on and so forth. There's only a short time, (few months), before I become unemployed, so I would like to delve into selling at gun shows and the like. It may never happen, but I want to look at it hard.

Feel free to jump in here and give recommendations.

For the Atiny on the Nangj’s, you’ll need;

SOIC8 clip

USB Programmer

You’ll need to change the pinout for the SOIC clip, more info here.

Comfychair has written a step-by-step for creating a HEX file, with links to the software you need.

WarHawk-AVG has also written a how-to for the flashing process, with links to the driver for the USB programmer.

Once you identify the lines in the code for the modes, it’s really that easy; change the number &/or edit out the modes, save file, convert to HEX file, flash to driver, test, enjoy. :beer:

I would PM either Warhawk-AVG or Dbcstm. Probably both, then when you were up to speed on reflashing, dip your toe in the deep end. I’ll have to wait on my next computer purchase to delve into this realm.

My recommendation would be at first don't even bother learning how to modify the code, if you've never done any coding before it's just so much to take in (such a steep learning curve). Start out just getting a feel for AVRDUDE and flashing premade hex files, there are plenty available. Flashing in itself is a ton to learn and being a CMD line program without a GUI it can be a bit daunting (especially if your not familiar with CMD). From there move up to compiling hex files from existing code (AVRStudio5) and then finally from there step up to actually modifying the code.

The good news is the equipment is cheap, i have <$15 in my programmer and SOIC8 clip together.

The how-to links FmC posted are great, memorize (or create cheat post-it's around your monitor) WarHawk's how-to flash guide. Learning how to compile the code will be no help if you can't already flash it.

I bought this SOIC clip. I think this one by Pamona Electronics is higher quality.

And I got this programmer from Fastech.

I just got them last week, and so far have only flashed Nlite (available as a hex file, ready to flash) software from DrJones. It works like a charm on 105c and AK-47 drivers.

But now the real work begins. I’m looking at the Star source code with the intent of doing my own thing with converting the drivers to “off time” memory.

The KD v2 drivers have the markings sanded of the controller, so I’m mot even sure what we are dealing with.

Edit: Flashing using AVRDUDE and CMD line was no problem for me. But I’m an old DOS 3.3 guy.

The first computer I ever touched was like a 6" screen and used the old huge floppy disks. Command line was all you could do, if you wanted to do anything. I've slept since then, but I bet I will remember after a while.

I want to buy USA, since it will get to me much faster and I basically don't use Fasttech any more for anything.

How about this USBASP

and this SOIC

EDIT: Proper links now - I think

It might be a good idea to PM 1 or 2 people, and let them help you...

Some things only get more complicated when you get different opinions and ideas

That USBASP is identical to the one from Fastech that I use. It should be fine.

I have not used that SOIC clip but it looks like it will work.

On another note, I just modified Star source and built a hex file using AVR Studio. Flashed a driver (105c) and it works like I expected. Now just waiting for the caps to arrive so that I can do off time memory.

If I can do it, anyone can.

Yep those parts are fine, I bought my soic from china cause it was a lot cheaper but I bought that same programmer from that same guy.

Im not 100% it wouldn't work with the jumper in the 5v setting but for me it works fine with the jumper in the 3.3v position, I moved it since the attiny13 lists 5v as max input.


if you are willing to invest a little bit more in “good tools”, I really recommend that, you will go fine with an AVR Dragon and Atmel Studio.
I too have the AVR Dragon and really like it how easy it is to program with it. Also you can program every Atmel µC with In System Programming as well High Voltage Programming.

Also having good hardware saves you really much time. I first owned a cheep USB ASP Programmer and tried to program an ATtiny13A. After some hours unseccessefully trying it came out that the Programmer was not working. Especially if you are new to µC programming it is very helpful to have a perfectly working hardware.

That can be true. I have been talking to a couple members via PM also.

I’m planning to do this in a few weeks… subscribing to make the links easier to find again. :slight_smile:

I’m not sure if it would help, but I took a quick glance through the attiny13a reference manual and found it quite enlightening. But YMMV. I originally learned to read from an old book of BASIC example programs, and I learned about variables and syntax errors before I ever heard of Dick and Jane or an Etch-a-Sketch. I imagine it might take a while to get the hang of if you haven’t written code before.

After I get the hardware, I’ll probably set up a permanently-disassembled torch just for firmware testing, so I can get the code right without having to take apart my lights all the time.

Its always recommended to have a good test bench setup, even when doing simple mods, test, diagnose and fix problems on the bench so when you put it into a light you know everything was working before hand and the issue arose during final install.

I would recommend a GOOD heatsink with an XPG and XML, a battery holder (2-4p) and a forward clicky switch (this doesnt have to be a flashlight switch, something you find at RS and can mount will work better than a flashlight switch. Of course a lab power supply is a great addition but not really needed.

I actually picked up a Pomona SOIC clip off eBay that includes separate pin wires. Rather than mess with splicing wires and whatnot, I simply had to connect the pins on the programmer with the appropriate pins on the clip. The seller I bought from is based in TX.

If you've ever been familiar with DOS, flashing should be no problem for you. I did run into a few bumps getting everything setup, but it wasn't too bad. Off the top of my head, I had to use the open source driver for the programmer (libavr or something like that). Also, I used the updated AVR software that picked up where WinAVR left off. I think it's called MHV-AVR or something. It includes AVRDude. There's some info on the flashlight wiki page. I'll update with more specifics later today, as I'm on a mobile device right now.

I wish I could help, but I long ago forgot how to get set up. I only had to do it once. After you're set up, it's easy street from then on. I used that avr programming flashlight wiki page to guide me through set up. It was a little short on details though.

I don't know if they changed it since. When I read it, it said connecting the power pin was not necessary. It was necessary for mine to work. It also mentioned a program that isn't necessary. Just need drivers for programer and AVR Studio (I think that's it's name. I'm not at that computer). Both are free.

Getting the clip to make contact with MCU's pins is usually a bit finicky.

Do you remember the exact item and seller’s name? This is the first result I found, but I’m not sure if it’s the correct one:

Also, I’m trying to figure out if I could use the same clip to flash chips with more pins, such as attiny84a. I don’t know how many pins are needed for flashing, so maybe they could use the same clip?

I don't know about flashing chips with more pins, but that's the same seller and listing I bought from. FWIW, the clip has 4 pins on each side for a total of 8. Only 6 are used for flashing the ATTiny13a.

DigiKey SOIC is the best (I got both), get the FT USB dongle - exactly, I mean exactly the same as the one I paid $25 for. Now for the cable -- soooo easy. Please, please do it the comfy way.

And get this from FT: https://www.fasttech.com/p/1011800

These 3 things are all you need!! comfy tipped us off with the ribbon cable. Simply peel off 6 wires (in one bunch), and match up the pins. I'll post pics, write it out, whatever -- this is the ultimate simple and reliable setup! I had the SOIC clip and ribbon cable combo from eBay linked above and it WILL break connections after a while, become unreliable. The FT colored ribbon cable simply plugs into the connector on the clip, then plugs on to the connectors in the USB dongle directly -- no need to play with pins on the gray style ribbon cable with a crimped connector.

So what do I use now? I repaired my original SOIC/gray ribbon cable setup and use that as a backup now. Also the cheaper eBay clip will have issues over time - the pins will retract, they are not secured well and can move, so they will back off and result in intermittent connections.

The blue DigiKey seems much more robust!! Combined with the multi-color ribbon cable with plug ends, it's the best!!

Looking at the datasheet the ATTiny84 uses the same number of pins but the pins are farther apart than the 8 (4 /side)) the SOIC8 can cover so an SOIC8 clip wont reach.

For example [on the 84A] the top two pins (1 and 8 ) are VCC and GND so those have to be covered by the top two pins on the clip meaning the clip will only be covering 1,2,3,4,14,13,12,11. All the way down at the bottom row, pins 7 and 8 are MOSI and MISO. I guess you could buy two SOIC8 clips to get the coverage lol.