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

ToyKeeper does use Linux, or some derivative, for all her firmware development. I don't know any details though, but she has done a lot of the drivers and driver baselines we all use.

Thx for the 411 Tom. I won’t bug her with a PM yet. I’m sure she’s busy but when I get knee deep into this stuff -> no guarantees. :disappointed: She’ll probably ended up blocking my PM’s cause I end up pestering her so much…

I use linux for all the work I do with bistro, I could never get atmel studio to play nice with it. Toykeeper has a lot of scripts to take care of the compiling and flashing assuming you have the correct binary’s installed.

I like Atom for the actual coding itself.

While I like linux, I am also a gamer at heart and use some programs on a daily basis that only run on windows so windows is still my main system. in fact I generally just use linux in a virtual machine, actually booting up the linux machine and using it is usually more work then whatever change I wanted to make to the code lol.

Portable virtual box FTW.

Heck portable everything, I only install firefox, adobe, DXO, office, drivers and a few specialty programs now days, everything else is setup as a portable app. Makes windows SOOO much more stable. Oh, and screw windows 10.

I solely use linux for my dev. I run a headless box (server), but it would work even better with a desktop distro like Mint.

I loosely followed these instructions to get up and going. It’s been long enough ago that I don’t remember all of the details; I think there’s a lot of that stuff that I didn’t do. Main thing is to get gcc and the appropriate libraries set up for avr and have avrdude installed.

I use a Raspberry Pi 3 or an Orange Pi PC to flash light drivers, works like a charm! The only issue is avrdude requires sudo on Raspbian, not sure why?

The usb programmers are just plug&play, no drivers required - at least on both Debian based Pis.

To get around that sudo requirement, just check out this post from TK. Worked like a charm for me.

Interesting, I just use the script with an sudo built in but might have to make that change on the virtual box machine.

On the driver stuff -> I’ve got a ton a reading to do b4 I get into this…

As I a retired a few years ago I found myself able to get away with just using a linux box. However I never programmed for a living so basically have nothing to test out on other platforms. If I was still working then I could never fully leave the windows or apple platforms alone as both they are both in the cores of the industries I was involve in.

However, nowadays I do run the risk of letting myself become obsolete in my 411. Initially I always said that I could just pick up whatever’s current whenever. But hmm, maybe it’s time to be more proactive in making that true. Believe it or not I’ve never even used something on a Win 10 OS yet! I’m only in my 30s so that means if I let thing slip away then I’ll be totally in the dark by time I’m 50+…

Thx all for the helpful 411. This driver programming is just too cool. Now I’ve got some reading to do…

Anyone editting “C” files for flashing (at least in Windows) should have Notepad2 in the arsenal. I’ve been using Notepad2 for years at work (and I don’t do anything related to software programming) and love it! I’ve replaced Windows standard notepad with it. There are many cool things about it, but for flashlight firmware purposes it incorporates “syntax highlighting” which is what you see in Atmel studio when you “comment out” a line and the text turns green, etc. . .

-Garry

Thanks for that… it’s quite old but no problems with windows 10 hey?

Do you mean Notepad++? I still use that, but not as my primary development editor. I use SlickEdit, just installed the 2016 version - pricey but a write off for me, plus I use it every day at work. Atmel Studio 7 though is based on Visual Studio 2015, so it's quite powerful as well.

I have used notepad in the past, I like that it comes in pre-made portable packages.

Although for real code editing I find Atom to be nicer and have more features. I don’t even use a fraction of the features but some that are nice are editing multiple lines at once and the code overview for easily finding the code you want.

No love for pico? ;) ok... I only use that for small edits

All of my code resides on a headless linux server. I've been using CodeAnywhere with SFTP lately. Works pretty good, it's anywhere I've got a web browser.

Thanks for the guide, helped me a lot during my first flashing!

I used my arduino nano board to flash the tiny13 instead of the USBasp.

I used the wiring diagram from >Here< without led and resistor. Also used 8pin clip instead of breadboard.

The right command to flash using arduino as programmer instead of USBasp goes like this:

avrdude -p t13 -P com21 -c avrisp -b 19200 -v -e -U flash:w:luxdrv.hex:a -U lfuse:w:0x75:m -U hfuse:w:0xff:m

Check the port you have your arduino connected to when uploading the ArduinoISP sketch. You will need to insert it to the code above.

No issue under Win 10 32bit or 64.

Nope, never used that.

I don’t know about others, but Notepad+ is so simple even for non-programmers. It’s just a more powerful text editor. If I install it and make it default for text files nobody has an issue because if they can use notepad they can use Notepad+.

BTW - I love the ability to select columns up vertical text by holding ALT while selecting. This is the most used reason for use at my job!

-Garry

I’m attempting to flash hex files for the first time and would appreciate some help. The driver is a 15DD FET-only driver (tiny13A MCU) that I bought flashed with moppydrv FW from mtnelectronics. I want to put toykeeper’s ramping_UI_table FW on it.

Following the instructions in the OP, I seemingly successfully flashed the FW. I used the fuses in the example in the OP. The usbasp shell said everything transferred and verified successfully, but it doesn’t turn on when I connect it to an LED and power supply.

In the README, ToyKeeper mentions that the FW was made for drivers with additional red and green lights, and to comment out this section for use with other drivers. Could this be the problem?

I also flashed the Baton hex file and it similarly loaded apparently successfully, but did not work, either.

Thanks for any help.

Edit: I commented out the section regarding the red and green lights rebuilt it and it works! Thanks for the guide.

Congratulations!

Very nice when a flash comes together for the first time!

Full day I tried several times to create my usb to work… But still no luck.
I read the OP several times… Looking at the pictures, reading the PDF, and other documents, still stuck.
DO I need to removed the atiny chip from the pcb to get working? Since I try to connect while it sit in there.
I have usbasp from fasttech and soic clip from ebay seller. The wiring seems different, so I take them apart and start from zero.
No matter what I did, it didn’t connect… I follow the pic, but seems it’s not right. Following the PIN diagram still can’t connect.
Getting tired now, need some rest… Trying to figure out what I’ve done wrong… —.—

Yes, and flashlight firmware development is generally simpler in Linux. There are some instructions for Debian/Ubuntu/Mint in the README file at the root of the firmware repository. Click the Link in my signature for more info.