11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PICBASIC</strong> <strong>PLUS</strong> Compiler5.24. EREADSyntax :Overview :Operators :Variable = EREAD AddressRead information from the on-board eeprom available on some PICtypes.Variable is a user defined variable.Address is a constant, variable, or expression, that contains the addressof interest within eeprom memory.Example : DEVICE 16F84 ‘ A PIC with on-board eepromDIM Var as BYTEDIM Wrd as WORDEDATA 10 , 354 ‘ Place some data into the eepromVar = EREAD 0 ‘ Read the 8-bit value from address 0Wrd = EREAD 1 ‘ Read the 16-bit value from address 1Notes :If a WORD type variable is used as the assignment variable, then a16-bit value will be read from eeprom, and if a BYTE type variable isused, then 8-bits will be read. To read an 8-bit value while using aWORD sized variable, use the LOWBYTE modifier: -Wrd.LOWBYTE = EREAD 1Wrd.HIGHBYTE = 0‘ Read an 8-bit value‘ Clear the high byte of WrdIf a 16-bit (WORD) size value is read from the eeprom, the addressmust be incremented by two for the next read.Most of the Flash PIC types have a portion of memory set aside forstorage of information. The amount of memory is specific to the individualPIC type, some, such as the 16F84, has 64 bytes, while thenewer 16F877 device has 256 bytes.Eeprom memory is non-volatile, and is an excellent place for storageof long-term information, or tables of values.Reading data with the EREAD command is almost instantaneous, butwriting data to the eeprom can take up to 10ms per byte.See also :EDATA, EWRITE59Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!