User`s manual

EEPROM data memory is available with a number of PIC MCU models. Set of
library procedures and functions is listed below to provide you comfortable work
with EEPROM.
Basically, there are two operations that can be performed on EEPROM data mem-
ory.
function EEprom_Read(dim Address as byte) as byte
procedure EEprom_Write(dim Address as byte, dim Data as byte)
Library function EEprom_Read reads data from specified Address, while the
library procedure EEprom_Write writes Data to specified Address.
Parameter Address is of byte type, which means it can address only 256 locations.
For PIC18 MCU models with more EEPROM data locations, it is programmer's
responsibility to set SFR EEADRH register appropriately.
program EEPROMtest
dim i as byte
dim j as byte
main:
TRISB = 0
for i = 0 to 20
EEprom_write(i,i+6)
next i
for i = 0 to 20
PORTB = EEprom_read(i)
for j = 0 to 200
delay_us(500)
next j
next i
end.
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
140
mikroBASIC
MikroElektronika: Development tools - Books - Compilers
EEPROM Library
Routines
Note
Example
making it simple...
page