Flash Memory Library - mikroElektronika PIC Microcontrollers PIC12 User Manual

Mikroc user's manual
Table of Contents

Advertisement

mikroC - C Compiler for Microchip PIC microcontrollers

Flash Memory Library

This library provides routines for accessing microcontroller Flash memory. Note
that prototypes differ for PIC16 and PIC18 families.
Library Routines
Flash_Read
Flash_Write
Flash_Read
Prototype
unsigned Flash_Read(unsigned address);
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_Write
Prototype
void Flash_Write(unsigned address, unsigned data);
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);
page
186
MikroElektronika: Development tools - Books - Compilers
making it simple...
// for PIC16
// for PIC16
mikroC

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents