[Tinyos-help] How to use low level interrupt

Li, Zhen Li zhen.li at okstate.edu
Wed Nov 5 14:34:02 PST 2008


Hi

Currently I'm using IRIS and a MDA100CB board. I want to use the INT3 on the MDA100CB and I think that the INT3 in the MDA100CB is connected to the INT3 of the Atmega1281 on IRIS. I want to trigger the interrupt in a rising edge and for test, I have a 3.3k resistor between INT3 and GND on MDA100, VCC will touch INT3 to simulate a button event. My codes are as:

In the init:

command result_t StdControl.init() {
  ...
  sbi(EICRA,ISC31);
  sbi(EICRA,ISC30);
  sbi(EIMSK,INT3);
  ...
}

then I have:

TOSH_SIGNAL(SIG_INTERRUPT3){
   post button();
  }

The task button() is as:

task void button(){
   sbi(EIFR,INTF3);
   call Leds.yellowToggle();
  }

There's no error from make. If everything works well, by touching the VCC to INT3, I should be able to see the yellow LED toggle. However, this didn't happen. So what's the correct way to use an external interrupt on IRIS (basically it is similar to MicaZ)?

Thanks!

Zhen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20081105/fdd9e98f/attachment.htm 


More information about the Tinyos-help mailing list