PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Apr 29, 2006 11:51 pm |
|
|
It's best if you use an interrupt-driven receive buffer, such as the one
shown in the CCS example file, EX_SISR.C. If you set the buffer size
at some reasonably large number of characters, then it gives you time
to go do something else in your program while the INT_RDA isr takes
care of handling incoming characters. Just periodically test "bkbhit"
to see if you have any chars in the buffer. If so, then call bgetc() to
pull them out of the buffer. You do have to check bkbhit often enough
so that you don't get buffer overflow and lose chars. |
|