Arduino pro micro: 'PCIE1' was not declared in this scope

Hi all,

please help.

I try to compile the code

PCICR=1<<PCIE1; //enable interrupt PCINT

PCMSK1=(1<<PCINT9)|(1<<PCINT10);// As А1,A2 signal raise interrupt

and raised the error

C:\Users\serhi\OneDrive\hobbi\Projects\th3\sketch_apr01a\sketch_apr01a.ino: In function ‘void setup()’:
sketch_apr01a:169:10: error: ‘PCIE1’ was not declared in this scope
PCICR=1<<PCIE1; //enable interrupt PCINT
^~~~~
C:\Users\serhi\OneDrive\hobbi\Projects\th3\sketch_apr01a\sketch_apr01a.ino:169:10: note: suggested alternative: ‘ICIE1’
PCICR=1<<PCIE1; //enable interrupt PCINT
^~~~~
ICIE1
sketch_apr01a:170:1: error: ‘PCMSK1’ was not declared in this scope
PCMSK1=(1<<PCINT9)|(1<<PCINT10);// As А1,A2 signal raise interrupt
^~~~~~
C:\Users\serhi\OneDrive\hobbi\Projects\th3\sketch_apr01a\sketch_apr01a.ino:170:1: note: suggested alternative: ‘PCMSK0’
PCMSK1=(1<<PCINT9)|(1<<PCINT10);// As А1,A2 signal raise interrupt
^~~~~~
PCMSK0
sketch_apr01a:170:12: error: ‘PCINT9’ was not declared in this scope
PCMSK1=(1<<PCINT9)|(1<<PCINT10);// As А1,A2 signal raise interrupt
^~~~~~
C:\Users\serhi\OneDrive\hobbi\Projects\th3\sketch_apr01a\sketch_apr01a.ino:170:12: note: suggested alternative: ‘PCINT0’
PCMSK1=(1<<PCINT9)|(1<<PCINT10);// As А1,A2 signal raise interrupt
^~~~~~
PCINT0
sketch_apr01a:170:24: error: ‘PCINT10’ was not declared in this scope
PCMSK1=(1<<PCINT9)|(1<<PCINT10);// As А1,A2 signal raise interrupt
^~~~~~~
C:\Users\serhi\OneDrive\hobbi\Projects\th3\sketch_apr01a\sketch_apr01a.ino:170:24: note: suggested alternative: ‘PCINT0’
PCMSK1=(1<<PCINT9)|(1<<PCINT10);// As А1,A2 signal raise interrupt
^~~~~~~
PCINT0
exit status 1
‘PCIE1’ was not declared in this scope

Arduino IDE 1.8.19, SparkFun AVR boards 1.1.13

It works without any problem for Arduino Nano board.

Thanks!

Serhii

UNO and Nano both are based on Atmega328P. Pro Micro is based on atmega32u4. So, register names are different. atmega32u4 has only one Pin Change Interrupt Control Register - PCICR. It has a bit named PCIE0. There is no PCIE1 in it. So, you have to change your code accordingly.

https://ww1.microchip.com/downloads/en/ … asheet.pdf