DSC POWER 864 - REV2 Spezifikationen Seite 49

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 254
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 48
© 2009 Microchip Technology Inc. Preliminary DS39927B-page 47
PIC24F16KA102 FAMILY
EXAMPLE 5-2: ERASING A PROGRAM MEMORY ROW – ‘C’ LANGUAGE CODE
// C example using MPLAB C30
int __attribute__ ((space(auto_psv))) progAddr = &progAddr; // Variable located in Pgm Memory
unsigned int offset;
//Set up pointer to the first memory location to be written
TBLPAG = __builtin_tblpage(&progAddr); // Initialize PM Page Boundary SFR
offset = &progAddr & 0xFFFF; // Initialize lower word of address
__builtin_tblwtl(offset, 0x0000); // Set base address of erase block
// with dummy latch write
NVMCON = 0x4058; // Initialize NVMCON
asm("DISI #5"); // Block all interrupts for next 5 instructions
__builtin_write_NVM(); // C30 function to perform unlock
// sequence and set WR
Seitenansicht 48
1 2 ... 44 45 46 47 48 49 50 51 52 53 54 ... 253 254

Kommentare zu diesen Handbüchern

Keine Kommentare