Thank you Michael, Ur for your inputs.

I found the problem in my instructions.

I realized that the bits in the output registers in questions have to be set to 
low so the leds connected to the pins turn on :) So, changing 
 atomic (*(volatile uint8_t *)0x31) |= 0x70 

to

 atomic (*(volatile uint8_t *)0x31) |= 0x8F

did the trick

Looked for outp macros for telosb but could not find such.  I will declare my 
own

Thank you again!

LV

--- On Sat, 12/13/08, Michael Schippling <[email protected]> wrote:
From: Michael Schippling <[email protected]>
Subject: Re: [Tinyos-help] Writing to P2.3 and P2.6
To: "Urs Hunkeler" <[email protected]>
Cc: [email protected], "Tinyos-Help" <[email protected]>
Date: Saturday, December 13, 2008, 7:20 AM

I think the original question was how to set multiple pins
with no timing skew. To which I opined that one should be
able to set a full register as a byte, but I don't know
if any high(falutin')-level interface is available for such.

MS

Urs Hunkeler wrote:
> Hi,
> 
> Couldn't you use the Gpio interfaces in something like the example
below?
> 
> In the configuration:
> 
>   components new Msp430GpioC();
>   components HplMsp430GeneralIOC;
>   Msp430GpioC.HplGeneralIO -> HplMsp430GeneralIOC.Port62;
>   MyAppC.Pin -> Msp430GpioC;
> 
> Then, in the module use the GeneralIO interface:
> 
>   interface GeneralIO as Pin;
> 
> Then you should be able to to set the pin to high/low with the following
calls:
> 
>   call Pin.set();
>   call Pin.clr();
> 
> Cheers,
> Urs
> 
> Michael Schippling wrote:
>> Lets keep this on the help list in case someone actually knows
something...
>> 
>> I suspect that you can't do that because the memory spaces are not
>> the same. Look at the controller manual for the instructions that
>> read and write port registers, and then see if you can find equivalent
>> C'ish macros. I'm too lazy to re-find where outp() is defined
for
>> the atmega but I think its in the compiler header files rather than
>> the TOS files. For the MSP I expect there is something similar.
>> Spot checking hardware interface .nc files may provide clues.
>> 
>> MS
>> 
>> 
>> Donde Vas wrote:
>>> Thank you Michael for your input.   I was wondering if you knew if
I can use something
>>> like the following in TinyOs1.  I have tried but it does not work;
it compiles OK tough. I'm playing trying to set all the Leds at once:
>>> 
>>>           atomic (*(volatile uint8_t *)0x32) |= 0x70; // Sets for
output
>>>         atomic (*(volatile uint8_t *)0x33) &= 0x8F; // Sets
for IO
>>>         atomic (*(volatile uint8_t *)0x31) |= 0x70;  // Sets pins
4,5,6 of port 5
>>> 
>>> Regards,
>>> 
>>> LV
>>> 
>>> 
>>> --- On *Fri, 12/12/08, Michael Schippling
/<[email protected]>/* wrote:
>>> 
>>>     From: Michael Schippling <[email protected]>
>>>     Subject: Re: [Tinyos-help] Writing to P2.3 and P2.6
>>>     To: [email protected]
>>>     Cc: [email protected]
>>>     Date: Friday, December 12, 2008, 4:53 PM
>>> 
>>>     You should be able to write a full byte to the port 2 register
>>>     but you'll have to do a little code archeology to figure
out
>>>     what function to use. E.g., in T1 for micas I use:
>>>         outp( value, portaddr );
>>> 
>>>     Also you need to make sure you don't twiddle anything
attached
>>>     to the other bits on the port.
>>> 
>>>     MS
>>> 
>>>     Donde Vas wrote:
>>>     > Hope someone can shed a light on this: I'm writing a
TinyOS telosb
>>>     application which needs to use P2.3 (GIO2) and P2.6 (GIO3). Is
there a command
>>>     in TinyOS that can write to these addresses at once? (there
must be no delay
>>>     between them).  Using MSP430GeneralIOC.Port23 and
MSP430GeneralIOC.Port26 gives
>>>     a delay of some microseconds, which is not acceptable.
>>>     >     > Any suggestions? An example would be great.
>>>     >
>>>          > Thanks!
>>>     >     > Lane



      
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to