
281
2593O–AVR–02/12
ATmega644
Note:
1. Z0: should be zero for all SPM commands, byte select for the (E)LPM instruction.
Programming.
24.9
Register Description
24.9.1
SPMCSR – Store Program Memory Control and Status Register
The Store Program Memory Control and Status Register contains the control bits needed to con-
trol the Boot Loader operations.
Bit 7 – SPMIE: SPM Interrupt Enable
When the SPMIE bit is written to one, and the I-bit in the Status Register is set (one), the SPM
ready interrupt will be enabled. The SPM ready Interrupt will be executed as long as the SPMEN
bit in the SPMCSR Register is cleared.
Bit 6 – RWWSB: Read-While-Write Section Busy
When a Self-Programming (Page Erase or Page Write) operation to the RWW section is initi-
ated, the RWWSB will be set (one) by hardware. When the RWWSB bit is set, the RWW section
cannot be accessed. The RWWSB bit will be cleared if the RWWSRE bit is written to one after a
Self-Programming operation is completed. Alternatively the RWWSB bit will automatically be
cleared if a page load operation is initiated.
Bit 5 – SIGRD: Signature Row Read
If this bit is written to one at the same time as SPMEN, the next LPM instruction within three
clock cycles will read a byte from the signature row into the destination register. see
”Readingafter SIGRD and SPMEN are set will have no effect. This operation is reserved for future use
and should not be used.
Table 24-9.
Explanation of different variables used in
Figure 24-3 and the mapping to the Z-pointer
Variable
Correspondig
Z-value
PCMSB
14
Most significant bit in the Program Counter. (The Program Counter is 15 bits
PC[14:0])
PAGEMSB
7
Most significant bit which is used to address the words within one page (128
words in a page requires seven bits PC [6:0]).
ZPCMSB
Z15
Bit in Z-pointer that is mapped to PCMSB. Because Z0 is not used, the
ZPCMSB equals PCMSB + 1.
ZPAGEMSB
Z8
Bit in Z-pointer that is mapped to PCMSB. Because Z0 is not used, the
ZPAGEMSB equals PAGEMSB + 1.
PCPAGE
PC[14:7]
Z15:Z7
Program Counter page address: Page select, for Page Erase and Page Write
PCWORD
PC[6:0]
Z7:Z1
Program Counter word address: Word select, for filling temporary buffer (must
be zero during Page Write operation)
Bit
7
65
4
3
21
0
SPMIE
RWWSB
SIGRD
RWWSRE
BLBSET
PGWRT
PGERS
SPMEN
SPMCSR
Read/Write
R/W
R
R/W
Initial Value
0