|
|
View previous topic :: View next topic |
Author |
Message |
Guest
|
serial receive halt |
Posted: Fri Sep 01, 2006 2:02 pm |
|
|
Hi All,
I have a strange problem, after sending the following strings the INT_RDA stops receiving even if there is data.
disable_interrupts(GLOBAL);
//disable_interrupts(INT_RDA);
delay_ms(100);
printf("%s", cmgs);
printf("%s,129\n\r", Number);
delay_ms(250);
printf("%s%c\r\n", sendText, 0x1a);
delay_ms(100);
while (kbhit()) getc();
//enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
I have tryed to stop the GLOBAL interrupts but it didnt work,
What I'm doing wrong ? |
|
|
Ttelmah Guest
|
|
Posted: Fri Sep 01, 2006 2:24 pm |
|
|
The problem is that you have huge periods of time, where the receive part of the UART, is not being serviced. Depending on the chip (some have a two character FIFO, and some only a one character FIFO), if more than 1.99999 characters (or 2.99999 for the chips with a two character FIFO), arrive at any point from the start of the program to the end of the 100mSec delay in front of the getc, unless you have the 'ERRORS' keyword in your #use RS232, the receive part of the UART, will be locked out. It'll still be locked with the 'ERRORS' heyword, but should recover when getc is called (this automatically clears the ERROR status).
Have a look at the thread 'INT_rda disable interrupts'.
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|