Pinouts

The Grand Central M4 is chock-full of microcontroller goodness. There's also a TON of pins and ports. We'll take you a tour of them now!

Power Connections

There's a lot of ways to power the Grand Central M4 Express, and a lot of ways to get power out as well.

There are two primary ways to power the Grand Central:

  • Through the Micro USB port up at the top left
  • Through the DC jack at the bottom left

The MicroUSB jack provides 5V at 500mA or so, there is a fuse that will shut off temporarily when more than 1000mA is drawn, this is to protect a computer USB port. You can plug this into any computer or USB charger with a USB cable. You can draw up to 500mA between the Vin, 5V and 3.3V supplies (combined).

The DC Jack is a 5.5mm/2.1mm center-positive DC connector, which is the most common available. Provide about 6V-12V here to power the Metro. There is no fuse on this connection so you can draw more current, up to 800mA between the 5V and 3.3V supplies, and 2A from Vin.

Onboard regulators take the USB or DC power and linearly convert it to 3.3V and 5V:

  • 3V - this is the output from the 3.3V regulator, it can supply 500mA peak
  • 5V - this is the output from the 5V regulator (when DC jack is used), or from USB. It can supply ~500mA peak from USB and ~800mA peak from DC
  • GND - this is the common ground for all power and logic
  • Vin - this is the higher of the DC jack or USB voltage. So if the DC jack is plugged in and 9V, Vin is 9V. If only USB connected, this will be 5V.

There is also an on/off switch. This switch is only for the DC jack and does not affect powering via USB

LEDs

There are four LEDs:

  • ON - Green power LED for 5V rail, will be lit whenever there's 5V power 
  • TX - Yellow USB serial data transmitted LED
  • RX - Yellow USB serial received LED
  • L - Red LED connected to D13

NOTE

On early versions of the board the status LEDs were mislabeled. In this image, the yellow text is the correct labeling.

Logic Pins

This is the general purpose I/O pin set for the microcontroller.
All logic is 3.3V

There are so many options for PWM! You can use any of the following pins:

  • A1, A2, A12, A15.
  • D2-D9, D11, D13-D45, D48, D50-D53.
  • MISO, MOSI, SCK, SCL, SDA.

Let's take a look at all the pin options!

Top Row

  • SDA - the I2C (Wire) data pin. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup. This pin is the same as D20
  • SCL - the I2C (Wire) clock pin. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup. This pin is the same as D21
  • #2 through #13 - These are general purpose GPIO.
  • #13 - GPIO #13 and is connected to the red LED marked L (see note below) next to the USB jack. Also PWM output.
  • #0 / RX - GPIO #0, also receive (input) pin for Serial1 (hardware UART) unlike the original Mega this is not used by the USB-to-Serial chip so its free to use
  • #1 / TX - GPIO #1, also transmit (output) pin for Serial1 (hardware UART) unlike the original Mega this is not used by the USB-to-Serial chip so its free to use
  • #14 / TX3 - GPIO #14, to maintain compatibility with the Mega pinout this can also be a Serial TX (on SERCOM5)
  • #15 / RX3 - GPIO #15, to maintain compatibility with the Mega pinout this can also be a Serial RX (on SERCOM5)
  • #16 / TX2 - GPIO #16, to maintain compatibility with the Mega pinout this can also be a Serial TX (on SERCOM1)
  • #17 / RX2 - GPIO #17, to maintain compatibility with the Mega pinout this can also be a Serial RX (on SERCOM1)
  • #18 / TX1 - GPIO #18, to maintain compatibility with the Mega pinout this can also be a Serial TX (on SERCOM4)
  • #10 / RX1 - GPIO #19, to maintain compatibility with the Mega pinout this can also be a Serial RX (on SERCOM4)
  • #20 / SDA - GPIO #20, and also I2C (Wire) data pin - This is the same as the SDA above
  • #21 / SCL - GPIO #21, and also I2C (Wire) clock pin - This is the same as the SCL above. The original Mega had this as a separate I2C port but we have lots of SERCOMs and to keep things simple, we tied them together

