Hi! I'm running Arduino code on ATmega16 and ATmega32, using Optiboot. It works really well, but today I tried to compile a sketch that included the SoftSerial library. I got this error message:
Build options changed, rebuilding all
/Users/hansi/Documents/Arduino/hardware/DIP-40/avr/libraries/SoftwareSerial/SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':
/Users/hansi/Documents/Arduino/hardware/DIP-40/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:317:36: error: 'digitalPinToPCICR' was not declared in this scope
if (digitalPinToPCICR(_receivePin)) {
^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/interrupt.h:38,
from /Users/hansi/Documents/Arduino/hardware/DIP-40/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:41:
/Users/hansi/Documents/Arduino/hardware/DIP-40/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:358:76: error: 'digitalPinToPCICRbit' was not declared in this scope
*digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
^
/Users/hansi/Documents/Arduino/hardware/DIP-40/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:361:51: error: 'digitalPinToPCMSK' was not declared in this scope
_pcint_maskreg = digitalPinToPCMSK(_receivePin);
^
In file included from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/io.h:99:0,
from /Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/avr/interrupt.h:38,
from /Users/hansi/Documents/Arduino/hardware/DIP-40/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:41:
/Users/hansi/Documents/Arduino/hardware/DIP-40/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:362:60: error: 'digitalPinToPCMSKbit' was not declared in this scope
_pcint_maskvalue = _BV(digitalPinToPCMSKbit(_receivePin));
^
Error compiling.
I've been looking into the error message, and it seems like the pins_arduino.h file for the ATmega16 and ATmega32 don't include the following definitions:
#define digitalPinToPCICR(p)
#define digitalPinToPCICRbit(p)
#define digitalPinToPCMSK(p)
#define digitalPinToPCMSKbit(p)
as far as I can read from the datasheet, the ATmega16/32 don't have PCINT on any pin. Does this mean soft serial cant be used on these microcontrollers? Can the pins_arduino file be modified to get softserial working
I've included the pins_arduino.h file for the ATmega1284p (compiles without any errors) and ATmega32 (compiling errors)
pins_arduino_ATmega32.h (5.06 KB)
pins_arduino_ATmega1284p.h (4.78 KB)