On 2/9/07, jtroxas wrote: > > hello.. > I am doing a serial communication and doing a loopback test through a PIC > most of the times the last two or four bytes of a message is not being > sent > back to the sending computer from the PIC... > > the computer pulls down a pin to 0volts to tell the PIC that a > transmission > is over and up to tell the PIC that its about to initiate a transmission.. > The PIC signal a clear to send message by raising another pin to 5 > volts... > > when the PIC has sent a reply it pulls down this other pin to low and > disables Transmit Interrupt... You need to account for the time the PC takes to digest the data, between reading it off the serial port and the software getting a cpu time slice and taking it off the port's buffer. Also, if you're using a USB-RS232 converter you need to allow at least 100 ms between finishing transmission and disabling handshake lines. Also, you probably don't need to set pins to tell your starting a transmission. Just transmit. Handshake lines were never intended to limit packets of data. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist