I have a external circuit that when is ON delivers a LOW signal for 10 seconds and when OFF delivers a HIGH signal (until it goes ON again). I have a attiny85 that runs some stuff and then go to sleep. I was trying to use the signal to reset a attiny85, so everytime the external circuit was ON, it resets the attiny85 to do some stuff. The problem is the reset function on the attiny works only when it goes from LOW to HIGH, so when the attiny resets, 10 seconds have passed and the external circuit is OFF.
I have tried interrupts on attiny but the problem is the same, it reacts only to LOW-HIGH transitions.
So, my questions are:
is it possible to reset a attiny when reset pin is constant LOW?
is there any IC or simple circuit to transform a constant LOW to a pulse LOW?
It's not possible to reset the attiny with a constant LOW, ist will stay in reset until the line is high again.
You can try to make an falling edge trigger and use the signal to pull the reset line low. Never did it, look for falling edge trigger.
But I don't see a problem on using interrupts, just configure it to interrupt on falling edge. As far as I can see in the datasheet it should work. Section 9.2 and 9.2.1
is there any IC or simple circuit to transform a constant LOW to a pulse LOW?
that is what the standard resistor/capacitor circuit on all arduino boards do. chip is reset when reset first goes low but then runs even if reset is still low.
john1993:
that is what the standard resistor/capacitor circuit on all arduino boards do. chip is reset when reset first goes low but then runs even if reset is still low.
I found this simple RC circuit, but it resets attiny both when pushbutton is pressed and released.
Is there a way to just react to press (or release)?
Is there a way to just react to press (or release)?
if a clean signal is supplied to the cap it only resets when going low. reset going high means a dirty signal like from bouncing contacts of a pushbutton. if your signal is clean it will only reset when going low. otherwise a debounce circuit (2 gates) will be needed.
Great, that circuit resets my attiny when LOW is applied to DTR pin.
I was wondering if is it possible to rearrange the circuit to do the opposite, reset when DTR is HIGH? (Output is inverted on my external circuit, this way i could simplfy it...)
The 0.1uF cap/10K pullup resistor create a low pulse, causing a reset that clears as the voltage rises.
Put that same circuit in front of an inverter - the output will sit low until the cap goes, then stays high until the cap charges up, at which time it goes low again. The inverter can be a N-channel MOSFET with drain as output pulled high, source to Gnd. Or NPN, with collector as output pulled high and emitter to Gnd.
When the incoming from the RC is high, both are turned on, so the outputs sit low. When the RC drops, the transistor turns off and the output goes high, then back low again as the RC output goes back high.