Anyway here is the code I am using at the receiver:
I will be putting a lcd on the circuit to see how the pic is reading the input.
Beside the test led input at the begining the rest is not functioning, I suppose it has to do with the data coming is in one format and I am treating it in another.
DEFINE OSC 20 '20Mhz Oscillator was used
Include "modedefs.bas" ' Include serial modes
ADCON0 = 0 'AD MODULE OFF & CONSUMES NO CURRENT
ADCON1=7
CMCON = 7 'COMPARATORS OFF
TRISA = 0 'outpu
TRISB = 1 'input
B0 var byte
porta.0 =1 'testing leds output
pause 500
porta.1 =1
pause 500
porta.2 =1
pause 500
porta.3 =1
pause 500
start:
serin PORTB.3,n2400,[B0]
pause 1
if B0 = $aa then led1
if B0 = $aa then led2
if B0 = $5a then led3
if B0 = $5a then led4
goto loop
led1:
porta.0 =1
pause 200
goto start
led2:
porta.1 =1
pause 200
goto start
led3:
porta.2 =1
pause 200
goto start
led4:
porta.3 =1
pause 200
goto start
loop:
porta.0 =1
pause 200
goto start
end
Bookmarks