Hi all,
I've been using both 16F677 and 16f685 chips as availability allowed with same program without any problems until I introduced the READ and WRITE functions on the 16F677.
I get the error: Error[113]: Symbol not previously defined (EEPGD)
The data sheet shows:
10.1.1 EECON1 AND EECON2 REGISTERS EECON1 is the control register for EE memory accesses. Control bit EEPGD (PIC16F685/PIC16F689/PIC16F690) determines if the access will be a program or data memory access.
And also when referring to EECON1.7:
Note 1: PIC16F685/PIC16F689/PIC16F690 only.
I stripped the code down to a minimum to compile with READ and WRITE commented out or not to see if it compiles without error using PICBasic Pro 2.47 and MPASM.
This is only a sample routine to demo the compilation error. I hope that someone can shed some light on this.
Code:
'*************************************************************************
@ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_ON & _BOR_OFF
OSCCON = %01001000 ' Oscillator set to 1MHz
PORTA = %00000000 ' Turn off all PORTA
ANSEL = 0 ' Sets all PORTA inputs to digital inputs
TRISA = %00011111 ' Sets all PORTA pins as inputs except RA5
PORTB = %00000000 ' Turn off all PORTB
ANSELH = 0 ' Sets analog inputs 8 ~ 11 to digital inputs
TRISB = %10000000 ' Sets RB4~6 as outputs and RB7 as input
PORTC = %00000000 ' Turn off all PORTC
TRISC = %00000000 ' Sets all PORTC pins as outputs
CM1CON0.7 = 0 ' Analog comparator #1 off
CM1CON0.5 = 0 ' Comparator #1 output disabled
CM2CON0.7 = 0 ' Analog comparator #2 off
CM2CON0.5 = 0 ' Comparator #0 output disabled
ADCON0 = 0 ' A/D OFF
OPTION_REG.7 = 1 ' Global weak pull-up enable bit enabled
WPUA = %00010111 ' Weak pull-ups enable on PORTA inputs
WPUB = %00000000 ' Weak pull-ups disabled on PORTB inputs
'=========================================================================
' Variables
'=========================================================================
x VAR BYTE
'=========================================================================
' Set EEPROM default value at location 2 for 2 Modes at initial program
' then this value is user selectable via Mode button.
'=========================================================================
EEPROM 2, [2]
PAUSE 10
'=========================================================================
' Test loop
'=========================================================================
x = 7
loop:
READ 2, x
PAUSE 10
' WRITE 2, x
PAUSE 10
GOTO loop
END
Thank you all for your input...
Bookmarks