Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Grand Central M4 ISR available pins
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Grand Central M4 ISR available pins

by psg1908 on Wed Jul 08, 2020 11:58 am

Are the pins available for attaching interrupts the same on the Grand Central M4 as an Arduino Mega (i.e. digital pins 2, 3, 18, 19, 20, 21)? I can't find any mention of interrupts in any of the Grand Central documentation I know of.

psg1908
 
Posts: 4
Joined: Tue Jul 07, 2020 12:28 pm

Re: Grand Central M4 ISR available pins

by oesterle on Wed Jul 08, 2020 3:25 pm

Hi, psg1908!

I'd start with using any of GPIO pins 2 through 13 for interrupts. The Grand Central supports up to 16 separate external interrupts. You should be able to use many of the analog pins, as well, if needed. (See the Pinouts section of the primary guide to identify which pins are not used for other purposes.)

This was also discussed in the Forums thread: Interrupt Pins on the Grand Central M4 Express.

Cheers,

Eric

oesterle
 
Posts: 763
Joined: Tue Sep 17, 2013 11:32 pm

Re: Grand Central M4 ISR available pins

by User_UMjT7KxnxP8YN8 on Wed Jul 08, 2020 3:45 pm

You can find everything you want to know about the ATSAMD51J19A MCU on your board at http://ww1.microchip.com/downloads/en/DeviceDoc/SAM_D5xE5x_Family_Data_Sheet_DS60001507F.pdf

User_UMjT7KxnxP8YN8
 
Posts: 153
Joined: Tue Jul 17, 2018 1:28 pm

Re: Grand Central M4 ISR available pins

by westfw on Thu Jul 09, 2020 12:56 am

It looks like the Adafruit core supports interrupts on any pin.
But you'll need to watch out that you don't try to use two interrupts that cause the SAME external interrupt.

I put together the skeleton of this sketch just recently to look at which pins had PWM. It looks like it works for Interrupts as well...

Code: Select all | TOGGLE FULL SIZE
char buffer[80];
void setup() {
  Serial.begin(9600);
  while (!Serial)
    ;
  for (unsigned int i = 0; i < NUM_DIGITAL_PINS; i++) {
    if (g_APinDescription[i].ulExtInt != NOT_AN_INTERRUPT) {
      sprintf(buffer, "Pin #%d has External Interrupt %2d\n", i, g_APinDescription[i].ulExtInt);
      Serial.print(buffer);
    }
  }
}

void loop() {}

westfw
 
Posts: 1720
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Please be positive and constructive with your questions and comments.