 |
 |
| View previous topic :: View next topic |
| Author |
Message |
Gon Guest
|
|
Posted: Wed Mar 15, 2006 5:44 am |
|
|
Hello,
it is true ! It is ok, it goes out of the loop.
Many thanks !!!
What could re enable the UART ?
I know there are a CREN and OERR bits.
But when it goes out of the loop, the UART works again ...
What do you think it should be ?
Best regards. |
|
 |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Mar 15, 2006 9:14 am |
|
|
| Gon wrote: | What could re enable the UART ?
I know there are a CREN and OERR bits.
But when it goes out of the loop, the UART works again ...
|
See a previous post | Ttelmah wrote: | | Adding the 'ERRORS' statement to the USE RS232 command, tells the code to check for such an overrun, and reset the UART. |
The best solution is to re-design your reception of data so that your main program can do whatever it has to do without disturbing the receive. A common solution to this problem is to create an intermediate buffer that is filled by an Rx-interrupt driven routine in the background. Whenever your main routine has time it can check the buffer to contain new data and process this.
For the buffer you can use either a linear or circular buffer type, see this thread for a description of when to use which buffer type.
An example of a circular buffer implementation is ex_sisr.c in the CCS example directory. An explanation of the internal workings of this example is given at http://www.ccsinfo.com/forum/viewtopic.php?t=19083
An example of a linear buffer can be found in the post of Humberto in http://www.ccsinfo.com/forum/viewtopic.php?t=19117
Search this forum for the keywords 'circular buffer' to find many more implementation examples. |
|
 |
mpfj
Joined: 09 Sep 2003 Posts: 95 Location: UK
|
| Re: Gon |
Posted: Wed Mar 15, 2006 10:32 am |
|
|
| ckielstra wrote: | 600 * 10ms delay = 60 seconds
600 * printf("\n\r case default") = 10 seconds
-------------------
Total 70 seconds
|
Urm ... my calculator tells me that 600 * 10ms = 6 seconds  |
|
 |
Ttelmah Guest
|
|
Posted: Wed Mar 15, 2006 10:51 am |
|
|
It is just a missing zero. :-)
the delay is 100mSec per loop, plus about 13 character times (the last couple are in the hardware buffer).
So 13.5mSec, pus 100mSec, times 600.
Just under 70seconds.
Probably just a keyboard like mine, which ignores what you type sometimes (the stupid thing here, is that my 'old' AT style Cherry, and IBM keyboards are fine, however modern keyboards - including quite up market units, - often miss keystrokes, both on the key descending, and coming up again - it is amazing how often I find the system returning strings of a character, not having 'seen' me release the key...).
So if anybody knows a really good USB keyboard that desn't have this problem, it'd save me a lot of grief (I have tried the obvious names...).
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
|