So after alot of headaches i have finally got SERIN SEROUT working . The first and biggest problem was the baud rate i was using the initial (3313) is only meant to communicate with a level converter. I am using (27889) which is 7bit with even parity. Here is the code i hope it helps anyone else who is stuck with the SERIN SEROUT.
Send:
clear
DEFINE OCS 4
ADCON1 = %00000111
CMCON = %00000111
TRISA = %11111111
TRISD = %00000000
X VAR BYTE
X = 555
LOOP1:
SEROUT2 PORTA.5, 27889 , [244]
PAUSE 500
GOTO LOOP1
END
Recive:
Clear
define ocs 4
ADCON1 = %00000111
CMCON = %00000111
TRISA = %11111111
TRISD = %00000000
X VAR BYTE
LOOP1:
LOW PORTD.3
SERIN2 PORTA.5, 27889, [X]
HIGH PORTD.3
HIGH PORTD.2
PAUSE (X * 10)
LOW PORTD.2
PAUSE (X * 10)
GOTO LOOP1
END
Thanks Again to all those who helped solve this.
Bookmarks