uludere72
- 30th May 2005, 11:54
I found lost of example about serial communication . But stil i have problem with my project.
I want to use 16f877. I need 2 serial com.
i am going to build multi pic network.
main pic will ask question to other pic. they will answer it . main pic transmit these returned answer to device.
........
SlaveSelect=PORTB & $f0 ' Get the Slave Select by masking
Lcdout $fe, 1,bin SlaveSelect
pause 200
hserout[dec SlaveSelect]
hserout [26,13,10]
serout2 serialoutput, t9600, ["xyzSTATUS",hex SlaveSelect]
pause 500
serin2 serialinput, t9600,[WAIT ("xyz"),str datatodisplay \8]
Lcdout $fe, 1,str datatodisplay \8
hserout[str datatodisplay \8]
hserout [26,13,10]
pause 500
......
this works properly .
If one of my client Pic didn't send any responce
in this command line
serin2 serialinput, t9600,[WAIT ("xyz"),str datatodisplay \8]
program crash, It is waing for "xyz12345678" I want to skip this line if there isn't any response from the client in certain time . for example after the 1minute .
hserin has this property! but i am using that port for the other device...
I want to use 16f877. I need 2 serial com.
i am going to build multi pic network.
main pic will ask question to other pic. they will answer it . main pic transmit these returned answer to device.
........
SlaveSelect=PORTB & $f0 ' Get the Slave Select by masking
Lcdout $fe, 1,bin SlaveSelect
pause 200
hserout[dec SlaveSelect]
hserout [26,13,10]
serout2 serialoutput, t9600, ["xyzSTATUS",hex SlaveSelect]
pause 500
serin2 serialinput, t9600,[WAIT ("xyz"),str datatodisplay \8]
Lcdout $fe, 1,str datatodisplay \8
hserout[str datatodisplay \8]
hserout [26,13,10]
pause 500
......
this works properly .
If one of my client Pic didn't send any responce
in this command line
serin2 serialinput, t9600,[WAIT ("xyz"),str datatodisplay \8]
program crash, It is waing for "xyz12345678" I want to skip this line if there isn't any response from the client in certain time . for example after the 1minute .
hserin has this property! but i am using that port for the other device...