Forums

AVR ATMEGA88 PCINT PROBLEM

Started by Rohan February 26, 2007
Hi,

I am trying to use the PCINT0 interrupt on the Atmega88 chip but an
unable to get it working.
i want it to work for pin number 12, 13 and 14 ie PCINT0, PCINT1 and
PCINT2 respectively.

i am initializing it as

main(){
PCIFR = 0X01;
PCMSK0 = 0X07;
Sei();
}

AND

ISR(PCINT0_vect){
	send_byte(1);
	}

The ISR is not getting fired using only this code. Am i missing out on
some initialization. Kindly help me out.

Thanks,
Rohan.

On Feb 26, 1:45 pm, "Rohan" <rohans...@gmail.com> wrote:
> Hi, > > I am trying to use the PCINT0 interrupt on the Atmega88 chip but an > unable to get it working. > i want it to work for pin number 12, 13 and 14 ie PCINT0, PCINT1 and > PCINT2 respectively. > > i am initializing it as > > main(){ > PCIFR = 0X01; > PCMSK0 = 0X07; > Sei(); > > } > > AND > > ISR(PCINT0_vect){ > send_byte(1); > } > > The ISR is not getting fired using only this code. Am i missing out on > some initialization. Kindly help me out. > > Thanks, > Rohan.
You need to set the interrupt enable bit in the PCICR register, not the PCIFR register.
Thanks a lot. Thats the obvious problem. How small things are
overlooked unless someone else looks at it.