Quote Originally Posted by lerameur View Post
NO incrementation on the receiver. The same with all zeros all the time
what about using the serin2 command ??

with the new define, I can see glitches of 'Sending...' on the second line of the sending side. But most often it is on like before, 'Getting...'
Transmit side - sounds like it's doing like it should.

Receive side - try this one:

'RECEIVE
INCLUDE "modedefs.bas"
DEFINE OSC 20 'use external 20mhz crystal
CMCON = 7 : ANSEL = 0 : ADCON1 = 7
DEFINE LCD_DREG PORTA ' Set LCD Data port
DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 0 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD

'try1 = count of times waiting for data, try2 = count of bytes received
try1 var byte : try2 var byte : temp var word : tempf var word : input portb.2 : pause 2500
try1 = 0 : try2 = 0

loop:
lcdout $fe , $c0 , "Waiting.." , DEC3 try1 , "," , DEC3 try2
try1 = try1 + 1 : temp = 0 : tempf = 0
serin portB.2 , n2400 , [ temp.highbyte , temp.lowbyte , tempf.highbyte , tempf.lowbyte ]
if temp + tempf > 0 then try2 = try2 + 1 'if temp+tempf are not 0 then data received
lcdout $fe , $c0 , "Received." , DEC3 try1 , "," , DEC3 try2 : pause 100
lcdout $fe , $c0 , "Display.." , DEC3 try1 , "," , DEC3 try2 : pause 100
lcdout $fe , $80 , "Tc=" , DEC3 temp , "C,Tf=" , DEC3 tempf , ".." : pause 100
lcdout $fe , $c0 , "Shown...." , DEC3 try1 , "," , DEC3 try2 : pause 100
goto loop
End