Go Down

Topic: __RXPIN__ issue for gsm shield (Read 659 times) previous topic - next topic


Hi All,

I am making a project using with arduino robot. I want to control my arduino on the broadband network so ı was buy a arduino gsm shield for this.

I was seem some error message while example gsm code compiling on the arduino ide. Those errors are as below;

Code: [Select]

digitalPinToPCICR' was not declared in this scope
     if (digitalPinToPCICR(__RXPIN__))

I was found __RXPIN__ variable in the GSM3IO.h but I dont know which pins can ı use there ?

How can ı resolve this problem ? I need your help for about this.

My Robot is;

Using GSM Shield is;

Using example code is;



is there any comment for about this ?


Guys, This topic is up-to-date. I am waiting your advices.


Nov 26, 2015, 03:44 am Last Edit: Nov 26, 2015, 03:48 am by MorganS
Well, thanks to the Arduino copyright problems, I can't see the products page that you linked. I'm in the USA so it forces me to see the USA version of the store, which doesn't seem to have the GSM shield listed. (I am pleased to see that it lists the Teensy3.2 right under the Uno.)

Anyway... that function (macro actually) digitalPinToPCICR() is defined in the variant.h file for each individual type of Arduino board. The mapping of pin to interrupt is different for each different processor, you see. But maybe it's missing for the Arduino Robot board?

I'm running Arduino 1.6.2 and I've got two "boards" for the robot. Both of them have the same error. At least the problem is reproducible. Here's the code I'm using to show the error. This is the complete sketch. It's not intended to do anything except be compiled.

Code: [Select]
void setup() {
  // put your setup code here, to run once:
  volatile uint8_t* x = digitalPinToPCICR(2);

void loop() {
  // put your main code here, to run repeatedly:


I'll look into the variant file for the robot board next. Stand by...
"The problem is in the code you didn't post."


Strange. The Arduino Robot uses the same processor as the Leonardo and the Mini. All the pin mappings seem to be identical, so why did they "forget" to copy that part over?

Try this... put the code below into your file, above any #include lines. See if that fixes the problem.
Code: (Copied out of Arduino Leonardo pins_arduino.h) [Select]
#define digitalPinToPCICR(p)    ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17)7 || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
#define digitalPinToPCICRbit(p) 0
#define digitalPinToPCMSK(p)    ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0))
#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4))))))

If that does fix it, then you can proceed with your project. If you want to make it a more permanent fix, then put those lines into your own pins_arduino.h file, which is unfortunately rather deeply buried in the Arduino installation on your computer.

The GSM shield is using software serial. On the Micro/Leonardo/Robot, you can use hardware serial instead. That may avoid a few problems. That processor only has a restricted list of pins available to be used for the receive function of software serial. Most other Arduinos have no restriction.

I think your next problem is going to be the GSM shield is using a pin that the Robot can't use for SoftwareSerial. You can only have Rx on pins 8, 9, 10, 11, 14, 15, 16 and it seems like most of those are already used on the Robot.
"The problem is in the code you didn't post."

Go Up