Hi,
Most of the time your PIC should be listening to the available data. Use some sort of acknowledge when it receives a valid packet. You can try respond through the control lines of the RS232 ports.
Other possibilities are using the PIC's hardware USART. The hardware USART normally has a two byte buffer and generates an interrupt when a byte is received.
By using Darrel's Instant Interrupt implementing it should not be a big deal.
All you need to do it get the bytes in a ring array or FIFO for processing later. Use some sort of unique Header and Terminator in your packet send by the PC. If your are using a FIFO in your main program loop go on hunting for the terminator(the last byte received). When found you can check your FIFO's deepest location (since the data packet length is fixed) for a valid header. If found then anything between your header and terminator is your data packet.
Bookmarks