Help with first time use of PCINT (yeah, it isn't working :) )

Hello,
I'm using an UNO R3 Plus and am trying to use a pin change interrupt for triggering an LED. Can you give me an idea of what I am doing wrong here? The LED isn't turning on, leading me to believe the interrupt isn't working. If I put the code from the interrupt into loop(), it works.

const int buttonPin = 5;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

boolean playMode = 0; 

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);   

  cli();          // disable global interrupts
  PCMSK0 |= 1<<PCINT5;
  PCICR |= 1<<PCIE0;
  sei();
}

//Interrupt Service Routine (ISR)
ISR(PCINT0_vect) {
  checkMode();
}

void checkMode() {
playMode = digitalRead(buttonPin);
  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (playMode == HIGH) {     
    // turn LED on:    
    digitalWrite(ledPin, HIGH);  
  } 
  else {
    // turn LED off:
    digitalWrite(ledPin, LOW); 
  }
}

void loop(){
}

Thanks

You haven't shown your wiring diagram. PCINT5 seems to be Arduino pin D13.

...R

Robin2:
You haven't shown your wiring diagram. PCINT5 seems to be Arduino pin D13.

...R

Sorry about that. Don't have a schematic at the moment but you bring up a good point. I changed it to D9 ad got it to work. The error was I forgot how arduino mapped the digital inputs.

Thanks!@

Yes the PCINT0 is port B (D8..D15), PCINT1 is port C (analog ) and PCINT2 is port D (D0..D7)