5 reading the signature row from software, Reading the signature, Atmega4hvd/8hvd – Rainbow Electronics ATmega8HVD User Manual
Page 124

124
8052B–AVR–09/08
ATmega4HVD/8HVD
ondly, 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.
The internal Black-out Detection circuit will issue an internal reset immediately and
take the chip in power-off after 4 CPU cycles if the operating voltage drops below the
detection level V
BLOD
. Alternatively, 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.
23.5.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 23-1
and set the SIGRD and SPMEN bits in SPMCSR. When an LPM instruc-
tion 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 writ-
ing 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 23-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
03H
Reserved
05H
SLOW RC Period L
06H
SLOW RC Period H
07H
SLOW RC Temp Prediction L
08H
SLOW RC Temp Prediction H
09H
SLOW RC FREQ
0BH
ULP RC FREQ
0AH
Reserved
0CH
Reserved
0DH
Batt Prot Adjust Factor
0EH
Reserved
0FH:11H
VPTAT CAL L
12H
VPTAT CAL H
13H