While not "garbage" read end-while Or in other words, On each read, check for "garbage". If "garbage" found, re-read until OK. Or is it hard to automaticly detect what's "garbage" ? Jan-Erik S=F6derholm. -----Original Message----- From: Francois Robbertze [mailto:fr10@mweb.co.za] Sent: den 11 september 2002 20:17 To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]: RS232 & PIC I have a PIC between a RS232 and a RS485 that only check & calculates = CRC values and respond to only few commands (e.g. Error Status and = Firmware Version). All the other data is just passed on to the slaves = on the RS485 network together with the CRC value.=20 If I power up the board...the fist data request to the firmware or to = any other slave on the RS485 network returns "garbage". The follow-up = request is always correct (Just very little CRC errors on slaves that = are very far from the master unit - acceptable) I expect the problem to be at the return data of the RS232 because the = PIC respond to the commands the first time. If the CRC value is not = correct or the PIC received "garbage" then it would just return to = standby and the computer will retry. I compensate for this by reading the firmware version from the PIC = every time the software on the computer starts. The PIC or RS232 = returns "garbage" (which I dont display) and after that the system = works fine. I have a problem when the master unit is switched on when = the software is already running. Any suggestions? Francois -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.