2

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?

4
  • Please edit question and list programming-related items in your “what I have access to” class. For example, do you have an AVRISP or USBASP or similar ISP programmer? I assume you don't have an AVR Dragon or ‎STK500 or a high-voltage programmer since you say you don't have a high-voltage programmer. Note, I think high-voltage programmers can reprogram chips with any fuse settings. Oct 2, 2016 at 2:13
  • @jwpat7 Done, but I did say I was using an Arduino Uno running the ArduinoISP sketch.
    – Mar
    Oct 2, 2016 at 2:19
  • I'm having trouble getting the fuse bits to write; It reads as 0xFF, then writes 0x7F, then reads as 0xFF when it verifies. The output says safemode in several places. Is that preventing the fuse bits from changing?
    – Mar
    Oct 2, 2016 at 17:19
  • Found my problem. I needed to set the bit on the other end, that is, change it from 0xFF to 0xFE, rather than to 0x7F. Using engbedded.com/fusecalc helped me figure it out.
    – Mar
    Oct 2, 2016 at 23:31

1 Answer 1

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).

2
  • 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.
    – Mar
    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. Oct 2, 2016 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.