Hi Darrel,
I'm just beginning to use the EEPROM of the PIC12F683 on the LAB-X4 platform with PB Pro 2.47 and using the MPASM compiler.
I downloaded the EE_Vars.PBP.txt file and copied it to my PBP folder where I resaved it as EE_Vars.PBP, I think I did right.
The good stuff:
I also download your EE_example_1 file to experiment with. After configuring the LCD setup, it works as advertised!
Code:
'****************************************************************
'* Name : EE_1_Example.bas *
'* Author : Darrel Taylor *
'* Date : 8/27/2005 *
'* Version : 1.0 *
'* Notes : This is an Example program for the EE_Vars.PBP *
'* : Include file. *
'****************************************************************
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
OSCCON = %01110001 ' Osc 8Mhz
ANSEL = %00111000 ' Fosc/64 and ANS3 set to analog
ADCON0 = %10001100 ' Right justified and AN3 selected
CMCON0 = 7 ' Analog comparators off
GPIO = %00111101 ' Set all ports to inputs except port 1
TRISIO = %00111101 ' Port 1 to output, rest inputs
;-- Define LCD connections -- (change these to match your hardware) ------------
Include "modedefs.bas" ' Mode definitions for Serout
INCLUDE "EE_Vars.PBP" ; Include the EE_var routines
define OSC 8 ' Declare for PAUSE and PAUSEUS statements
pause 1000
'=========================================================================
' Variable pin names
'=========================================================================
' Var GPIO.0 ' Pin 7
LCD Var GPIO.1 ' Pin 6
' Var GPIO.2 ' Pin 5
' Var GPIO.3 ' Pin 4
' Var GPIO.4 ' Pin 3
' var GPIO.5 ' Pin 2
Days VAR WORD : @ EE_var _Days, WORD, 365
Cats VAR WORD : @ EE_var _Cats, WORD, 1024
Mice VAR WORD : @ EE_var _Mice, WORD, 10000
PowerOn VAR BYTE : @ EE_var _PowerOn, BYTE, 0
PowerOn = PowerOn + 1 ; Increment number of Power-On cycles
@ EE_write_var _PowerOn ; save the new number to EEPROM
Serout LCD, T2400, [$fe, 1] ' Clear screen
pause 1000
Serout LCD, T2400, ["Days= ",#Days," Cats= ",#Cats]
pause 100
Serout LCD, T2400, [$fe, $c0,"Mice= ",#Mice," PowOn= ",#PowerOn]
pause 100
RANDOM Mice ; get a new value for Mice
@ EE_write_var _Mice ; save it to EEPROM
stop
The funny stuff:
If I first select and copy any one of the EE variables such as:
Code:
PowerOn VAR BYTE : @ EE_var _PowerOn, BYTE, 0
and change the Byte to a Word in both cases here, it gets mad when I compile it and reports these errors:
Error[113] c:\program~on and on~ee_1_e~.asm 163: Symbol not previously defined (Byte)
Error[113] c:\program~on and on~ee_1_e~.asm 172: Symbol not previously defined (Byte)
Error[113] c:\program~on and on~ee_1_e~.asm 173: Symbol not previously defined (Byte)
So now if I change it back to BYTE in both cases, it still gets mad after compiling.
Here's the stranger part: I now select the troubled line of code and paste the original line of code prior to all this and the compiler is happy once more!?
I only tried this because when I wrote my own and got these messages, they stopped when I commented out my EE declaration lines and "pasted" your lines instead.
Are you using subliminal texts for this routine? Or did I not copy the Include file properly into my program?
Bookmarks