??? 11/10/04 07:58 Read: times |
#80883 - RE: strange Uart transfer! Responding to: ???'s previous message |
hi,
Donald, you're right TI wont help me, but, it would do no harm. :) No, it does produce a error potentially. Let me explain, what may happen. After the last byte of array A is loaded into SBUF, the program comes out from send(), then takes the pointer of array B and comes to send() routine again. Here it sets bit TI and send the first byte of array B immediatelly. Now imagine that program comes back to routine send() before the last byte of array A has been sent completely. What happenes then? Transfer buffer overflow! To avoid such problems, set bit TI only once before main cycle. The good place is lines below UART and timer1 configuration. Another way - wait till bit TI has been set before leave send() routine. Regards, Oleg |
Topic | Author | Date |
strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer! - Steve | 01/01/70 00:00 | |
RE: strange Uart transfer! - Steve | 01/01/70 00:00 | |
RE: strange Uart transfer! - Steve | 01/01/70 00:00 | |
hypoterminal | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 | |
RE: strange Uart transfer!![]() | 01/01/70 00:00 | |
RE: strange Uart transfer! | 01/01/70 00:00 |