Abl-electronic PIC Microcontrollers PIC16 Uživatelský manuál Strana 194

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 312
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 193
1 2 ... 189 190 191 192 193 194 195 196 197 198 199 ... 311 312

Komentáře k této Příručce

Žádné komentáře