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
_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users