external interupt ISR executed by touching the pin

hi i am new to arduino. I am using uno r3 board and connected two sensor to pin no-2 and pinno-3 of uno board. my purpose is to run two isr inthe external interupt event.

but even i dont connect the sensor the isr is executed by touching the pin. is it the normal operation of arduino.i have pulled up the pin to avoid noise.

code...

volatile bool GOT_START_PULSE;
volatile bool GOT_STOP_PULSE;
void setup() {

pinMode(2,INPUT_PULLUP);
pinMode(3,INPUT_PULLUP);

noInterrupts();
attachInterrupt(0,starttimer,FALLING);
attachInterrupt(1,stoptimer,FALLING);
interrupts();

}

void starttimer(){
GOT_START_PULSE = 1;
}
void stoptimer(){

GOT_STOP_PULSE=1;

}

void loop() {
if (GOT_START_PULSE == 1) {
Serial.print("GOTSTARTPULSE");
}
if (GOT_STOP_PULSE == 1) {
Serial.print("GOTSTOTPULSE");
}

}

Please edit your post, select the code, and put it between [code] ... [/code] tags.

You can do that by hitting the "Code" icon above the posting area. It is the first icon, with the symbol: </>

Please use code tags.

Read this before posting a programming question

How to use this forum

but even i dont connect the sensor the isr is executed by touching the pin. is it the normal operation of arduino.i have pulled up the pin to avoid noise.

That is perfectly normal for any processor. A "floating" pin has an undefined value.

With input pullups enabled, it's not really floating. But the internal resistor is of a high enough impedance that touching it with your finger can couple mains frequency and other interference into the input. So you will get the same effect.

Oh, OK, I missed that. Probably because it wasn't in code tags!

You may want to cancel the pending interrupt as described on that page.

EIFR = bit (INTF0);  // clear flag for interrupt 0
EIFR = bit (INTF1);  // clear flag for interrupt 1