interrupt error while waiting

20 Apr 2010 . Edited: 21 Apr 2010

when the code executes p19 is receiving a low signal. it should wait till a high is sent to p19 and execute the interrupt function 'trigger'. however it won't enter the wait state and i receive the error:

*** assertion failed: base == LPC_GPIO0_BASE || base == LPC_GPIO2_BASE, file src/InterruptIn.cpp, line 41

the low signal is coming from an inverter.. connected to a tsop1236. an oscilloscope confirms that the inverting is provind p19 with a low signal. my code is simple in order to confirm that i understand how an interrupt works. also, as soon as the error message appears in terminal on my pc, the loop L1 = ~L1; does not execute

any help in figuring out why i'm getting an error would be appreciated. thank you.

 

#include "mbed.h"

InterruptIn tsop(p19);

Serial pc(USBTX, USBRX);

DigitalOut L1(LED1);

void trigger(){

pc.printf("\rtriggered!\n\n");

}

int main() {

pc.baud(9600);

pc.printf("\nPress any key when light turns on\r\n");

wait(5);

L1 = 1;

tsop.rise(&trigger);

while(1){

L1=!L1;

wait(.1);

}

}

21 Apr 2010

i realize now that pin 19 and pin 20 do not work with interruptIn. I changed the wiring and it works with no error.

no need to reply to this question. thx