[Tinyos-2.0wg] TX done notification in serial stack
Vlado Handziski
handzisk at tkn.tu-berlin.de
Fri Jul 7 05:03:10 PDT 2006
On 7/7/06, Ben Greenstein <bengreenstein at gmail.com> wrote:
>
> Vlado,
> Would you like to start a discussion on your proposed serial communication
> enhancements?
>
I don't have much additional insight than what is in the call notes. I think
it is obvious that there are situations when we need explicit information
that the data sent over the UART has actually been transmitted in full (like
before powering the usart down, when switching from TX to RX on a radio with
UART data line, etc.) On platforms that don't have double buffering, we can
use the putDone event but putDone does not guarantee that the data is sent
on double buffered MCUs (both the atmega and the msp430 are double
buffered).
The issue is how to push this notification to the higher layers (above HPL).
Some MCUs have explicit interrupt (the atmega) that can be translated into
an event (txDone or txEmpty) and propagated to the higher levels. The
msp430 is not generating a HW interrupt when the TX is empty, it only
provides a flag that can be polled. The obvious solution here would be to
loop on the flag, but depending on the speed of the UART this can take a
significant amount of time. Alternatively, one can push a dummy byte at the
end of the transmission, to flush the real data out, and use the putDone
after the dummy byte as indication that the real data has been sent.
Unfortunately some of the dummy info will leak on the line, so the other
side has to be able to safely ignore this garbage.
So both solutions have significant shortcomings, and I don't see a way how
this can be handled nicely on the non-interrupt capable MCUs.
Vlado
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-2.0wg/attachments/20060707/6a718604/attachment.htm
More information about the Tinyos-2.0wg
mailing list