??? 09/25/09 06:33 Read: times |
#169121 - Q: How can I eat a whole whale? Responding to: ???'s previous message |
A: One bite at a time!
Ralf Altman said:
I normally only send and receive 1 byte to the PC by using SBUF (e.g send a character A). I never done sending/receiving a string Like eating a whale, to send a string you just need to do it one byte at a time! So the process is something like this: 1. Form the string to be sent; 2. Send the first byte (character); 3. Wait for that transmission to complete; 4a. If there's more characters to send, repeat from (2) with the next character; 4b If not, then you're done! In an 8051, you identify when the transmission is complete using the TI flag - either by polling it, or by using the interrupt that it can generate. Similarly for receiving. Look at the FAQs - there's a whole section on Serial Comms...! |