Pages: [1]   Go Down
Author Topic: ArduinoISP Fuses Only.  (Read 1151 times)
0 Members and 1 Guest are viewing this topic.
Leeds, UK
Offline Offline
Edison Member
*
Karma: 78
Posts: 1719
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset



I need to program an ATTiny via ISP with a bootloader, and then rewrite the fuse settings to disable the reset pin functionality.
The problem is that it appears to erase the flash, then write the fuse settings, then write the bootloader code. This means that if I set the fuse such that it disables the reset pin, then it cannot write the bootloader as suddenly ISP becomes not possible.
 I thought then if I burn the bootloader with the fuses set to have the reset pin enabled (that gets the bootloader code successfully onto the chip), then run the burn bootloader process again only this time with a fuse setting which disables the reset pin, then all would be well. The bootloader would remain from the first pass and the fuse settings from the second. However it would appear that the bootloader written by the first pass is erased in the second meaning I am left with a tiny with no bootloader and no reset pin (= need a high voltage programmer to recover it).

Does anyone know if it is possible to get the ArduinoISP sketch to only change the Fuse settings without modifying the flash?
Or failing that is there a way to change the order of things and make it fuse-erase-write instead of erase-fuse-write.
Logged

~Tom~

Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

avrdude in conjunction with Arduino Uno flashed with ArduinoISP should be able to change the fuses after a bootloader or some other hex file has been uploaded to the target Attiny.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If that doesn't work, I have a sketch here which I use to upload files to the target board:

http://www.gammon.com.au/forum/?id=11638

I modified it to run without an attached SD card. One of its functions is to change any of the fuses (see above link).

So you could upload the file, and then change the fuse later.
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 78
Posts: 1719
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

avrdude in conjunction with Arduino Uno flashed with ArduinoISP should be able to change the fuses after a bootloader or some other hex file has been uploaded to the target Attiny.

Yup, thanks for that smiley I totally forgot about using avrdude as a standalone.

This worked:
avrdude -CE:\~Path~Removed~For~Security~\arduino-1.0\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny84
-cstk500v1 -P\\.\COM4 -b19200 -U hfuse:w:0x57:m


Rather pleasingly the blink sketch I uploaded to check with continued blinking away after avrdude finished smiley

Edit:
Just checked and the bootloader is still functioning properly. I have to remember to do a power cycle just before the program starts to download to get back into the bootloader, but that was to be expected. Bye bye autoreset smiley
« Last Edit: November 09, 2012, 06:52:40 pm by Tom Carpenter » Logged

~Tom~

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just a question (I do not want to open a  different topic):

Does "Arduino Uno flashed with ArduinoISP" support all the AVR processors in avrdude's list or for some reasons certain controllers are not accepted?
« Last Edit: November 09, 2012, 07:28:15 pm by twice » Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6637
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think that ArduinoISP will work with processors that have more than 128k of flash.
It also only supports AVRs that have "ISP" programming.
Logged

Pages: [1]   Go Up
Jump to: