Summary of Contents for Adafruit Feather M4 Express
Page 1
Adafruit Feather M4 Express Created by lady ada Last updated on 2019-03-04 10:41:14 PM UTC...
Page 2
Overview It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox, half bird, OK?) This feather is powered by our new favorite chip, the ATSAMD51J19 - with its 120MHz Cortex M4 with floating point support and 512KB Flash and 192KB RAM.
Page 4
The Feather M4 Express uses the extra space left over to add a Mini NeoPixel, 2 MB SPI Flash storage and a little prototyping space. You can use the SPI Flash storage like a very tiny hard drive. When used in CircuitPython, the 2 MB flash acts as storage for all your scripts, libraries and files.
QSPI Flash and NeoPixel As part of the 'Express' series of boards, the Feather M4 Express is designed for use with CircuitPython. To make that easy, we have added two extra parts to this Feather M4: a mini NeoPixel (RGB LED) and a 2 MB QSPI (Quad SPI) Flash...
Page 25
We will be adding a URL to the new Additional Boards Manager URLs option. The list of URLs is comma separated, and you will only have to add each URL once. New Adafruit boards and updates to existing boards will automatically be picked up by the Board Manager each time it is opened.
Page 26
(https://adafru.it/eSI). If you have multiple boards you want to support, say ESP8266 and Adafruit, have both URLs in the text box separated by a comma (,) Once done click OK to save the new preference settings. Next we will look at installing boards with the Board Manager.
All. You will then be able to select and install the boards supplied by the URLs added to the preferences. Remember you need SETUP the Arduino IDE to support our board packages - see the previous page on how to add adafruit's URL to the preferences Install SAMD Support First up, install the latest Arduino SAMD Boards (version 1.6.11 or later)
Page 28
Make sure you have Type All selected to the left of the Filter your search... box You can type Adafruit SAMD in the top search bar, then when you see the entry, click Install Even though in theory you don't need to - I recommend rebooting the IDE Quit and reopen the Arduino IDE to ensure that all of the boards are properly installed.
Page 30
Select which drivers you want to install, the defaults will set you up with just about every Adafruit board! Click Install to do the installin' Blink Now you can upload your first blink sketch! Plug in the M0 or M4 board, and wait for it to be recognized by the OS (just takes a few seconds). It will create a...
Compilation Issues If you get an alert that looks like Cannot run program "{runtime.tools.arm-none-eabi-gcc.path}\bin\arm-non-eabi-g++" Make sure you have installed the Arduino SAMD boards package, you need both Arduino & Adafruit SAMD board packages Manually bootloading If you ever get in a 'weird' spot with the bootloader, or you have uploaded code that crashes and doesn't auto-reboot into the bootloader, click the RST button twice (like a double-click)to get back into the bootloader.
Page 33
The fix for this issue is to make sure Adafruit's custom udev rules are applied to your system. One of these rules is made to configure modem manager not to touch the Feather board and will fix the programming difficulty issue.
Installing Mu Editor Mu is a simple code editor that works with the Adafruit CircuitPython boards. It's written in Python and works on Windows, MacOS, Linux and Raspberry Pi. The serial console is built right in so you get immediate feedback from your...
Page 40
"gear" icon. If the mode says "Microbit" or something else, click on that and then choose "Adafruit" in the dialog box that appears. Mu attempts to auto-detect your board, so please plug in your CircuitPython device and make sure it shows up as a CIRCUITPY drive before starting Mu Now you're ready to code! Lets keep going..
Instead, you can find example code in the guides for your board that depends on external libraries. Some of these libraries may be available from us at Adafruit, some may be written by community members! Either way, as you start to explore CircuitPython, you'll want to know how to get libraries on board.
Did you install the Adafruit Windows Drivers package by mistake? You don't need to install this package on Windows 10 for most Adafruit boards. The old version (v1.5) can interfere with recognizing your device. Go to Settings -> Apps and uninstall all the "Adafruit" driver programs.
Page 83
Now install the new 2.3.0.0 (or higher) Adafruit Windows Drivers Package: https://adafru.it/AB0 https://adafru.it/AB0 When running the installer, you'll be shown a list of drivers to choose from. You can check and uncheck the boxes to choose which drivers to install.
CircuitPython RGB Status Light The Feather M0 Express, Feather M4 Express, Metro M0 Express, Metro M4 Express, ItsyBitsy M0 Express, ItsyBitsy M4 Express, Gemma M0, and Trinket M0 all have a single NeoPixel or DotStar RGB LED on the board that indicates the status of CircuitPython.
Page 89
Finder because it will still create these hidden extended attribute files in some cases (for files downloaded from the internet, like Adafruit's modules). To copy a file or folder use the -X option for the cp command in a terminal. For example to copy a foo.mpy file to the board use a command like: cp -X foo.mpy /Volumes/CIRCUITPY...
Adafruit CircuitPython community. We're going to highlight some of the many ways you can be a part of it! Adafruit Discord The Adafruit Discord server is the best place to start.
Whether your hardware is giving you issues or your code doesn't seem to be working, the forums are always there for you to ask. You need an Adafruit account to post to the forums. You can use the same account you use to order from Adafruit.
Page 100
Note: To "comment out" a line, put a # and a space before it. To "uncomment" a line, remove the # + space from the beginning of the line. For Feather M0 Express and Feather M4 Express, comment out (and/or switch = DigitalInOut(board.D2)
Page 102
Use alligator clips to connect your switch to your Gemma M0! Feather M0 Express and Feather M4 Express D5 is labeled "5" and connected to the blue wire on the board. D13 is labeled "#13" and is located next to the USB micro port.
Page 107
(https://adafru.it/AMa) on the main guide. Feather M0 Express and Feather M4 Express A1 is located along the edge opposite the battery connector. There are multiple ground pins. 3V is located along the same edge as A1, and is next to the reset button.
Page 108
ItsyBitsy M0 Express and ItsyBitsy M4 Express A1 is located in the middle of the board, near the "A" in "Adafruit". Ground is labled "G" and is located next to "BAT", near the USB Micro port. 3V is found on the opposite side of the USB port from Ground, next to RST.
Express boards like the Circuit Playground Express, Metro M0 Express, ItsyBitsy M0 Express, ItsyBitsy M4 Express, Metro M4 Express, Feather M4 Express, or Feather M0 Express have more code space and can perform audio playback capabilities via the DAC. Gemma M0 and Trinket M0 cannot!
Page 111
A0 is located between GND and A1 on the opposite side of the board from the battery connector, towards the end with the Reset button. Feather M4 Express A0 is located between GND and A1 on the opposite side of the board from the battery connector, towards the...
Page 112
ItsyBitsy M0 Express A0 is located between VHI and A1, near the "A" in "Adafruit", and the pin pad has left and right white parenthesis markings around it. ItsyBitsy M4 Express A0 is located between VHI and A1, and the pin pad has left and right white parenthesis markings around it.
Page 115
To use with the Metro M4 Express, ItsyBitsy M4 Express or the Feather M4 Express, you must comment out the line and uncomment piezo = pulseio.PWMOut(board.A2, duty_cycle=0, frequency=440, variable_frequency=True) line. A2 is not a piezo = pulseio.PWMOut(board.A1, duty_cycle=0, frequency=440, variable_frequency=True) supported PWM pin on the M4 boards! Remember: To "comment out"...
Page 117
To use A1, comment out the current pin setup line, and uncomment the line labeled for the M4 boards. See the details above! Feather M4 Express has PWM on the following pins: A1, A3, SCK, D0, RX, D1, TX, SDA, SCL, D4, D5, D6, D9, D10, D11, D12, D13.
Page 122
For the Metro M4 Express, ItsyBitsy M4 Express and the Feather M4 Express, connect the ground wire to any G or GND, the power wire to USB or 5V, and the signal wire to A1. Servo Code Here's an example that will sweep a servo connected to pin A2 from 0 degrees to 180 degrees and back:...
Page 124
Trinket M0, Gemma M0, ItsyBitsy M0 Express, and ItsyBitsy M4 Express each have an onboard Dotstar LED, so no changes are needed to the initial version of the example. Feather M0 Express, Feather M4 Express, Metro M0 Express, Metro M4 Express, and Circuit Playground Express each have an onboard NeoPixel LED, so you must comment out...
On Gemma M0 and Circuit Playground Express this is the Vout pad - that pad has direct power from USB or the battery, depending on which is higher voltage. On Trinket M0, Feather M0 Express, Feather M4 Express, ItsyBitsy M0 Express and ItsyBitsy M4 Express the USB or BAT pins will give you direct power from the USB port or battery.
On Gemma M0 and Circuit Playground Express this is the Vout pad - that pad has direct power from USB or the battery, depending on which is higher voltage. On Trinket M0, Feather M0 Express, Feather M4 Express, ItsyBitsy M0 Express and ItsyBitsy M4 Express the USB or BAT pins will give you direct power from the USB port or battery.
Page 143
Connect A1/D2 on the Gemma to TX on the GPS. Connect A2/D0 on the Gemma to RX on the GPS. Feather M0 Express and Feather M4 Express Connect USB on the Feather to VIN on the GPS. Connect GND on the Feather to GND on the GPS.
Page 147
Check out the list below for a diagram of your specific board! Be aware that the Adafruit microcontroller boards do not have I2C pullup resistors built in! All of the Adafruit breakouts do, but if you're building your own board or using a non-Adafruit breakout, you must add 2.2K-10K ohm pullups on both SDA and SCL to the 3.3V.
Page 149
Connect A1/D2 on the Gemma to SCL on the TSL2561. Connect A2/D0 on the Gemma to SDA on the TSL2561. Feather M0 Express and Feather M4 Express Connect USB on the Feather to VIN on the TSL2561. Connect GND on the Feather to GND on the TSL2561.
For Gemma M0, Trinket M0, Metro M0 Express, Metro M4 Express, ItsyBitsy M0 Express and ItsyBitsy M4 Express, no changes to the initial code are needed. For Feather M0 Express and Feather M4 Express, comment out , and switch = digitalio.DigitalInOut(board.D2) uncomment switch = digitalio.DigitalInOut(board.D5)
3.x bundle (https://adafru.it/ABU). We will soon stop providing the 2.x bundle as an automatically created download on the Adafruit CircuitPython Bundle repo. If you must continue to use 2.x, you can still download the 2.x version of from the 2.x release of mpy-cross CircuitPython on the CircuitPython repo and create your own 2.x compatible .mpy library files.
This is an information page for advanced users who are curious how we get code from your computer into your Express board! Adafruit SAMD21 (M0) and SAMD51 (M4) boards feature an improved bootloader that makes it easier than ever to flash different code onto the microcontroller. This bootloader makes it easy to switch between Microsoft MakeCode, CircuitPython and Arduino.
Linux. Once downloaded, extract the files from the zip and open the command linux line to the directory with bossac For example here's the command line you probably want to run: bossac -e -w -v -R ~/Downloads/adafruit-circuitpython-feather_m0_express-3.0.0-adafruit.5.bin This will rase the chip, rite the given file, erify the write and eset the board.
After the file is copied over, the bootloader will be updated and appear again. The INFO_UF2.TXT file should show the newer version number inside. For example: UF2 Bootloader v2.0.0-adafruit.5 SFHWRO Model: Metro M0 Board-ID: SAMD21G18A-Metro-v0 Lastly, reload your code from Arduino or MakeCode or flash the latest CircuitPython core (https://adafru.it/tBa).
Need help?
Do you have a question about the Feather M4 Express and is the answer not in the manual?
Questions and answers