# ATtiny45 pin change interrupt PB5?

On the ATTiny45 data sheets it states that PB5 can be used as a digital IO pin and I want to use it to trigger a pin change interrupt, my only issue is that it is also the reset pin and the moment I connect it to ground to try and trigger an interrupt it resets the ATTiny. Is it possible to use this pin for interrupts and if so how?

• There's a RSTDISBL fuse to take a look at, but a few caveats someone can probably point out. – PeterJ Nov 21 '13 at 12:54
• I don't really want to give up ISP, will I be forced to do so? – Gerharddc Nov 21 '13 at 13:45
• @Gerhman: Yes. But there are very simple circuits for re-enabling nRESET. Or doing HVSP. – Ignacio Vazquez-Abrams Nov 21 '13 at 16:06

Until I checked the ATtiny45 datasheet today I was convinced that you can't program the AVR after programming RSTDSBL in Fuse High Byte. But then I stumbled over this note under Table 6-7 Start-up Times for Internal Calibrated RC Oscillator Clock"

Note: 1. If the RSTDISBL fuse is programmed, this start-up time will be increased to 14CK + 4 ms to ensure programming mode can be entered.

Now it doesn't mention what programming mode is refered to, either High Voltage or SPI. So if your programmer supports it, you may be able to enter the programming mode within 4ms after power up, instead of using the "$\overline{\text{RESET}}$-line protocol" (don't know the proper name for it). You should even be able to verify this without programming the RSTDISBL fuse, and just by programming Start Up Times (SUT[1:0] in Fuse Low Byte) for the internal RC osscillator.

Chapter 20 on page 147 and onwards explains various modes for programming of the devices, but fails to mention the RSTDISBL fuse. Seems you need trial-and-error to be 100% sure ...

I personally use Arduino to ISP program AVR's and I suppose one should be able to hack the ArduinoISP sketch to power up the AVR and start the programming handshake within 4ms after that. But I never tried it myself.

Of course you could reset the fuses for your controller using a high voltage programmer like the AVR Dragon. (Dragon apparently isn't able to power cycle the target device, so Dragon won't support programming without utilizing the $\overline{\text{RESET}}$-line). On the other hand, Dragon does support HV programming, which solves your problem either way.

Or you could improvise an HV-programmer to reset the default fuses.

• Yep, that's the programmer I used. Except I removed all interactivity and shoved it onto a ATtiny2313. Apply power, nRESET is enabled. – Ignacio Vazquez-Abrams Nov 21 '13 at 21:34