Interrupt prioritizes on Arduino M0 (SAMD21) do they exist?

I have an Arcuino M0 with a MAX31855 Thermocouple breakout board and a SD Card break out board and an external I/O Pin interrupt. Both boards are SPI.

My problem is that periodically I get an extra long clock pulse at the beginning of the MAX31855 read, causing a error in the received data.

The issue appears to be related to exteranl I/O pin interrupts when the SPI bus is trying to write to the SD Card.

I tried wrapping the SD Card writes in noInterrupts() / interrupts() with no change in the situation.

Currently my theory is "the SD Card code enables the interrupts() to do its job, allowing the Ext I/O interrupt to cause an issue."

My question:

All the arduino documentation states there is only one interrupt priority (I think that's what it means). However most of the documentation is for the 328P. Is this true with the SAMD21?

The reason for this question is to see if there is a possibility that another interrupt is serviced while writing to the SD Card.

The next goal is to see if I can disable the external interrupts. I think I can as the SAMD21 talks about a external interrupt controller.



Reference post:

Related post

Yes, the samd21 has multiple interrupt priorities (four, it seems.) The pin interrupts seem to be set to the highest priority.

There's no easy way to get at them from the Arduino IDE, as far as I know, and there's a comment that you shouldn't change the priority of an interrupt after it has been enabled. ( Interrupts and Exceptions (NVIC))

Thanks for the great info :slight_smile: It gives me hope my direction could be fruitful.

Actually I wasn't looking to change the priority of the interrupts. My thought was to mask the external I/O pin interrupts while the SD Card was being written to.