Datasheet

144
8024A–AVR–04/08
ATmega8HVA/16HVA
A Flash program corruption can be caused by two situations when the voltage is too low. First, a
regular write sequence to the Flash requires a minimum voltage to operate correctly. Secondly,
the CPU itself can execute instructions incorrectly, if the supply voltage for executing instructions
is too low.
Flash corruption can easily be avoided by following these design recommendations (one is
sufficient):
1. Keep the AVR RESET active (low) during periods of insufficient power supply voltage.
This can be done by enabling the internal Brown-out Detector (BOD) if the operating volt-
age matches the detection level. If not, an external low V
CC
reset protection circuit can be
used. If a reset occurs while a write operation is in progress, the write operation will be
completed provided that the power supply voltage is sufficient.
2. Keep the AVR core in Power-save sleep mode during periods of low V
CC
. This will pre-
vent the CPU from attempting to decode and execute instructions, effectively protecting
the SPMCSR Register and thus the Flash from unintentional writes.
26.2.5 Reading the Signature Row from Software
To read the Signature Row from software, load the Z-pointer with the signature byte address
given in Table 26-1 and set the SIGRD and SPMEN bits in SPMCSR. When an LPM instruction
is executed within three CPU cycles after the SIGRD and SPMEN bits are set in SPMCSR, the
signature byte value will be loaded in the destination register. The SIGRD and SPMEN bits will
auto-clear 6 cycles after writing to SPMCSR, which is locked for further writing during these
cycles. The LPM instruction must be executed within 3 CPU cycles after writing SPMCSR. When
SIGRD and SPMEN are cleared, LPM will work as described in the Instruction set Manual.
Table 26-1. Signature Row Addressing.
Signature Byte Description Z-Pointer Address
Device ID 0, Manufacture ID 00H
Device ID 1, Flash Size 02H
Device ID 2, Device 04H
FOSCCAL
(1)
01H
FOSC SEGMENT
(2)
03H
Reserved 05H
SLOW RC Period L 06H
SLOW RC Period H
(3)
07H
SLOW RC Temp Prediction L 08H
SLOW RC Temp Prediction H
(4)
09H
ULP RC FRQ
(6)
0AH
SLOW RC FRQ
(5)
0BH
Reserved 0CH:0EH
BGCCR Calibration Byte @ 25°C0FH
Reserved 10H
BGCRR Calibration Byte @ 25°C11H