Rainbow-electronics ATmega8515L Manuel d'utilisateur Page 169

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 223
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 168
169
ATmega8515(L)
2512A–AVR–04/02
Performing Page Erase by
SPM
To execute Page Erase,set up theaddress in the Z-pointer, write “X0000011” to
SPMCRand execute SPMwithin fourclock cycles afterwriting SPMCR. The datainR1
and R0 is ignored.The page address must be writtentoPCPAGE in the Z-register.
Otherbits in the Z-pointerwill be ignoredduring this operation.
Page ErasetotheRWW section: The NRWW section can be readduring the Page
Erase.
Page Erasetothe NRWW section: The CPU ishaltedduring theoperation.
Filling the Temporary Buffer
(page loading)
To writeaninstruction word, set up theaddress in the Zpointer anddatainR1:R0,write
“00000001 to SPMCRand execute SPMwithin fourclock cycles afterwriting SPMCR.
The content of PCWORD in the Z-register is used to address the datainthetemporary
buffer.Thetemporary bufferwill auto-eraseafter aPageWrite operation orbywriting
theRWWSREbit in SPMCR. Itis alsoerased after a System Reset. Note that it is not
possibletowrite morethan one time to each address without erasing thetemporary
buffer.
Performing a Page Write To execute Page Write,set up theaddress in the Z-pointer, write X0000101” to
SPMCRand execute SPMwithin fourclock cycles afterwriting SPMCR. The datainR1
and R0 is ignored.The page address must be writtentoPCPAGE. Otherbits in the Z-
pointerwill be ignoredduring this operation.
Page Write to theRWW section: The NRWW section can be readduring the Page
Write.
Page Write to the NRWW section: The CPU ishaltedduring theoperation.
Using the SPM Interrupt If the SPM interruptis enabled, the SPM interrupt will generate a constant interrupt
when the SPMEN bit in SPMCRiscleared.This means that theinterrupt can beused
instead ofpolling the SPMCRRegister in software. When using the SPM interrupt, the
InterruptVectors should bemoved to the BLS section to avoid that an interruptis
accessing theRWW section when it isblockedforreading. How to move theinterrupts
isdescribed in “Interrupts”onpage 51.
Consideration While Updating
BLS
Specialcaremust betaken if theuser allows the Boot Loadersection to beupdatedby
leaving Boot Lock bit11 unprogrammed.Anaccidentalwrite to the Boot Loader itself can
corruptthe entire Boot Loader, andfurthersoftwareupdates might beimpossible. If it is
not necessary to change the Boot Loadersoftwareitself, it isrecommended to program
the Boot Lock bit11 to protectthe Boot Loadersoftware from any internalsoftware
changes.
Prevent Reading the RWW
Section During Self-
Programming
During Self-Programming (either Page Eraseor Page Write), theRWW section is
always blockedforreading. Theusersoftwareitself must prevent that thissection is
addressedduring the Self-Programming operation. TheRWWSB in the SPMCR will be
set aslong as theRWW section isbusy. During Self-Programming the InterruptVector
table should bemoved to the BLS asdescribed in “Interrupts”onpage 51, or theinter-
rupts must be disabled. Beforeaddressing theRWW section after the programming is
completed, theusersoftwaremust clear theRWWSB by writing theRWWSRE. See
SimpleAssembly Code Example for a Boot Loader”onpage 171 for an example.
Vue de la page 168
1 2 ... 164 165 166 167 168 169 170 171 172 173 174 ... 222 223

Commentaires sur ces manuels

Pas de commentaire