Hi,
I have a problem with serial communication. I want to send a byte to the reciver by Rf transmitter and reciever.I read the sensor data and pic16F873A send it to RF transmitter and then RF reciever take it to the pic16F873A in reciever circuit.
maby you said the reoson is the errors would be occurs in RF transportation.
but i coonect two micro by a wire and also i have aproblem. and in the reciever lcd don't show any number or a wrong number.
wire that i use is short.
what is the problem?
is it in my software?
i write it in pic basic.
i write my program for transmitter and reciever.
could you help me with this?
tarnsmitter:
define OSC 4
include"modedefs.bas"
trisb= %00000000
x var byte
y var byte
i var byte
pause 2000
x=23
y=2
for i=1 to 10
serout PORTB.7,N1200,[y]
serout PORTB.7,N1200,[x]
next i
end
reciever:
define OSC 4
include"modedefs.bas"
' Set LCD Data port
DEFINE LCD_DREG PORTC
' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 4
' Set LCD Register Select port
DEFINE LCD_RSREG PORTC
' Set LCD Register Select bit
DEFINE LCD_RSBIT 1
' Set LCD Enable port
DEFINE LCD_EREG PORTC
' Set LCD Enable bit
DEFINE LCD_EBIT 0
' Set LCD bus size (4 or 8 bits)
DEFINE LCD_BITS 4
' Set number of lines on LCD
DEFINE LCD_LINES 2
pause 100
lcdout $fe,1
trisb= %11111111
x var byte
y var byte
z var byte
start:
lcdout $fe,1
serin PORTB.5,N1200,[2],x
serin PORTB.5,N1200,[2],y
serin PORTB.5,N1200,[2],z
if (y=z) then
lcdout $fe,1,#y
endif
pause 5000
goto start
end
Amin Derazgisoo
I have a problem with serial communication. I want to send a byte to the reciver by Rf transmitter and reciever.I read the sensor data and pic16F873A send it to RF transmitter and then RF reciever take it to the pic16F873A in reciever circuit.
maby you said the reoson is the errors would be occurs in RF transportation.
but i coonect two micro by a wire and also i have aproblem. and in the reciever lcd don't show any number or a wrong number.
wire that i use is short.
what is the problem?
is it in my software?
i write it in pic basic.
i write my program for transmitter and reciever.
could you help me with this?
tarnsmitter:
define OSC 4
include"modedefs.bas"
trisb= %00000000
x var byte
y var byte
i var byte
pause 2000
x=23
y=2
for i=1 to 10
serout PORTB.7,N1200,[y]
serout PORTB.7,N1200,[x]
next i
end
reciever:
define OSC 4
include"modedefs.bas"
' Set LCD Data port
DEFINE LCD_DREG PORTC
' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 4
' Set LCD Register Select port
DEFINE LCD_RSREG PORTC
' Set LCD Register Select bit
DEFINE LCD_RSBIT 1
' Set LCD Enable port
DEFINE LCD_EREG PORTC
' Set LCD Enable bit
DEFINE LCD_EBIT 0
' Set LCD bus size (4 or 8 bits)
DEFINE LCD_BITS 4
' Set number of lines on LCD
DEFINE LCD_LINES 2
pause 100
lcdout $fe,1
trisb= %11111111
x var byte
y var byte
z var byte
start:
lcdout $fe,1
serin PORTB.5,N1200,[2],x
serin PORTB.5,N1200,[2],y
serin PORTB.5,N1200,[2],z
if (y=z) then
lcdout $fe,1,#y
endif
pause 5000
goto start
end
Amin Derazgisoo