Page 1 of 1

RS 232 COMMUNICATION USING RS232 COMPONENT

Posted: Thu Dec 02, 2010 7:22 am
by keshav@solus.in
HELLO

I am using pic 18f8722 microcontroller in our project.

Microcontroller transmit and receive 10 bytes of data from and to host(computer),

Using flowcode v4 i written code for receive and transmit 10 bytes of data to and from HOST(computer).

Using RS232 component receive and transmit the data to and from HOST,

I have following query about RS232 component macro

1)For transmission its working fine but for Reception microcontroller does not receiving data from Host,

2)If i written Timeout value -1 in RS232 component macro microcontroller receiving fine after some time it will stop transmission and reception.

for your kind reference i have attached TIMEOUT.JPEG FILE,

Please go through give me the suggestion for this one.

Re: RS 232 COMMUNICATION USING RS232 COMPONENT

Posted: Thu Dec 02, 2010 9:21 am
by Benj
Hello,

A timeout of -1 or 255 as it is represented in a unsigned variable forces the receive macro to wait forever for incoming data. What happens if you set the timeout to say 100 or 10? Its good to have a decision directly after the RS232 read to check if the received byte is less then 255 and therefore valid data.