lcdcon = 0
dim temp as byte
dim temp2 as byte
dir portc.0 in 'serial
#define RecAHigh portc.0 on
#define RecAlow portc.0 off
Initser 1,r2400, 1+waitforstart, 8, 1, none, normal
main:
SerReceive 1, temp
SerReceive 1, temp2
EPWrite(temp,temp2)
goto main
I get symbol not defined eeadr, eedata?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Explanation:
EPWrite is used to write information to the EEPROM data storage, so that it can be accessed later by a programmer on the PC, or by the EPRead command. location represents the location to read data from, and varies from one chip to another. data is the data that is to be written to the EEPROM, and can be a value or a variable.
Example:
'This program will take a measurement from Analog Input 2 every
'second, and then log the reading to EEPROM for future access.
DataPosition = 1
Main:
EPWrite(DataPosition, ReadAD(AN2))
DataPosition = DataPosition + 1
goto Main
It looks right to me, what so you see that I don't?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not that this will help but I have never used a variable as the address. I have always used a literal number for the address like the following example and I call out each storage location this way.
What version of GCBASIC do you have there? There is a bug in the 0.9.3.0 release, that I know will cause that error. However, I'm pretty sure it's fixed in the update patch, which you can get from http://gcbasic.sourceforge.net/update.html
Also, if you downloaded the version of GCBASIC that includes gputils, make sure that you're using the latest version of gputils. This is available at http://gputils.sourceforge.net/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
#chip 16F916, 4 'mhz
#config OSC=INTOSC, MCLRE=off, WDT=off
#mem 256 'Chip has 128 bytes
EEADRH = 1
lcdcon = 0
dim temp as byte
dim temp2 as byte
dir portc.0 in 'serial
#define RecAHigh portc.0 on
#define RecAlow portc.0 off
Initser 1,r2400, 1+waitforstart, 8, 1, none, normal
main:
SerReceive 1, temp
SerReceive 1, temp2
EPWrite(temp,temp2)
goto main
I get symbol not defined eeadr, eedata?
Look! You are using the wrong syntax for the write command. Read the help file.
from the help file:
Syntax:
EPWrite (location, data)
Explanation:
EPWrite is used to write information to the EEPROM data storage, so that it can be accessed later by a programmer on the PC, or by the EPRead command. location represents the location to read data from, and varies from one chip to another. data is the data that is to be written to the EEPROM, and can be a value or a variable.
Example:
'This program will take a measurement from Analog Input 2 every
'second, and then log the reading to EEPROM for future access.
DataPosition = 1
Main:
EPWrite(DataPosition, ReadAD(AN2))
DataPosition = DataPosition + 1
goto Main
It looks right to me, what so you see that I don't?
Not that this will help but I have never used a variable as the address. I have always used a literal number for the address like the following example and I call out each storage location this way.
EPRead (400, Y_Reg_Lo)
EPRead (401, Y_Reg_Mid)
EPRead (402, Y_Reg_Hi)
Jz
I need to use a varible for the location can this be done?
Yes, using the variable for the location should work fine.
but why do i get the errors when i compile it?
What version of GCBASIC do you have there? There is a bug in the 0.9.3.0 release, that I know will cause that error. However, I'm pretty sure it's fixed in the update patch, which you can get from http://gcbasic.sourceforge.net/update.html
Also, if you downloaded the version of GCBASIC that includes gputils, make sure that you're using the latest version of gputils. This is available at http://gputils.sourceforge.net/
that did it, thanks