PDA

View Full Version : Eeprom 16f877?



Leonardo
- 4th October 2005, 19:50
Hello to all,

As I can store and read:

M1 VAR BYTE
M2 VAR BYTE
M3 VAR BYTE
M4 VAR BYTE

in eeprom of 16f877?

Thanks

Melanie
- 4th October 2005, 20:41
Leonardo

Look in the PICBasic manual for DATA, READ and WRITE instructions.

DATA - presets an EEPROM location at Program time (if you have PBC rather than PBP, then you don't have DATA and this is the EEPROM command instead)
READ - Reads a BYTE from EEPROM
WRITE - Writes a BYTE to EEPROM

It's very simple... go try it...

Leonardo
- 4th October 2005, 21:16
Mellanie Thanks

Then ?



M1 VAR BYTE
DATA @ 0,0
.
.
READ 0, M1
.
.
WRITE 0, M1


M2 VAR BYTE
DATA @ 1,0
.
.
READ 1,M2
.
.
WRITE 1,M2


M3 VAR BYTE
DATA @ 2,0
.
.
READ 2,M3
.
.
WRITE 2.M3


M4 VAR BYTE
DATA @ 3.M4
.
.
.
READ 3,M4
.
.
.
WRITE 3,M4

Thanks

rhino
- 5th October 2005, 03:07
Leonardo -
Use the Data command to write your value to EEProm when the chip is initially programmed (use for a static value or to preload the EEprom).... OR.... you can use the Read & Write commands to read or write data during program execution "Runtime" (like if the variable changes). Look at Section 5.11 for the Data command, 5.64 for the Read command, and 5.86 for the Write command.