[Tinyos-help] TinyOS MICAz GpioInterrupt

Andres Vahter andres.vahter at gmail.com
Wed Jul 22 07:20:20 PDT 2009


I'm also playng with interrupts on Iris and micaz. I checked /tests/ 
telosb UserButton example and http://tinyos.cvs.sourceforge.net/*checkout*/tinyos/tinyos-2.x/doc/html/tep109.html
I just need to register an interrupt on the pin Int0 - so UserButton  
example seems to be overkill for that job.
I came up with that:

------------TestAppNodeC.nc------------------------------
-----------------------------------------------------------
configuration TestAppNodeC {}
implementation {
   components TestNodeC, MainC, LedsC;
   components HplAtm128InterruptC;	//iris doesn't have GpioInterruptC

   TestNodeC.Boot -> MainC;
   TestNodeC.Leds -> LedsC;

   TestNodeC.Interrupt -> HplAtm128InterruptC.Int0;
}


------------TestNodeC.nc------------------------------
-----------------------------------------------------------
module TestNodeC {
	uses interface Boot;
	uses interface Leds;
	uses interface HplAtm128Interrupt as Interrupt;

}
implementation {
	
	event void Boot.booted() {
		call Interrupt.edge(FALSE);
		call Interrupt.enable();
	}

	async event void Interrupt.fired(){
		call Leds.led0Toggle();
	}
.....................

There seems to be something wrong because, led0 is always on. (I'm  
connecting gnd and Int0 pin on mda100 to make interrupt)
Could someone take a look and point out what should I change in order  
to get it work on Iris and micaz.

Andres Vahter



More information about the Tinyos-help mailing list