atmega323l ATMEL Corporation, atmega323l Datasheet - Page 180
![no-image](/images/manufacturer_photos/0/0/79/atmel_corporation_sml.jpg)
atmega323l
Manufacturer Part Number
atmega323l
Description
Atmega323 8-bit Avr Microcontroller With 32k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
1.ATMEGA323L.pdf
(247 pages)
- Current page: 180 of 247
- Download datasheet (4Mb)
Perform a Page Write
Consideration while Updating
the Boot Loader Section
Wait for SPM Instruction to
Complete
Instruction Word Read after
Page Erase, Page Write, and
Lock Bit Write
Avoid Reading the Application
Section During Self-
programming
Boot Loader Lock Bits
180
ATmega323(L)
To execute page write, set up the address in the Z-pointer, write “00101” to the five LSB
in SPMCR and execute SPM within four clock cycles after writing SPMCR. The data in
R1 and R0 is ignored. The page address must be written to Z14:Z7. During this opera-
tion, Z6:Z0 must be zero to ensure that the page is written correctly. It is recommended
that the interrupts are disabled during the page write operation.
Special care must be taken if the user allows the Boot Loader section to be updated by
leaving Boot Lock bit 11 unprogrammed. An accidental write to the Boot Loader itself
can corrupt the entire Boot Loader, and further software updates might be impossible. If
it is not necessary to change the Boot Loader software itself, it is recommended to pro-
gram the Boot Lock bit 11 to protect the Boot Loader software from any internal software
changes.
Though the CPU is halted during Page Write, Page Erase or Lock bit write, for future
compatibility, the user software must poll for SPM complete by reading the SPMCR
Register and loop until the SPMEN bit is cleared after a programming operation. See
“Assembly code example for a Boot Loader” on page 185 for a code example.
To ensure proper instruction pipelining after programming action (Page Erase, Page
Write, or Lock bit write), the SPM instruction must be followed with the sequence (.dw
$FFFF - NOP) as shown below:
If not, the instruction following SPM might fail. It is not necessary to add this sequence
when the SPM instruction only loads the temporary buffer.
During Self-programming (either Page Erase or Page Write), the user software should
not read the application section. The user software itself must prevent addressing this
section during the Self-programming operations. This implies that interrupts must be dis-
abled or moved to the Boot Loader section. Before addressing the application section
after the programming is completed, for future compatibility, the user software must
write”10001” to the five LSB in SPMCR and execute SPM within four clock cycles. Then
the user software should verify that the ASB bit is cleared. See “Assembly code exam-
ple for a Boot Loader” on page 185 for an example. Though the ASB and ASRE bits
have no special function in this device, it is important for future code compatibility that
they are treated as described above.
ATmega323 has two separate sets of Boot Lock bits which can be set independently.
This gives the user a unique flexibility to select different levels of protection.
The user can select:
•
•
•
•
See Table 61 for further details. The Boot Lock bits can be set in software and in Serial
or Parallel Programming mode, but they can only be cleared by a chip erase command.
To protect the entire Flash from a software update by the MCU.
To only protect the Boot Loader Flash section from a software update by the MCU.
To only protect application Flash section from a software update by the MCU.
Allowing software update in the entire Flash.
spm
.dw $FFFF
nop
1457G–AVR–09/03
Related parts for atmega323l
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![U641B](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
INTERVAL AND WIPE/WASH WIPER CONTROL IC WITH DELAY
Manufacturer:
ATMEL Corporation
Datasheet:
![U4082B](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
Low-Voltage Voice-Switched IC for Hands-Free Operation
Manufacturer:
ATMEL Corporation
Datasheet:
![U4089B](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
MONOLITHIC INTEGRATED FEATUREPHONE CIRCUIT
Manufacturer:
ATMEL Corporation
Datasheet:
![U4255BM-M](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
AM-FM Receiver IC U4255BM-M
Manufacturer:
ATMEL Corporation
Datasheet:
![U4089B-P](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
Monolithic Integrated Feature Phone Circuit
Manufacturer:
ATMEL Corporation
Datasheet:
![TDA4470](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
Multistandard Video-IF and Quasi Parallel Sound Processing
Manufacturer:
ATMEL Corporation
Datasheet:
![ATF22V10B-25PC](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
High-performance EE PLD
Manufacturer:
ATMEL Corporation
Datasheet:
![AT89C51ED2-IM](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
8-bit Flash Microcontroller
Manufacturer:
ATMEL Corporation
Datasheet:
![AT24C01](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
2-Wire Serial EEPROM
Manufacturer:
ATMEL Corporation
Datasheet:
![U6046B](/images/manufacturer_photos/0/0/79/atmel_corporation_tmb.jpg)
Part Number:
Description:
U6046BREAR WINDOW HEATING TIMER / LONG-TERM TIMER
Manufacturer:
ATMEL Corporation
Datasheet: