EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: wintech on July 18, 2019, 10:35:15 am

Title: How to upload .hex files into a ATtiny45?
Post by: wintech on July 18, 2019, 10:35:15 am
Recently I have found a cool project that uses an ATtiny45 and the problem is that it uses a .hex file.Can someone help me?
https://www.youtube.com/watch?time_continue=1&v=T9_tprW_3cc (https://www.youtube.com/watch?time_continue=1&v=T9_tprW_3cc)
Title: Re: How to upload .hex files into a ATtiny45?
Post by: andersm on July 18, 2019, 12:02:01 pm
Most programming tools (eg. AVRDUDE) can handle ihex or srec just fine. What tools are you using, what have you tried, what did not work?
Title: Re: How to upload .hex files into a ATtiny45?
Post by: wintech on July 18, 2019, 12:11:10 pm
Well I had tried Xloader ,but the program freezed.
Title: Re: How to upload .hex files into a ATtiny45?
Post by: oPossum on July 18, 2019, 04:26:18 pm

Only the PICkit 4 will be able to program the '45 a second time because that audio player code disables the reset line and that prevents using SPI programming.
Title: Re: How to upload .hex files into a ATtiny45?
Post by: Mechatrommer on July 18, 2019, 05:30:00 pm
because that audio player code disables the reset line and that prevents using SPI programming.
that sucks as the project can be educative. maybe someone can port the project to arduino board. code will be edited and compiled in avr studio, and hex uploaded with avrdude, no programmer HW is needed.
Title: Re: How to upload .hex files into a ATtiny45?
Post by: andersm on July 18, 2019, 08:13:35 pm
I've never heard of Xloader, but it seems to be for uploading Arduino sketches, so presumably it needs the Arduino bootloader to be present in the device to work.
Title: Re: How to upload .hex files into a ATtiny45?
Post by: james_s on July 18, 2019, 10:47:50 pm
AVR programmers are dirt cheap and .hex is the standard file format that has been used for decades. Not sure what the issue is.
Title: Re: How to upload .hex files into a ATtiny45?
Post by: amyk on July 19, 2019, 01:20:48 am
because that audio player code disables the reset line and that prevents using SPI programming.
that sucks as the project can be educative. maybe someone can port the project to arduino board. code will be edited and compiled in avr studio, and hex uploaded with avrdude, no programmer HW is needed.
It can also be "educative" in the sense that it teaches you to use a real programmer. ;) Either that, or build your own HVSP eraser --- some switches, LEDs, and a 12V supply are sufficient if all you need to do is a full chip erase and a reset of the fuses.
Title: Re: How to upload .hex files into a ATtiny45?
Post by: Mechatrommer on July 19, 2019, 01:39:30 am
so in order to reprogram it we have to 1) HVP erase it with a tool, and then 2) normal programming with another tool. or... buy or spend another time to diy another programmer capable of HV programming and throw our existing LVP/ICSP in a bin.. or as i suggested, port this to arduino board that every artists loved, hence no programmer needed, when we got feed up with the project we can recycle the arduino board for another project ::)
Title: Re: How to upload .hex files into a ATtiny45?
Post by: james_s on July 19, 2019, 01:53:36 am
But you can get an AVR programmer for like $5, or use an arduino as a programmer, what's the problem? Arduino is a great starting point but it's a crutch, sooner or later the goal should be to graduate on to a real development platform.
Title: Re: How to upload .hex files into a ATtiny45?
Post by: Mechatrommer on July 19, 2019, 02:10:51 am
but programmer with HVP capability is not $5, and we already have a descent enclosed avr knock off programmer. the point for arduino is development stage where we can keep upgrading the FW and reusing it. once firmed it can be transported to real circuit. but the fact that atTiny45 is running out of pin, imho its wise to switch to another avr mcu, someone is going to do it anyway, say for eg, if we want lcd and up down switches to select song/file. and looking at the circuit, it less ideal since the speaker is directly driven from the attiny pin, only good for small speaker. so if we want bigger speaker, changes to original circuit is inevitable. ymmv.
Title: Re: How to upload .hex files into a ATtiny45?
Post by: gardner on July 19, 2019, 03:33:07 am
I used my trusty TL866.  I gather it does HVSP, at least when the chip is in the socket.  I have never had trouble with miss-set fuses, at any rate.
Title: Re: How to upload .hex files into a ATtiny45?
Post by: ledtester on July 19, 2019, 01:10:20 pm
Maybe this is the project:

http://elm-chan.org/works/sd8p/report.html (http://elm-chan.org/works/sd8p/report.html)

There's a link for the source code at the bottom.