I am using an Arduino Uno as ISP (Using the standard ArduinoISP sketch) to program an ATTiny13A through the Arduino IDE. (I also have a USBtinyISP 2.0 and a USBASP 2.0, but can't reliably get either to program this chip with any sketch.)
I want to use all six I/O pins on the ATTiny to each control 1 LED. Pins 0 through 4 work fine, but since pin 5 is the RESET pin, it doesn't want to work as an output normally.
I have read from many sources that I can disable the reset pin by changing the fuse bits, and that once I do so I will not be able to program the chip any more. Every source I've seen has given this warning, but has then proceeded to NOT say how to accomplish the 1-time-write.
Assume I've got my sketch exactly 100% as I want it, don't have a high-voltage programmer, and am fine with only being able to program the ATTiny once. How can I program the chip and set the appropriate fuse bits with what I have access to?
1 Answer 1
RSTDISBL is bit 0 of the high fuse byte. Use avrdude to read the current value of the high fuse byte (-U hfuse:r:-:h
), clear bit 0, and then write the value back out (-U hfuse:w:0xXX:m
).
-
Do I program the sketch in Arduino IDE first, then do this? I've never used avrdude directly before, so assume I don't know how to do this.Marsh– Marsh2016年10月02日 03:35:17 +00:00Commented Oct 2, 2016 at 3:35
-
Yes, since once nRESET is disabled you won't be able to program it without HVSP. Enabling verbose compilation in the IDE should give you the other avrdude options you need to use.Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2016年10月02日 03:37:23 +00:00Commented Oct 2, 2016 at 3:37
safemode
in several places. Is that preventing the fuse bits from changing?