That's it, Steve. I was actually on the same track as yourself when I got
your email. Was trying to figure out what the names of the pins were. 

Works perfectly now. Thanks a lot again!  

-----Original Message-----
From: steve ayer [mailto:[email protected]] 
Sent: 16 March 2012 17:28
To: Niall Twomey
Cc: [email protected]
Subject: Re: [Shimmer-users] Interrupt on internal extension board

hmm,

that looks right.  did you make the pin input and gpio?

TOSH_SEL_PROG_IN_IOFUNC();
TOSH_MAKE_PROG_IN_INPUT();

they're set to output (already gpio) by default, so if you didn't change 
that, then this will fix it.

getting closer...

-steve

On 03/16/2012 01:17 PM, Niall Twomey wrote:
> Thanks for the email, Steve.
>
> I think the interruptTest.edge(TRUE); makes it trigger on a positive
edge...
> when I call that in the init() function I think it should enable the
> trigger... shouldn't it?
>
> I have now changed the interruptTest.fired() function to:
>    async event void interruptTest.fired() {
>      if ( call interruptTest.getValue() == TRUE ){
>        call interruptTest.edge( FALSE );
>        call Leds.led0On();
>        call Leds.led1On();
>
>      } else {
>        call interruptTest.edge( TRUE );
>        call Leds.led0Off();
>        call Leds.led1Off();
>      }
>      atomic call interruptTest.clear();
>    }
> Which should switch the edges after the event I think... I'm testing this
> with a function generator giving me a square wave. The grounds of the
> SHIMMER and generator are connected, and I'm driving it to 3V. Is this
> correct?
>
> One thing I'm uncertain about is when I look at the interrupt directory
> (tinyos-main/tos/chips/msp430/pins/*) there aer a number of
> interrupt-related files:
> HplMsp430Interrupt.nc
> HplMsp430InterruptC.nc
> HplMsp430InterruptP.nc
> HplMsp430InterruptNMIC.nc
> HplMsp430InterruptNMIP.nc
> Msp430InterruptC.nc
> I'm wired up to HplMsp430InterruptC 'cause that's what the Bluetooth
> implementation used, but I'm not certain that I'm doing the correct thing
> here. Does that seem right?
>
> Thanks again,
>
> Niall
>
>
>
> -----Original Message-----
> From: steve ayer [mailto:[email protected]]
> Sent: 16 March 2012 15:55
> To: Niall Twomey
> Cc: [email protected]
> Subject: Re: [Shimmer-users] Interrupt on internal extension board
>
> hi niall,
>
> did you tell the interrupt what edge to expect?  for example, if the pin
> is high when you enable the interrupt, and you tell it to expect a
> rising edge (that's the on-reset default, iirc), then nothing will
happen...
>
> oh, one more thing:  of course, you'll then have to switch edges after
> you get an event.
>
> i hope that this helps,
>
> steve
>
>
>
> On 03/16/2012 11:48 AM, Niall Twomey wrote:
>> Hi all,
>>
>> I am interested in having an interrupt from a pin on the internal
>> extension header (the one the ECG/Gyro boards etc slot into). Looking at
>> the hardware guide
>>
>
<http://www.btnode.ethz.ch/pub/uploads/Projects/SHIMMER_HWGuide_REV1P3.pdf>,
>> it seems that BSL_TX/RX and Serial CTS/RTS can be used as internal
>> interrupt lines. Which is great! I did some searching around the tos
>> file structure, and it looks like the Roving Networks Bluetooth
>> implementation has some good pointers about how I might achieve this, so
>> I used the ConnectionInterrupt implementation as a starting template and
>> modified the AccelECG project accordingly.
>>
>> I decided to use the BSL_RX pin as the external interrupt pin as it was
>> out of the way, I suppose. It's pin #10 on the header, and pin#22
>> (port2.2) on the MSP430. It was an arbitrary choice to be honest, but I
>> don't think it should matter much.
>>
>> My test application should toggle the LEDs when an interrupt has been
>> detected. The code compiles and builds fine. But the interrupt isn't
>> working yet. I was wondering if someone here could verify that I'm going
>> about this the right way. Am I missing some configurations?
>>
>> Thanks.
>> Niall
>>
>> ....
>>
>>
>> In AccelECGAppC.nc I added the following to the implementation:
>>
>>      components HplMsp430InterruptC;
>>      AccelECGC.interruptTest ->  HplMsp430InterruptC.Port22;
>>
>>
>> In AccelECGC.nc I added the following three snippets:
>>
>>      uses {
>>         // ... as stock
>>         interface HplMsp430Interrupt as interruptTest;
>>      }
>>
>>
>>      void init() {
>>         // ... as stock
>>
>>         call interruptTest.edge( TRUE );
>>         call interruptTest.clear();
>>         call interruptTest.enable();
>>      }
>>
>>
>>      async event void interruptTest.fired() {
>>         ledsOn ^= 1;
>>
>>         if ( !ledsOn ) {
>>           call Leds.led0On();
>>           call Leds.led1On();
>>         } else {
>>           call Leds.led0Off();
>>           call Leds.led1Off();
>>         }
>>
>>         atomic call interruptTest.clear();
>>      }
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Shimmer-users mailing list
>> [email protected]
>> https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.1913 / Virus Database: 2114/4873 - Release Date: 03/15/12
>
> _______________________________________________
> Shimmer-users mailing list
> [email protected]
> https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1913 / Virus Database: 2114/4873 - Release Date: 03/15/12

_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users

Reply via email to