sdy
04-17-2007, 06:21 AM
Getting very crappy communications link. It waits forever for the synch word, without it, recieved data is all over the place. Any one have some code I could try? Here's mine:
XMIT:
cntr VAR Byte
junk VAR Byte
junk = 126
'sync = "A"
start:
PAUSE 1000
dat = 1
FOR cntr = 0 TO 9
HIGH 0
SEROUT 3,17405,[junk,65,DEC dat]
LOW 0
PAUSE 1000
NEXT
LOW 0
PAUSE 100
GOTO start
RCV:
dat1 VAR Byte 'Data storage variable
START:
SERIN 0,17405,[ WAIT(65), dat1]
HIGH 2
DEBUG DEC dat1,CR
' PAUSE 100
LOW 2
GOTO START
XMIT:
cntr VAR Byte
junk VAR Byte
junk = 126
'sync = "A"
start:
PAUSE 1000
dat = 1
FOR cntr = 0 TO 9
HIGH 0
SEROUT 3,17405,[junk,65,DEC dat]
LOW 0
PAUSE 1000
NEXT
LOW 0
PAUSE 100
GOTO start
RCV:
dat1 VAR Byte 'Data storage variable
START:
SERIN 0,17405,[ WAIT(65), dat1]
HIGH 2
DEBUG DEC dat1,CR
' PAUSE 100
LOW 2
GOTO START