[Tinyos] Re: [Tinyos-users] HPL query(ies)?

karan karan at resolution.com
Wed Sep 1 07:19:17 PDT 2004


no replies???
is there anyone who knows the HPL layer
enough to answer this??

thanks,
karan

On Tue, 2004-08-31 at 09:26, karan wrote:

> Hi everyone,
> 
> im trying to figure out the relationship between 
> platform/atmega8/hardware.h
> platform/avrmote/avrhardware.h
> platform/mica/hardware.h
> platform/mica2/hardware.h
> platform/mica2dot/hardware.h
> 
> does anyone know exactly hwo these files work?? 
> which pins are we referring to in these files??
> for eg. in the atmega8's hardware.h, we have: 
> 
>         TOSH_ASSIGN_PIN(INT0, D, 2);
>         TOSH_ASSIGN_PIN(INT1, D, 3);
> 
> i have no idea what these refer to.
> is this referring to some interrupt on the atmega chip,
> or to TP19 and TP20 on the mica2dot (from page 19 of the MPRMIB User
> Guide).
> on the mica2dot's hardware.h we have: 
> 
>         // interrupt assignments
>         TOSH_ASSIGN_PIN(INT0, D, 0);
>         TOSH_ASSIGN_PIN(INT1, D, 1);
>         TOSH_ASSIGN_PIN(INT2, D, 2);
>         TOSH_ASSIGN_PIN(INT3, D, 3);
> 
> 
> I am vaguely aware that mica2 inherits some functionality from mica
> and avrmote platforms. but i don't know how it does that.
> is this defined in the .platform file in "@commonplatforms"??
> 
> what i want to do is generate an interrupt on the mica2dot in the
> following way:
> 1. assign one bit of INT0 as output. (TP19)
> 2. assign one bit of INT1 as input. (TP20)
> 3. connect the two pins with a wire + resistor.
> 4. send a 1 to INT0.
> 5. the interrupt handler which is waiting on the particular bit of
> INT1, gets raised on a high input value.
> 
> how do i do this?
> 
> i think i can use sbi to set the bit in step 4.
> in step 5, my interrupt handler can look like this: 
> 
>         TOSH_INTERRUPT(INT1)
>             {
>               cli();         // global interrupt disable
>               call Leds.redToggle();
>               sei();         // global interrupt enable
>             }
> 
> how will my program know that the bit on INT1 has become high?
> and where do i make the pin assignments for input and output
> with something like this: 
> 
>         TOSH_MAKE_INT0_OUTPUT;
>         TOSH_MAKE_INT1_INPUT;
> 
> ???
> 
> is there a hpl genius out there??
> plz help me out.
> 
> thanks in advance,
> karan 
> 
> ______________________________________________________________________
> 
> _______________________________________________
> Tinyos-users mailing list
> Tinyos-users at Millennium.Berkeley.EDU
> http://mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://Mail.Millennium.Berkeley.EDU/pipermail/tinyos/attachments/20040901/f61d78a2/attachment.htm


More information about the Tinyos mailing list