SW500008 Microchip Technology, SW500008 Datasheet - Page 215

PICC-18 STD

SW500008

Manufacturer Part Number
SW500008
Description
PICC-18 STD
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC18r
Datasheets

Specifications of SW500008

Supported Families
PIC18
Core Architecture
PIC
Software Edition
Standard
Kit Contents
Software And Docs
Mcu Supported Families
PIC18
Tool Function
Compiler
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
PIC18 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
015
778-1001
778-1001
Library Functions
Return Value
flash_read() returns the data found at the given address, as an unsigned char.
Note
The flash_write() function can be used to update anywhere from 1 to 65535 bytes of data at a time,
however it is more efficient to write in data lengths that are multiples of that device’s erase block
size.
Ensure that the function does not attempt to overwrite the section of program memory from which
it is currently executing and extreme caution must be exercised if modifying code at the device’s
reset or interrupt vectors. A reset or interrupt must not be triggered while this sector is in erasure.
For PIC18FxxJxx parts, care must also be taken to ensure that a reset does not occur during a write
targetting the last 1024 bytes of program space as this region also contains the device’s configuration
values.
}
// Read a byte of data from flash address 1000h
data = flash_read(0x1000);
// Copy data from source to destination in flash.
// source does not have be in flash.
// Any required flash erasures done internally.
flash_write(source, length, dest);
// Erase block containing the address 4000h
flash_erase(0x4000);
201

Related parts for SW500008