Interrupts on PINs 20,21 blocked on MEGA

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
muh87
 
Posts: 11
Joined: Fri Jul 19, 2013 9:52 pm

Interrupts on PINs 20,21 blocked on MEGA

Post by muh87 »

Hello,
I'm using an Arduino MEGA with 2 Adafruit motor shields v2.
My program does not start after uploading it IF BOTH of the following things are declared in it:
1- One or two of the motor shield is started with the function [board].begin()
2- trying to use one of the external interrupts on PINs 20 or 21.

As far as I know, those are the I2C pins on the MEGA board and the communication with the shields could probably be causing the problem. Is there any way that I could still use the Adafruit shields and taking interrupts from the above mentioned PINs?
Thanks.

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Interrupts on PINs 20,21 blocked on MEGA

Post by adafruit_support_mike »

The Motor Shield does use I2C to communicate with the controller. On the Mega, that's pins 20 and 21.

muh87
 
Posts: 11
Joined: Fri Jul 19, 2013 9:52 pm

Re: Interrupts on PINs 20,21 blocked on MEGA

Post by muh87 »

Thx. I already know that. But I mean that the PINs are still free because the shield is mounted on the arduino, so I thought I could probably still make use of their Interrupt abilities!

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Interrupts on PINs 20,21 blocked on MEGA

Post by adafruit_support_bill »

the PINs are still free because the shield is mounted on the arduino, so I thought I could probably still make use of their Interrupt abilities!
It doesn't work that way. Pins 20 and 21 are directly connected to the SDA and SCL pins. Although the there is nothing physically connected at the pin 20/21 locations, the pins are in use for i2c communication.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”