Datasheet

Programming PIC Microcontrollers in BASIC - mikroElektronika
Example
TRISB = 0
Delay_ms(30)
for i = 0 to 20
PORTB = EEPROM_Read(i)
for j = 0 to 200
Delay_us(500)
next j
next i
5.2.6.2 EEPROM_Write – Writes 1 byte to EEPROM
Prototype
sub procedure EEprom_Write(dim Address as byte, dim Data as byte)
Description Function writes byte to <Address>. <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.
All interrupts will be disabled during execution of EEPROM_Write routine (GIE bit of INTCON register will be
cleared). Routine will set this bit on exit
Ensure minimum 20ms delay between successive use of routines EEPROM_Write and EEPROM_Read.
Although EEPROM will write the correct value, EEPROM_Read might return undefined result.
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (53 sur 112)05/11/2004 02:20:52