So, if you're sending it like this:
SEROUT2 PORTc.2,16780,[temp]
Why are you trying to receive it like this?
SERIN2 PORTc.4,16780,250,programstart,[str myvar\4]
Doesn't it make sense that the format for sending and receiving would probably be the same? It really wouldn't make a lot of sense to have 2 commands that perform the same function (albiet the opposite function) send and receive the same data in 2 completely different ways, does it?
How about trying some of this...Just try it and see what happens:
Code:
tempsend:
portc.1=0 : lcdout $fe,1,"tx t" : portc.3=1
for c =0 to 4
pause 150 How long does this pause?
SEROUT2 PORTc.2,16780,[temp]
PAUSE 100 ' Pause 100uS This doesn't pause for 100us...
next c ' next pass
portc.3=0 : goto main
Code:
SERIN2 PORTc.4 , 16780 , 250 , programstart , [ temp ]
HSEROUT ["A= ",dec temp," B= ",#temp," C= ",temp," ",32,13,10] ' Display result
'A = should be a formatted integer, B=should be a formatted integer, C=will probably be garbage
CLEAR ' Clear array
And another thing...you might have sync'ing issues. You've got a 250ms timeout on the SERIN2 in the RX code, and various pauses and such in the TX code. How often are the two actually going to be ready for each other?
Bookmarks