No Problem here but an example for others.
I have two serial devices attached to a 28Xx chip and I wanted
to have both data streams end up in the scratchpad.
With only one HSSERIN (pin 18) I tried the following with good results.
I am using the same pin 18 as the HSSERIN here for testing
but I can now use one of the other 0 to 6 (pins 11 to 17).
I tested up to 40 characters incoming at once.
The line should accept up to 80 which will suit the final NMEA string input.
The long SERIN command does play up with the code box...
I have two serial devices attached to a 28Xx chip and I wanted
to have both data streams end up in the scratchpad.
With only one HSSERIN (pin 18) I tried the following with good results.
I am using the same pin 18 as the HSSERIN here for testing
but I can now use one of the other 0 to 6 (pins 11 to 17).
I tested up to 40 characters incoming at once.
The line should accept up to 80 which will suit the final NMEA string input.
The long SERIN command does play up with the code box...
Code:
#picaxe 28X1
#terminal 4800
#no_data
#no_table
setfreq m4
mainsl:
ptr=0
SERIN [1000,nodata],7 , T4800_4 ,("$"),@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc,@ptrinc
nodata:
IF ptr=0 THEN nothing
sertxd(#ptr," ")
B1 = ptr - 1
ptr=0
SERTXD("$")
FOR B0 = 0 TO B1
SERTXD(@ptrinc)
NEXT
GOTO mainsl
nothing:
sertxd (".")
GOTO mainsl