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.25. EWRITESyntax : EWRITE Address , [ Variable {, Variable…etc } ]Overview :Operators :Write information to the on-board eeprom available on some PICtypes.Address is a constant, variable, or expression, that contains the addressof interest within eeprom memory.Variable is a user defined variable.Example : DEVICE 16F628 ‘ A PIC with on-board eepromDIM Var as BYTEDIM Wrd as WORDDIM Address as BYTEVar = 200Wrd = 2456Address = 0‘ Point to address 0 within the eepromEWRITE Address , [ Wrd , Var ] ‘ Write a 16-bit then an 8-bit valueNotes :If a WORD type variable is used, then a 16-bit value will be written toeeprom, and if a BYTE type variable is used, then 8-bits will be written.To write an 8-bit value while using a WORD sized variable, usethe LOWBYTE modifier: -EWRITE Address , [ Wrd.LOWBYTE , Var ]If a 16-bit (WORD) size value is written to the eeprom, the addressmust be incremented by two before the next write: -FOR Address = 0 TO 64 STEP 2EWRITE Address , [ Wrd ]NEXTMost 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.Writing data with the EWRITE command can take up to 10ms perbyte, but reading data from the eeprom is almost instantaneous,.See also :EDATA, EREAD60Copyright Crownhill 2001

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

Saved successfully!

Ooh no, something went wrong!