Datasheet

TX and SDA (Digital pins 1 and 20)
analogWrite() PWM range
On AVR, if you set a pin's PWM with analogWrite(pin, 255) it will turn the pin fully HIGH. On the ARM cortex, it will set it
to be 255/256 so there will be very slim but still-existing pulses-to-0V. If you need the pin to be fully on, add test code
that checks if you are trying to analogWrite(pin, 255) and, instead, does a digitalWrite(pin, HIGH)
analogWrite() DAC on A0
If you are trying to use analogWrite() to control the DAC output on A0, make sure you do not have a line that sets the
pin to output.
Remove
: pinMode(A0, OUTPUT) .
Missing header files
there might be code that uses libraries that are not supported by the M0 core. For example if you have a line with
#include <util/delay.h>
you'll get an error that says
fatal error: util/delay.h: No such file or directory
#include <util/delay.h>
^
compilation terminated.
Error compiling.
In which case you can simply locate where the line is (the error will give you the file name and line number) and 'wrap
it' with #ifdef's so it looks like:
The above will also make sure that header file isn't included for other architectures
If the #include is in the arduino sketch itself, you can try just removing the line.
Bootloader Launching
For most other AVRs, clicking reset while plugged into USB will launch the bootloader manually, the bootloader will
time out after a few seconds. For the M0, you'll need to
double click
the button. You will see a pulsing red LED to let
you know you're in bootloader mode. Once in that mode, it wont time out! Click reset again if you want to go back to
launching code
Aligned Memory Access
This is a little less likely to happen to you but it happened to me! If you're used to 8-bit platforms, you can do this nice
thing where you can typecast variables around. e.g.
uint8_t mybuffer[4];
float f = (float)mybuffer;
#if !defined(ARDUINO_ARCH_SAM) && !defined(ARDUINO_ARCH_SAMD) && !defined(ESP8266) && !defined(ARDUINO_ARCH_STM32F2)
#include <util/delay.h>
#endif
© Adafruit Industries
https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-
circuitpython
Page 41 of 199