I send one byte to the 8052 and I'm receiving that byte over and over indefinitely. Why?
Submitted By: Craig Steiner FAQ Last Modified: 07/10/06
- Most likely you forgot to clear the RI bit after you read SBUF. RI is set by the 8052 when a character is received. After you read the value out of SBUF you should immediately clear RI. If you don't, RI will still be set and your program will again detect that RI is high and process the serial input again. Since you didn't clear RI, your program is actually detecting the character you already received and re-reading SBUF will return the same value you already processed. This will result in the illusion of the same character being received over and over.
Add Information to this FAQ: If you have additional information or alternative solutions to this question, you may add to this FAQ by clicking here.