<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#3333FF" bgcolor="#FFFFCC">
<div class="moz-cite-prefix">I just got through reading an article
on the Feather M0 (I just bought 3 of them for experimenting on)
and indeed you are only going to get 1 interrupt to work with the
default setup in some cases.<br>
<br>
Even using the TimerOne library, both the author and the others on
the forums state that it could be incompatible with SAMD
architecture.<br>
<br>
The issue is that some interrupts are shared between pins. If you
go look at the pinout page for the M0 on Adafruit's site, the
image which shows the layout and pin information included info on
the interrupts: <a moz-do-not-send="true"
href="https://learn.adafruit.com/adafruit-feather-m0-basic-proto/pinouts">https://learn.adafruit.com/adafruit-feather-m0-basic-proto/pinouts</a>
The following pins share external interrupts in the zero variant:
<ul>
<li><code>EXTERNAL_INT_2</code>: A0, A5, 10</li>
<li><code>EXTERNAL_INT_4</code>: A3, 6</li>
<li><code>EXTERNAL_INT_5</code>: A4, 7</li>
<li><code>EXTERNAL_INT_6</code>: 8, SDA</li>
<li><code>EXTERNAL_INT_7</code>: 9, SCL</li>
<li><code>EXTERNAL_INT_9</code>: A2, 3</li>
<li><code>EXTERNAL_INT_10</code>: TX, MOSI</li>
<li><code>EXTERNAL_INT_11</code>: RX, SCK</li>
</ul>
<br>
Check out section 20 "EIC - External Interrupt Controller" of the
datasheet: <a moz-do-not-send="true"
href="https://cdn-learn.adafruit.com/assets/assets/000/030/130/original/atmel-42181-sam-d21_datasheet.pdf?1453847579">https://cdn-learn.adafruit.com/assets/assets/000/030/130/original/atmel-42181-sam-d21_datasheet.pdf?1453847579</a>
for the low-level setup and using the external interrupts.<br>
<br>
One poster complained "the code that Adafruit provides for their
Feather M0 is clearly not properly setting the processor up for
interrupts".<br>
<br>
I hope some of this helps.<br>
<br>
- sgh<br>
<br>
On 11/07/2017 08:15 AM, Alex Davis via TriEmbed wrote:<br>
</div>
<blockquote type="cite"
cite="mid:5A0A63AD-FAA6-4DCE-B9DA-01BE2C98E6B1@matrixwide.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Anyone use the ATSAMD21G18 M0 aka Arduino Zero or Adafruit Feather
M0? I’m having issues with getting more than one interrupt
attached using the Arduino IDE.
<div class=""><br class="">
</div>
<div class="">Basically, I need the thing to sleep and be woken up
by either having my LIS3DH accelerometer raise a pin (based on a
threshold) or by the user pressing a button. I can get one or
the other working but not both. If I try to attach a second
interrupt, even after having detached the first, I get a hard
crash.</div>
<div class=""><br class="">
</div>
<div class="">The Adafruit forums haven’t been any help. Most
likely this is going to require actual setting of registers by
hand, but does anyone have any M0 interrupt experience?</div>
<div class=""><br class="">
</div>
<div class="">By the way, I did consider using something like a
32u4 (which I know would work regarding interrupts), but the
issue is in the feather form factor, it doesn’t have interrupt
capable pins assigned to the buttons on the Feather OLED/button
shield I’d like to use. Also, 32u4 lacks an integral RTC, and I
don’t want to stack another shield as that would make it
un-wearable.</div>
<div class=""><br class="">
</div>
<div class="">Maybe I need to get an actual Arduino Zero with a
JTAG header and buy something like a Segger J-Link.</div>
</blockquote>
<br>
<pre class="moz-signature" cols="80">--
Scott G. Hall
Raleigh, NC, USA
<a class="moz-txt-link-abbreviated" href="mailto:ScottGHall1@GMail.Com">ScottGHall1@GMail.Com</a></pre>
</body>
</html>