Using reset pin as external interrupt on ATTINY?


I have a project using an ATTINY84 where the QFN package is already soldered in place and the pins are effectively inaccessible, barring some heroic soldering. One of the only pins that is accessible is the reset pin, PB3.

I want to use a hall effect sensor to reset and restart the entire device when a magnet is brought near. I had hoped that I could simply connect the output from the sensor to the reset pin to achieve this. However, since the sensor latches low or high, rather than giving a low pulse, I don’t think this would work, as the reset pin would be taken permanently low (or high). Non-latching sensors are available but they all seem to draw comparatively high current, and power consumption is a big issue.

So instead I am looking at using a pin change interrupt, generated by the sensor. Since a PCI detects a change, it doesn’t matter that it latches. The documentation says that pin change interrupts are available on all pins, so am I right in thinking I can configure the reset pin, PB3, as an interrupt pin?

I wonder if you can use a cap in line between the hall sensor output and the reset pin similar to the cap in line with the DTR output to the reset pin for the auto reset for serial upload.

Yes I did think of that, but looking again at the datasheet it may be that I don’t have a problem. It says

“The sensor will turn LOW when the magnetic field is present and
switch to HIGH when the field is removed. The sensor will latch and
hold the state during the sleep “mode”.”

So it looks as though bringing a magnet in any orientation to the device, and then taking it away, will cause a reset. It’s not latching low, only latching high, which is what I want.