wich model of transmitter / receiver do you use ? Is there any datasheet.
there's few things wierd in your code...
Code:
Send:
cmcon0 = 7
ansel = 0
TRISA = 0
TRISC = 1
PORTA = 0
'RF test program
Start:
IF PORTC.2 = 1 Then
PORTA.0 = 1 ;|
PORTA.0 = 0 ;|
PORTA.0 = 1 ;\
PORTA.0 = 0 ;+ what these lines are suppose to do here ???
PORTA.0 = 1 ;/
PORTA.0 = 0 ;|
SerOut 0,4,[%10010,%1111] ;not familiar with pin0 as output + not sure that SEROUT handle %... may use [18,15]
EndIF
GoTo Start
let' say you want to send these in serial to PORTA.0
%101010
%10010
%1111
first i suggest you to begin with
Porta.0=1
pause 10
this will force Serial out to High level. It appear that you must do it before send any serial data to avoid errors.
i'm not sure that SEROUT will support those % so
%101010 = 42
%10010 = 18
%1111= 15
SEROUT PORTA.0,4,[42,18,15]
will work
and with this other
Code:
Recieve:
cmcon0 = 7
ansel = 0
TRISA = 1
TRISC = 0
PORTC = 0
Dat VAR BYTE
'RF test program
Start:
SerIn PORTA.0,4,[10010],Dat ; not sure that SERIN handle % May use [18]
IF Dat = 1111 Then ;must write dat=%1111 or $0F
PORTC.2 = 1
Pause 500
PORTC.2 = 0
EndIF
GoTo Start
hope this help!
Bookmarks