[Tinyos-2.0wg] msp430 usart configure

Jonathan Hui jhui at archrock.com
Sun Aug 6 00:27:59 PDT 2006



Vlado Handziski wrote:
> There are several factors at play here, and some are specific to the 
> nature of the msp430 usart so the solution needs not be replicated "all 
> over the system". Plus, the functionality of the old and the new code is 
> not the same so this is not a cost for "consistency" only. I don't have 
> the time to do real measurement to check the results from Jonathan, but 
> the old code had optimization that skipped even the limited config that 
> was in setModeSPI if the device is already in SPI mode. I hope that he 
> measured this on the first execution of the command.

To be fair, while I said "less than 10 us", I think the measurement was 
closer to 7 us. The measurement does include setting configuring the bus 
from USART_NONE -> USART_SPI. While the old code did have the check in 
there, the power manager arbiter always disables SPI mode whenever the 
bus was idle. So the 7us time is a conservative estimate of overhead 
since it does include a check that the new version doesn't.

> It is hard for me to say which solution has the best cost/benefit ratio 
> because there is no alternative implementation that has the same 
> functionality as 1. The overhead of 1 can be somewhat reduced by 
> removing some unnecessary reads if we don't care about disturbing the 
> bits in the registers that belong to the other modes (since they will be 
> re-configured anyhow). Unfortunately, I don't have the time to do any of 
> these modifications/comparisons. If someone wants to take on the task I 
> will try to help as much as I can, but I can not make any promises.

I fully understand why you took the quicker way out. If we had infinite 
time, I would definitely like to see how the current implementation 
would compare to one that provided a full set of SCs. Maybe I can find 
some time to work on this a little more.

--
Jonathan Hui
jhui at archrock.com


More information about the Tinyos-2.0wg mailing list