| Electronic Components Datasheet Search |
|
PIC24FJ128GL303 Datasheet(PDF) 63 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC24FJ128GL303 Datasheet(HTML) 63 Page - Microchip Technology |
|
63 / 424 page ![]() 2019-2020 Microchip Technology Inc. DS30010198B-page 63 PIC24FJ128GL306 FAMILY TABLE 6-1: EXAMPLE PAGE ERASE EXAMPLE 6-1: ERASING A PROGRAM MEMORY BLOCK (‘C’ LANGUAGE CODE) Step 1: Set the NVMCON register to erase a page. MOV #0x4003, W0 MOV W0, NVMCON Step 2: Load the address of the page to be erased into the NVMADRU/NVMADR register pair. MOV #PAGE_ADDR_LO, W0 MOV W0, NVMADR MOV #PAGE_ADDR_HI, W0 MOV W0, NVMADRU Step 3: Set the WR bit. MOV #0x55, W0 MOV W0, NVMKEY MOV #0xAA, W0 MOV W0, NVMKEY BSET NVMCON, #WR NOP NOP NOP // C example using MPLAB XC16 unsigned long progAddr = 0xXXXXXX; // Address of row to write unsigned int offset; //Set up pointer to the first memory location to be written NVMADRU = progAddr>>16; // Initialize PM Page Boundary SFR NVMADR = progAddr & 0xFFFF; // Initialize lower word of address NVMCON = 0x4003; // Initialize NVMCON asm("DISI #5"); // Block all interrupts with priority <7 // for next 5 instructions __builtin_write_NVM(); // check function to perform unlock // sequence and set WR |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List 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 |