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

Thanks before. If the “lighter green”, just like shown by ToyKeeper, this picture?

So I need to cut like the yellow line?

Cut here

Edit: just follow this curve. Cutting where you have the yellow line won’t quite do the trick.

I get it know. But it doesn’t have to ‘rounded’ cut, right?
I can make 90 degree cut for the same purpose?
I’d like to try, but seems it’s more easy for me to make that way.

Thanks a lot, gchart!

Edit:
Okay, I try to make similar like this, just same as your sketch.

Yup, that works! Try keeping it close to the MCU pin. You don’t want to separate the resistor from the 7135. And if it doesn’t work after your first cut, go over it another time or two just to make sure it’s cut all the way through.

And no problem. Good luck and happy flashing!

For me a straight cut has worked best.

Thanks for the real example, Lopan. :sunglasses:

I try to flash driver but got error and not working driver as result. :cry:

Also tryed to flash original fw I saved from driver but same error.

Error

What I flash

What I read

Any advice?

Sorry, I don’t have any experience with that software. I use Linux for my building and flashing.

I apologize if you’ve done these already, but here’s a few questions to try and isolate the issue:

  • Have you successfully flashed firmware using this same clip before?
  • Have you successfully flashed firmware using this software before?
  • Do you have another driver you can try?
  • Have you tried going over the cut on the trace again just to make sure it’s fully cut? If you have a multimeter, set it to continuity check and make sure pin5 isn’t connected to ground.

It looks like probably a pin mismatch between the clip and the flashing device. That can allow flashing to appear like it’s working until the verification step.

  • Yes
  • Yes
  • Not at the moment. Ordered.
  • Yes. Tested and it’s not connected

Weird thing is I can write fuse settings and EEPROM and even erase chip, but when I write Flash i get mismatch.

Forget it. Tryed now with MVH AVR which newer worked for me before and it flashed it. :+1:

Maybe my PC has some problems I don’t know about. :person_facepalming:

Thank you for you help anyway.

:+1:

I really like this thread, but I feel the numbering of the pins would be much easier if all the diagrams were consistent. There is no need to have different numbers in different diagrams for the same pins. I found this pretty confusing when trying to wire up the clip, and it took me a minute to realize the numbering was not consistent.

Also PLEASE add a note that if you use the wrong fuse #'s you will brick your board (Like I just did trying to flash my atiny25 version of the MTN board). The fuse values for atiny25 were not in the .c file but in the bin/flash-25.sh file http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/trunk/view/head:/bin/flash-25.sh The values in the .c file appeared to be the same, I figured I would give it a go and just re-wipe the chip if something went wrong, I didn't know this was irreversible and would brick the board if you used the wrong values and thus I have bricked my driver. Boy do I feel stupid now!

If you use tiny13 fuse values on tiny25, it’ll configure things like this:

http://www.engbedded.com/cgi-bin/fcx.cgi?P_PREV=ATtiny25&P=ATtiny25&M_LOW_0x3F=0x00&M_LOW_0x80=0x00&M_HIGH_0x07=0x07&B_CKDIV8=P&B_CKSEL3=P&B_CKSEL1=P&V_LOW=75&V_HIGH=FF&V_EXTENDED=FF&O_HEX=Apply+values

It looks like that tells it to use external clock divided by 8… and with no external clock it might just … stop? Would probably not be recoverable without a high-voltage serial programmer like RMM has, since the usual flashing procedure requires the MCU to be running at a few MHz.

It’s worth noting that one should remove the MCU from the driver before using a HVSP. The extra voltage can fry other driver components.

I did see some /8 in the source code but had no idea what it was for. Just thought I would be able to wipe the MCU if something went wrong, so I moved forward with it. Ooops time for a new driver, or new MCU and hot air reflow station. I'm a bit worried about trying to flash something again, boy do I feel stupid now.

ToyKeeper Can you translate what your seeing in the link above that would indicate a red flag? Nice link BTW, seems useful if I could understand it :)

Mostly, that it’s set to use an external clock… but there is no external clock. So it won’t tick. If it doesn’t tick, it won’t respond. The MCU must be active and running at a suitable clock speed during reflashing. I discovered this when I under-clocked one to 128 kHz for a test and then couldn’t change it back. RMM has equipment to recover from these things, but I don’t.

Link to HVSP fuse resetter:

http://homepage.hispeed.ch/peterfleury/avr-hvsp-fuse-restore.html

That’s all I can tell you, though, because I’ve never built one myself.

Take note of Toykeeper’s warning in an earlier post: remove the MCU from the driver first, or the high voltages are liable to damage other components on the driver.

Hi,

Can you please help me?
I would like to modify the Biscotti fw, basically i would like to remove 7 mode, just keep 5 which would be enough for me.
I download the atmel studio (6.0) and also the tk-*.h files, but if i try to build the hex i got many errors (tried the untouchted biscotti.c but the same).
Do you have any ideas what can be the problem?
These are the errors when i try to build the untouched .c:
Error 1 ‘BOGOMIPS’ undeclared (first use in this function) D:\Lampa fw\GccApplication1\GccApplication1\tk-delay.h 37 34 GccApplication1
Warning 2 each undeclared identifier is reported only once for each function it appears in D:\Lampa fw\GccApplication1\GccApplication1\tk-delay.h 37 34 GccApplication1
Error 3 ‘V_REF’ undeclared (first use in this function) D:\Lampa fw\GccApplication1\GccApplication1\tk-voltage.h 45 20 GccApplication1
Error 4 ‘EEPSIZE’ undeclared (first use in this function) D:\Lampa fw\GccApplication1\GccApplication1\GccApplication1.c 223 26 GccApplication1
Error 5 ‘EEPSIZE’ undeclared (first use in this function) D:\Lampa fw\GccApplication1\GccApplication1\GccApplication1.c 249 34 GccApplication1
Error 6 ‘EEPSIZE’ undeclared (first use in this function) D:\Lampa fw\GccApplication1\GccApplication1\GccApplication1.c 289 24 GccApplication1

If i try to build my modified version, get all of these errors:
Warning 1 data definition has no type or storage class [enabled by default] D:\Lampa fw\janabiscottimod1\janabiscottimod1\tk-attiny.h 41 5 janabiscottimod1
Warning 2 type defaults to ‘int’ in declaration of ‘Hey’ [enabled by default] D:\Lampa fw\janabiscottimod1\janabiscottimod1\tk-attiny.h 41 5 janabiscottimod1
Error 3 expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘need’ D:\Lampa fw\janabiscottimod1\janabiscottimod1\tk-attiny.h 41 14 janabiscottimod1
Error 4 unknown type name ‘int8_t’ c:\program files (x86)\atmel\atmel studio 6.0\extensions\atmel\avrgcc\3.4.1.95\avrtoolchain\bin\./lib/gcc/avr/4.6.2/…/…/…/…/avr/include/stdint.h 159 1 janabiscottimod1
Error 5 unknown type name ‘int8_t’ c:\program files (x86)\atmel\atmel studio 6.0\extensions\atmel\avrgcc\3.4.1.95\avrtoolchain\bin\./lib/gcc/avr/4.6.2/…/…/…/…/avr/include/stdint.h 213 1 janabiscottimod1
Error 6 ‘BOGOMIPS’ undeclared (first use in this function) D:\Lampa fw\janabiscottimod1\janabiscottimod1\tk-delay.h 37 34 janabiscottimod1
Warning 7 each undeclared identifier is reported only once for each function it appears in D:\Lampa fw\janabiscottimod1\janabiscottimod1\tk-delay.h 37 34 janabiscottimod1
Error 8 ‘V_REF’ undeclared (first use in this function) D:\Lampa fw\janabiscottimod1\janabiscottimod1\tk-voltage.h 45 20 janabiscottimod1
Error 9 ‘EEPSIZE’ undeclared (first use in this function) D:\Lampa fw\janabiscottimod1\janabiscottimod1\janabiscottimod1.c 216 26 janabiscottimod1
Warning 10 cast to pointer from integer of different size [-Wint-to-pointer-cast] D:\Lampa fw\janabiscottimod1\janabiscottimod1\janabiscottimod1.c 224 23 janabiscottimod1
Warning 11 cast to pointer from integer of different size [-Wint-to-pointer-cast] D:\Lampa fw\janabiscottimod1\janabiscottimod1\janabiscottimod1.c 225 23 janabiscottimod1
Error 12 ‘EEPSIZE’ undeclared (first use in this function) D:\Lampa fw\janabiscottimod1\janabiscottimod1\janabiscottimod1.c 242 34 janabiscottimod1
Error 13 ‘EEPSIZE’ undeclared (first use in this function) D:\Lampa fw\janabiscottimod1\janabiscottimod1\janabiscottimod1.c 282 24 janabiscottimod1
Warning 14 cast to pointer from integer of different size [-Wint-to-pointer-cast] D:\Lampa fw\janabiscottimod1\janabiscottimod1\janabiscottimod1.c 283 32 janabiscottimod1

I’m not so expert in this, but i have a very basic knowledge.
I would like to burn into an s2+ lamp.

Thank you,

To start with, try uncommenting the “#define ATTINY 13” line or give it a compiler parameter of “-DATTINY=13”. That should resolve several errors.

Thanks, thats helped.
Unfortunately if i try to compile (the original biscotti.c) i still get errors:
Error 1 Program Memory Usage : 1174 bytes 114,6 % Full (Memory Overflow)
Data Memory Usage : 16 bytes 25,0 % Full GccApplication4 0 0 GccApplication4

Tried in Atmel studio 6.0 and 7.0 but still the same.

If i try to compile my version i get the same message just with lower numbers.