Datasheet

If you have existing sketches and code and you want them to work with the M0 without a
huge find-replace, put
#if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL)
// Required for Serial on Zero based boards
#define Serial SERIAL_PORT_USBVIRTUAL
#endif
right above the first function definition in your code. For example:
AnalogWrite / PWM on Feather/Metro M0
After looking through the SAMD21 datasheet, we've found that some of the options listed in
the multiplexer table don't exist on the specific chip used in the Feather M0.
For all SAMD21 chips, there are two peripherals that can generate PWM signals: The
Timer/Counter (TC) and Timer/Counter for Control Applications (TCC). Each SAMD21 has
multiple copies of each, called 'instances'.
Each TC instance has one count register, one control register, and two output channels.
Either channel can be enabled and disabled, and either channel can be inverted. The pins
connected to a TC instance can output identical versions of the same PWM waveform, or
complementary waveforms.
Each TCC instance has a single count register, but multiple compare registers and output
channels. There are options for different kinds of waveform, interleaved switching,
programmable dead time, and so on.
© Adafruit Industries https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le Page 49 of 238