Hi Bruce,
"If you just need to PIC to tell the PC to stop sending data, connect the PIC flow control pin to the PC CTS pin."
I tried that, didn't work.
"Once you receive the terminating character, write your data to EEPROM, then wait for the next packet."
I tried that too, writing to EEPROM takes too long. The balance of data goes to hyperspace.
"Just clears whatever characters may have arrived after the terminating character was received. You want to be sure RCREG is empty & RCIF is clear before your next data packet shows up."
I can't exactly do that. Those characters sitting in the 2nd byte of RCREG and in RSR are the start of the next record.
"You do not want interrupts enabled when writing data to the EEPROM, so you will definitely want to implement something to let the PC know you're busy."
Yup, I only have interupts enabled in a small loop where I'm waiting for input. Besides CTS, which I can't get to work, is there another means of telling the PC to stop sending? It looks to me like the PC only listens to CTS at the end of his packet, not in the middle.
"At some point, you're going to need some kind of synchronization with your PC program sending your data. You can't just keep slamming data into the USART without doing something with it to clear the array, and you're going to need some time to write your data to EEPROM (without interrupts enabled)."
Do you have any idea how to do that? I've been going through pages 101 and 102 of the PIC 16F877 - USART ASYNCHRONOUS RECEIVER, and tried a ton of combinations using the flags they mention. Nothing works as expected.
I can read my entire file without any problems, I just don't have time to process the records. I don't even have time to write to EEPROM without doing any record formatting whatsoever. I just set the location to 1 and write a record with zeroes.
I have to momentarily interrupt the transfer, but I can't figure out how. Mister E has been giving this a try on his end and as far as I know, he's still stumped.
Robert
![]()
Bookmarks