Bottom Row

  • A0 - This pin is analog input  A0 but is also an analog output due to having a DAC (digital-to-analog converter). This is the first DAC, and is 'independent' of A1. You can set the raw voltage to anything from 0 to 3.3V, unlike PWM outputs, this is a true analog output
  • A1 - This pin is analog input  A1 but is also an analog output due to having a DAC (digital-to-analog converter). This is the second DAC, and is 'independent' of A0. You can set the raw voltage to anything from 0 to 3.3V, unlike PWM outputs this is a true analog output.
  • A2 through A15 - These are each analog input as well as digital I/O pins.

Middle

  • SCK/MOSI/MISO - These are the hardware SPI pins, are are connected to the 2x3 header in the middle of the board. you can use them as everyday GPIO pins (but recommend keeping them free as they are best used for hardware SPI connections for high speed.)

  • 5V - this a 5 volt pin and not at 3.3V like the logic level of the digital pins. 

Right Side

  • #22 through #53 - These are general purpose GPIO.

However, some of them are also other things!

  • #50 / MISO - This is the same as the header in the middle of the board when used for SPI
  • #51 / MOSI -This is the same as the header in the middle of the board when used for SPI
  • #52 / SCK -This is the same as the header in the middle of the board when used for SPI
  • #53 / SS - This is just named SS for back-compatibility with the Mega's SPI slave-select pin.

These pins are available in CircuitPython under the board module. Names that start with # are prefixed with D and other names are as is. So #0 / RX above is available as board.D0 and board.RX for example.

Parallel Capture Peripheral

There's a 'camera' input peripheral you can use with some camera chips to capture video with 14-bit data width. We thought this was neat so we made sure all those pins were available. Here are the PCC pins (left) and the Grand Central M4 pins it's mapped to. Unlike other peripherals, you cannot mux these signals to other pins!

This list is organised as PCC Pin: #GC Pin.

  • DEN1: #26
  • DEN2: #27
  • CLK: #28
  • XCLK: #29
  • D0: #37
  • D1: #36
  • D2: #35
  • D3: #34
  • D4: #33
  • D5: #32
  • D6: #31
  • D7: #30
  • D8: #39
  • D9: #38
  • D10: #41
  • D11: #40
  • D12: #43
  • D13: #42

I2S Pins

The following are the pins corresponding to the I2S capabilities of the M4:

  • I2SMCK0: # 15
  • I2SFS0: #33
  • I2SSCK0: #14
  • I2SSDO: #32
  • I2SSDI: #31

QSPI Flash and NeoPixel

As part of the 'Express' series of boards, the Grand Central M4 Express is designed for use with CircuitPython. To make that easy, we have added two extra parts to this Grand Central M4: a NeoPixel (RGB LED) and an 8 MB QSPI (Quad SPI) Flash chip.

The NeoPixel is connected to pin #88 in Arduino, so just use our NeoPixel library and set it up as a single-LED strand on pin 88. In CircuitPython, the NeoPixel is board.NEOPIXEL and the library for it is here and in the bundle. The NeoPixel is powered by the 3.3V power supply but that hasn't shown to make a big difference in brightness or color. The NeoPixel is also used by the bootloader to let you know if the device has enumerated correctly (green) or USB failure (red). In CircuitPython, the LED is used to indicate the runtime status.

The QSPI Flash is connected to 6 pins that are not brought out on the GPIO pads. This way you don't have to worry about the SPI flash colliding with other devices on the main SPI connection.

QSPI is neat because it allows you to have 4 data in/out lines instead of just SPI's single line in and single line out. This means that QSPI is at least 4 times faster. But in reality is at least 10x faster because you can clock the QSPI peripheral much faster than a plain SPI peripheral

However, the QSPI port is not also on an SERCOM. So, you have to either use the QSPI peripheral or bitbang SPI if you want to talk to the chip. We have an Arduino library here which provides QSPI interfacing for Arduino. In CircuitPython, the QSPI flash is used natively by the interpreter and is read-only to user code, instead the Flash just shows up as the writable disk drive!

Micro SD Card

We've included a micro SD card slot on this board!

This is also on a separate SPI port, so it doesn't collide with the SPI header/port used for other devices. In Arduino this is called SPI1 and by default, the SD library will know to use this for SD card interfacing. So, if you have a shield with an SD card slot, you won't be able to use that SD card connection! The library will always use the onboard SD card socket instead. The CS pin can be referred to by SDCARD_SS_PIN

Using an SD card with CircuitPython is super simple. We've written a quick demo that uses the temperature sensor built into the microcontroller to log temperature to a file on the SD card. For more details, check out the explanation in the SD card guide.

Insert and SD card into the slot. Copy the following code to your code.py file on your CIRCUITPY drive:

import time
import adafruit_sdcard
import microcontroller
import board
import busio
import digitalio
import storage

# Setup the little red LED on D13
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT

# Connect to the card and mount the filesystem.
spi = busio.SPI(board.SD_SCK, board.SD_MOSI, board.SD_MISO)
cs = digitalio.DigitalInOut(board.SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")

print("Logging temperature to SD card")
# We're going to append to the file
while True:
    # Open file for append
    with open("/sd/temperature.txt", "a") as file:
        led.value = True  # Turn on LED to indicate we're writing to the file
        temperature = microcontroller.cpu.temperature
        print("Temperature = %0.1f" % temperature)
        file.write("%0.1f\n" % temperature)
        led.value = False  # Turn off LED to indicate we're done
    # File is saved
    time.sleep(1)

Let it sit for a bit, and then unplug it and remove the SD card. Place the SD card into a reader on your computer to view the temperature.txt file.

Other Pins!

  • RST - this is the Reset pin, tie to ground to manually reset the ATSAMD51, as well as launch the bootloader manually

  • ARef - the analog reference pin. Normally the reference voltage is the same as the chip logic voltage (3.3V) but if you need an alternative analog reference, connect it to this pin and select the external AREF in your firmware. Can't go higher than 3.3V! Note that due to a silicon bug with the DAC, this is default-jumpered to 3.3V - you will have to cut the bottom jumper to disconnect it.

Debug Interface

If you'd like to do more advanced development, trace-debugging, or not use the bootloader, we have the SWD interface exposed.

 

You can use any 2x5 0.05" pitch SWD interface to connect. We suggest a J-Link, it's supported by every IDE/software that can program the ATSAMD51.

SEGGER J-Link EDU - JTAG/SWD Debugger

PRODUCT ID: 1369
The SEGGER J-Link EDU is identical to the more expensive J-Link BASE model except for the terms of use.If...
$69.95
IN STOCK

SEGGER J-Link BASE - JTAG/SWD Debugger

PRODUCT ID: 2209
The SEGGER J-Link BASE is identical to the cheaper J-Link EDU model except for the terms of...
$399.95
IN STOCK

SEGGER J-Link EDU Mini - JTAG/SWD Debugger

PRODUCT ID: 3571
Doing some serious development on any ARM-based platform, and tired of 'printf' plus an LED to debug? A proper JTAG/SWD HW debugger can make debugging more of a pleasure and...
$19.95
IN STOCK

You'll need an adapter and cable to convert the 2x10 JTAG cable to SWD.

10-pin 2x5 Socket-Socket 1.27mm IDC (SWD) Cable - 150mm long

PRODUCT ID: 1675
These little cables are handy when programming or debugging a tiny board that uses 10-pin 1.27mm (0.05") pitch SWD programming connectors. We see these connectors often on ARM...
$2.95
IN STOCK

JTAG (2x10 2.54mm) to SWD (2x5 1.27mm) Cable Adapter Board

PRODUCT ID: 2094
This adapter board is designed for adapting a 'classic' 2x10 (0.1"/2.54mm pitch) JTAG cable to a slimmer 2x5 (0.05"/1.27mm pitch) SWD Cable.  It's helpful for using products like...
$4.95
IN STOCK
This guide was first published on Jan 12, 2019. It was last updated on Jan 12, 2019. This page (Pinouts) was last updated on Aug 17, 2019.