[En-Nut-Discussion] USART RINGBUF Structure Change

Harald Kipp harald.kipp at egnite.de
Mon Nov 8 21:33:47 CET 2004


Matthias,


>did you see my other posting on usartavr?

I did but had been busy working with more serious things
such as Nut/OS on the GameBoy. Everything had been committed
in. app/timers crashes but app/threads works fine. :-)

OK, OK...the USART...




>one more comment on usartavr.c:
>
>the AvrUsartDisable function does a busy wait to assure
>that the last byte written to TX buffer is out of the ATmel.
>This obviously only works correctly, if the time for
>one byte (including start/stop/parity) is shorter then
>the waiting time. with the used 10 ms, this matches
>a 9600 baud rate. if the baud rate is lower, during
>changing baud rate, the last byte might get corrupted.
>
>the correct way here is to check the tx complete bit of
>the usart. (which I guess, I'm welcomed to implement but
>is not high on my priority list).. I just wanted to point
>this potential bug out... :)

I agree, of course. Actually I may have thought, that
someone who's changing serial data clock and format
might expect corruption. I offered a little bit relief
down to 9600 Baud. Seriously, no one changes these
settings in hot communications or, if he does, like
in some ancient modem connections, he should include
some delay in his applications. Anyway, all this is
just for my legitimation. :-) We should fix it.

I'll post an answer to your first email separately to keep
the thread intact.

Harald




More information about the En-Nut-Discussion mailing list