Hi leinske,
You aren't missing any macros. It's just that STR can't work with WORD variables. It only works with array's.
I believe you have "wp" defined as a WORD.
<br>
Hi leinske,
You aren't missing any macros. It's just that STR can't work with WORD variables. It only works with array's.
I believe you have "wp" defined as a WORD.
<br>
DT
Thanks Darrel for the rapid answer, indeed my variable wp was a WORD array, sorry i had misreading the manual they says explicitly that the arrays must be a BYTE , change made to BYTE and compiling OK
Leinske
Having the same dort of problems here too with STR and serin2
my line of code is:
SERIN2 PORTB.1, 188, 3000, RXERROR, [WAIT ("GPRMC"), skip 1, STR TIME\11\",", STR WARN\1, skip 1, STR LAT\10\",", STR NS\1, skip1, STR LONG\11\",", STR EW\1, skip 1, STR SPD\6\",", STR DIR\6\",", STR DATE\6]
I have all the variables used set as:
LAT VAR BYTE (10)
and so on (with some being (1) or other values, nothing being used is defined as a word, the error message I keep getting is:
*** Must be a BYTE ARRAY variable for STR! ***
any help would be great
The only thing I see wrong is the skip1 in-between NS and LONG. Should have a space in there. But that won't cause the described error.
It does compile without error if I create all the variables and fix the skip.<br>Code:TIME var BYTE[11] WARN var BYTE LAT var BYTE[10] NS var BYTE LONG var BYTE[11] EW var BYTE SPD var BYTE[6] DIR var BYTE[6] DATE var BYTE[6] SERIN2 PORTB.1, 188, 3000, RXERROR, [WAIT ("GPRMC"), skip 1, STR TIME\11\",", STR WARN\1, skip 1, STR LAT\10\",", STR NS\1, skip 1, STR LONG\11\",", STR EW\1, skip 1, STR SPD\6\",", STR DIR\6\",", STR DATE\6] RXERROR:
DT
Ok thanks, I fixed the skip 1 bit and recompiled, still no luck, still getting the same error on both lines that contain the STR command (there is another one just after this to save some more stuff).
Can you post the variable declarations?
Must be something there that your missing.
The above example compiles fine. Is there anything different?
<br>
DT
'**********
'Define variables
'**********
MENU var BYTE 'Menu variable
TIME var BYTE(11) 'Time variable
WARN var BYTE 'Warning variable
LAT var BYTE(10) 'Latitude variable
LONG var BYTE(11) 'Longitude variable
NS var BYTE 'North/South variable
EW var BYTE 'East/West variable
SPD var BYTE(6) 'Speed variable
DIR var BYTE(6) 'Direction variable
DATE var BYTE(6) 'Date variable
ALT var BYTE(5) 'Altitude in m variable
ALTU var BYTE 'Altitude units
HDOP var BYTE(5) 'Horizontal dilution of precision
SAT var BYTE(2) 'Satellites used
METRE var WORD 'Height in meters variable
AFEET var WORD 'Height in feet variable
TEMP var BYTE 'Temp. for altitude conversion
MULT var WORD 'Multiplier for altitude conversion
ALTVAR var BYTE 'Set number for times round loop
ALTF var BYTE(5) 'Altitude in feet storage
'**********
'setup interrupts
'**********
OPTION_REG = $7f 'Enable PORTB pull-ups and rising edge trigger
INTCON = $90 'Enable INTE (port b, pin 0) interrupt
MENU = "0" 'Clear the menu variable
ON INTERRUPT GOTO INT 'Define interrupt handler
'***********
'Startup Screen
'***********
PAUSE 100 'Allow LCD to power up for 750ms
LCDOUT $FE, 1 'Clear screen and display information
LCDOUT "GPS Display"
PAUSE 500 'Startup screen pause time
'**********
'Main program
'**********
'First collect data from GPRMC and GPGGA strings
RXLOOP:
SERIN2 PORTB.1, 188, 3000, RXERROR, [WAIT ("GPRMC"), skip 1, STR TIME\11\",", STR WARN\1, skip 1, STR LAT\10\",", STR NS\1, skip 1, STR LONG\11\",", STR EW\1, skip 1, STR SPD\6\",", STR DIR\6\",", STR DATE\6]
SERIN2 PORTB.1, 188, 3000, RXERROR, [WAIT ("GPGGA"), skip 39, STR SAT\2, skip 1, STR HDOP\5\",", STR ALT\6\",", STR ALTU\1]
There you go, there is plenty more after that but that is the bits that are giving me the first set of troubles.
/*edit*/ it is laid out better than that, much the same as the example you gave
Bookmarks