e997031.pdf

(46 KB) Pobierz
138908498 UNPDF
EEPROM protection
in AVR controllers
031
H. Bonekamp
AVR controllers have the unfortunate property of their data EEP-
ROM being affected when the supply voltage drops below a cer-
tain level, which can, of course, be prevented by making the reset
low in good time to disable the processor. Unfortunately, this
requires a circuit for monitoring the supply voltage and for taking
the requisite action automatically when needed.
This requirement is met by the circuit in the diagram, which
draws a low enough current to enable it being powered by a bat-
tery. The circuit may be split into a detector, T 1 , and an amplifier,
T 2 –T 3 .
The trip voltage of the detector is determined by the values of
R 1 and R 2 . Normally, the transistor conducts, but as soon as the
supply voltage drops below the trip level, it is cut off. The output of
Elektor Electronics
7-8/99
59
138908498.051.png 138908498.062.png 138908498.073.png 138908498.084.png 138908498.001.png 138908498.002.png 138908498.003.png 138908498.004.png 138908498.005.png 138908498.006.png 138908498.007.png 138908498.008.png 138908498.009.png 138908498.010.png 138908498.011.png 138908498.012.png 138908498.013.png 138908498.014.png 138908498.015.png 138908498.016.png 138908498.017.png 138908498.018.png 138908498.019.png 138908498.020.png 138908498.021.png 138908498.022.png 138908498.023.png 138908498.024.png 138908498.025.png 138908498.026.png 138908498.027.png 138908498.028.png 138908498.029.png 138908498.030.png 138908498.031.png 138908498.032.png 138908498.033.png 138908498.034.png 138908498.035.png 138908498.036.png 138908498.037.png 138908498.038.png 138908498.039.png 138908498.040.png 138908498.041.png 138908498.042.png 138908498.043.png 138908498.044.png 138908498.045.png 138908498.046.png
T 1 is applied to a low-power amplifier.
During normal operation, transistor T 3 is off, so that R 5 func-
tions as pull-up resistor to retain the RST input of the AVR
processor high. When the detector goes off, T 3 is switched on and
the RST input goes low, a process that is enhanced by transistor
T 2 being switched on, whereupon R 3 is shorted out. The resulting
hysteresis requires the supply voltage to exceed the trip voltage
before this situation can change. A manual reset is possible at all
times with witch S 1 .
As stated earlier, the trip voltage is determined by the values
of R 1 and R 2 (and, to some degree, the base-emitter potential of T 1
– about 540 mV), and the tolerance of these resistors should there-
fore be 1%. If the trip voltage needs to be altered, it is best to
retain the value of R 1 at 10 M
5V
R1
R4
R5
ISP
VCC
BC
557B
R3
T2
AVR
AT90S.....
RST
T3
and change the value of R 2
T1
BC
GND
according to
547B
R2
S1
C3
C1
C2
R 2 =0.54R 1 /( U b –0.54),
100n
547B
100n
100n
RESET
where R 2 is in ohms and U b is the supply voltage.
The hysteresis is determined by the value of R 4 : the smaller this
is, the larger the hysteresis. The specified value of 3.3 MΩ
994083 - 11
is fine
for most cases, but some experimentation does no harm.
[994083]
BC
138908498.047.png 138908498.048.png 138908498.049.png 138908498.050.png 138908498.052.png 138908498.053.png 138908498.054.png 138908498.055.png 138908498.056.png 138908498.057.png 138908498.058.png 138908498.059.png 138908498.060.png 138908498.061.png 138908498.063.png 138908498.064.png 138908498.065.png 138908498.066.png 138908498.067.png 138908498.068.png 138908498.069.png 138908498.070.png 138908498.071.png 138908498.072.png 138908498.074.png 138908498.075.png 138908498.076.png 138908498.077.png 138908498.078.png 138908498.079.png 138908498.080.png 138908498.081.png 138908498.082.png 138908498.083.png 138908498.085.png 138908498.086.png 138908498.087.png 138908498.088.png 138908498.089.png 138908498.090.png 138908498.091.png 138908498.092.png
Zgłoś jeśli naruszono regulamin