Abl-electronic PIC Microcontrollers PIC16 Manuel d'utilisateur Page 194

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 312
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 193
This library provides routines for accessing microcontroller Flash memory. Note
that prototypes differ for PIC16 and PIC18 families.
Flash_Read
Flash_Write
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
186
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Flash Memory Library
Library Routines
Prototype
unsigned Flash_Read(unsigned address);
// for PIC16
char Flash_Read(long unsigned address);
// for PIC18
Returns Returns data byte from Flash memory.
Description Reads data from the specified address in Flash memory.
Example
Flash_Read(0x0D00);
Flash_Read
Prototype
void Flash_Write(unsigned address, unsigned data);
// for PIC16
void Flash_Write(unsigned long address, char *data);
// for PIC18
Description Writes chunk of data to Flash memory. With PIC18, data needs to be exactly 64 bytes in
size. Keep in mind that this function erases target memory before writing Data to it.
This means that if write was unsuccessful, previous data will be lost.
Example
// Write consecutive values in 64 consecutive locations
char toWrite[64];
// initialize array:
for (i = 0; i < 63; i++) toWrite[i] = i;
Flash_Write(0x0D00, toWrite);
Flash_Write
Vue de la page 193
1 2 ... 189 190 191 192 193 194 195 196 197 198 199 ... 311 312

Commentaires sur ces manuels

Pas de commentaire