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.
RS 232 COMMUNICATION USING RS232 COMPONENT
Moderator: Benj
-
- Posts: 19
- Joined: Tue Sep 07, 2010 7:03 am
- Contact:
RS 232 COMMUNICATION USING RS232 COMPONENT
- Attachments
-
- TIMEOUT.JPG
- (149.91 KiB) Downloaded 664 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS 232 COMMUNICATION USING RS232 COMPONENT
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel