Not sure what you mean by datapin...
But..
On the receive side you are only checking the serial port once,
Put the SERIN2 line inside of LOOP1.Code:SERIN2 PORTA.5\PORTA.1, 3313, [DEC X] LOOP1: HIGH PORTD.2 PAUSE X LOW PORTD.2 PAUSE X GOTO LOOP1
Not sure what you mean by datapin...
But..
On the receive side you are only checking the serial port once,
Put the SERIN2 line inside of LOOP1.Code:SERIN2 PORTA.5\PORTA.1, 3313, [DEC X] LOOP1: HIGH PORTD.2 PAUSE X LOW PORTD.2 PAUSE X GOTO LOOP1
Dave
Always wear safety glasses while programming.
Thats prolly my fault. Way back at the beginning I suggested to take it out of the loop. I was thinking it would be gotten before entering the loop.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Thanks again i moved SERIN inside the loop but to no avail. I am assuming there is an issue with my baud rate. If i am sending should the sending and receiving baud rate be identical or should one be inverted?
Thanks for the help
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