| Datenblatt-Suchmaschine für elektronische Bauteile |
|
PIC24F16KA102T-E Datenblatt(PDF) 54 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC24F16KA102T-E Datenblatt(HTML) 54 Page - Microchip Technology |
|
54 / 278 page ![]() PIC24F16KA102 FAMILY DS39927C-page 54 2008-2011 Microchip Technology Inc. 6.4.1 ERASE DATA EEPROM The data EEPROM can be fully erased, or can be partially erased, at three different sizes: one word, four words or eight words. The bits, NVMOP<1:0> (NVMCON<1:0>), decide the number of words to be erased. To erase partially from the data EEPROM, the following sequence must be followed: 1. Configure NVMCON to erase the required number of words: one, four or eight. 2. Load TBLPAG and WREG with the EEPROM address to be erased. 3. Clear NVMIF status bit and enable NVM interrupt (optional). 4. Write the key sequence to NVMKEY. 5. Set the WR bit to begin erase cycle. 6. Either poll the WR bit or wait for the NVM interrupt (NVMIF set). A typical erase sequence is provided in Example 6-2. This example shows how to do a one-word erase. Sim- ilarly, a four-word erase and an eight-word erase can be done. This example uses ‘C’ library procedures to manage the Table Pointer (builtin_tblpage and builtin_tbloffset ) and the Erase Page Pointer (builtin_tblwtl). The memory unlock sequence (builtin_write_NVM) also sets the WR bit to initiate the operation and returns control when complete. EXAMPLE 6-2: SINGLE-WORD ERASE int __attribute__ ((space(eedata))) eeData = 0x1234; // Variable located in EEPROM unsigned int offset; // Set up NVMCON to erase one word of data EEPROM NVMCON = 0x4058; // Set up a pointer to the EEPROM location to be erased TBLPAG = __builtin_tblpage(&eeData); // Initialize EE Data page pointer offset = __builtin_tbloffset(&eeData); // Initizlize lower word of address __builtin_tblwtl(offset, 0); // Write EEPROM data to write latch asm volatile ("disi #5"); // Disable Interrupts For 5 Instructions __builtin_write_NVM(); // Issue Unlock Sequence & Start Write Cycle |
|
Link URL |
| War ALLDATASHEET hilfreich? [ DONATE ] |
Über Alldatasheet | Werbung | Kontakt | Privatsphäre und Datenschutz | Link zum Datenblatt | Linktausch | Hersteller All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |