[Tinyos-devel] msp430hardware.h patch

steve ayer ayer at handhelds.org
Wed Mar 26 10:17:41 PDT 2008


hi vlado,

[just back from travel] and thanks for fixing my peccadillos...

i agree about the TARGET_DCO_KHZ definition; my mistake for leaking that into the patch. 
some time ago, another colleague had reworked the msp430 clock machinery slightly with 
another header to collect this and a couple of other definitions.  i should have backed 
that out.

your discovery, however, raises a question that i've been trying to find a reasonable way 
to answer:  how do we make TOSH_uwait() dynamic in the face of different MCLK speeds?  for 
either the old tinyos definition or the one introduced with this patch, a tick is still a 
tick.  but, a driver dependent upon a specific amount of setup time, for example, 
shouldn't break if MCLK is attached to an 8mhz crystal.

would anyone like to suggest a solution for this?  a replacement by function call won't 
work out because it takes too long to run; i quickly implemented this a bit ago and the 
scope showed that this was true.  did i miss a detail?

thanks,

steve

Vlado Handziski wrote:
> I have partially modified the msp430hardware.h in the spirit of the patch.
> 
> Since the old __msp430_have_usart0_with_i2c switch is used throughout 
> the code, for the time being I believe it is best to have a simple 
> backward compatibility define instead of testing for both it and the 
> __MSP430_HAS_I2C__.
> 
> I have included your alignment of the low-power test with the tinyos-2.x 
> code and some indentation fixes (note, our policy is not to use tabs in 
> the indentation)
> 
> As for the new TOSH_uwait() implementation, this can not be included in 
> the provided form since there would be a collision between the 
> TARGET_DCO_KHZ define in this file and in the enum in MSP430ClockM.nc. 
> This is not a simple problem of name changing, if this info is 
> duplicated in two files, people will start making mistakes, modifying 
> the value only in one. 
> 
> Also, I am not sure how smart it is in general to make such 
> modifications at this point in the tinyos-1.x lifecycle. This is 
> definitely not the primary interest of the Core WG at the moment, but if 
> the community comes with well tested solutions, we can push them to the 
> tree.
> 
> Vlado
> 
> 
> On Thu, Mar 13, 2008 at 10:01 AM, Vlado Handziski 
> <handzisk at tkn.tu-berlin.de <mailto:handzisk at tkn.tu-berlin.de>> wrote:
> 
>     Yes. I'll test it today and check it in if all is fine.
> 
>     Vlado
> 
> 
>     On Wed, Mar 12, 2008 at 9:05 PM, Philip Levis <pal at cs.stanford.edu
>     <mailto:pal at cs.stanford.edu>> wrote:
> 
> 
>         On Mar 12, 2008, at 6:26 AM, steve ayer wrote:
> 
>          > hi folks,
>          >
>          > i recently upgraded my mspgcc toolchain in the process of
>          > supporting the new msp430x261x series (more on this soon), and
>          > found that one of the macros used in msp430hardware.h was
>         dropped,
>          > breaking builds of msp430-based devices.
>          > __msp430_have_usart0_with_i2c was replaced with
>         __MSP430_HAS_I2C__;
>          > the attached patch supports both.
>          >
>          > btw, this patch also cleans up some indentation, and provides an
>          > improved version of TOSH_uwait() that one of my erstwhile
>          > colleagues added several years ago, its source noted; this
>         upgrade
>          > can now be considered well-tested.
>          >
>          > i hope that this helps,
>          >
>          > steve
> 
>         Vlado, I think you're nominally the MSP430 maintainer. Do you
>         want to
>         take a look at this and apply it?
> 
>         Phil
> 
> 
> 
> 


More information about the Tinyos-devel mailing list