My UART keeps sending data out after a character is received. May I know how to do so that, when i send once, it will receive once without ussing interrupt if possible?
---------- Post added at 18:24 ---------- Previous post was at 18:21 ----------
Here is my code, i manage to receive and sent data at baoud rate 1200 but my next problem is that once it get new data it will continue printing it on hyperterminal, then it will continue with the new character. I need a program that print once when i sent one character without using interrupt. Is it possible?
getcUSART returns the character that's in the receive buffer without regard to whether it is a new character or not. You need to change your code to check if a NEW character is in the receive buffer. Something like this:
Code:
while(1)
{
if (DataRdyUSART())
{
data = getcUSART();
putcUSART( data );
}
}
getcUSART returns the character that's in the receive buffer without regard to whether it is a new character or not. You need to change your code to check if a NEW character is in the receive buffer. Something like this:
Code:
while(1)
{
if (DataRdyUSART())
{
data = getcUSART();
putcUSART( data );
}
}