So the next thing it to WRITE 'Total' to EEPROM address, then READ that value and put it back into 'Total'.
The theory is that when the PIC power supply is turned off then restarted last 'Total' reappears on the LCD.
Dave
So the next thing it to WRITE 'Total' to EEPROM address, then READ that value and put it back into 'Total'.
The theory is that when the PIC power supply is turned off then restarted last 'Total' reappears on the LCD.
Dave
Yup, that is the mission![]()
Dave
Always wear safety glasses while programming.
From the manual:
So looking at the 16F684.PDF it says:Code:WRITE Address,Value
So would:The PIC16F684 has 256 bytes of data EEPROM
with an address range from 0h to FFh.work? Not quite as simple as that he says! For one thing these are EEPROM BYTES and 'Total' is a WORD two BYTES for a starter.Code:WRITE 0h,Total
Dvae
You do not need to use HEX numbers for the address, PBP takes care of that.
http://www.melabs.com/resources/samples.htm
Might find the above .... interesting
Dave
Always wear safety glasses while programming.
Mmm. Well I kind of think I know what I have to do, it's break the VAR WORD Total up into two BYTES, allocate them each a memory space B1 & B1+1 (from the prog below) WRITE the BYTES to the memory locations then READ them back.
My reading of the program above is that B1 = 's ( 0,2,4,6,8,10,12) + 1000 this is then written and read from memory location B1 & B1+1 into WORD W2 am I close?Code:INCLUDE "modedefs.bas" ' Include serial modes SO VAR PORTC.6 ' Define serial output pin B1 VAR BYTE ' Address variable W2 VAR WORD ' Data variable mainloop: For B1 = 0 To 12 step 2 ' Step 2 because each word requires 2 bytes of memory W2 = B1 + 1000 ' Add 1000 to address Write B1, W2.HIGHBYTE ' Write high byte of word Write B1+1, W2.LOWBYTE ' Write low byte of word to next address Next B1 For B1 = 0 To 12 step 2 ' Step 2 to get word size data Read B1, W2.HIGHBYTE ' Read high byte Read B1+1, W2.LOWBYTE ' Read low byte SerOut SO,T2400,[#W2," ",10,13] ' Display the word data Next B1 SerOut SO,T2400,[10,13,10,13] ' Skip 2 Lines GoTo mainloop ' Forever
Dave
I'm on it.......Sounds like you understand it. Have you tried it yet?
Bookmarks