MicroMod Main Board Hookup Guide V2
Introduction
The MicroMod Main Board - Single and Double are specialized carrier boards that allow you to interface a Processor Board with a Function Board(s). The modular system allows you to add an additional feature(s) to a Processor Board with the help of a Function Board(s).
Required Materials
To follow along with this tutorial, you will need the following materials at a minimum. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary.
MicroMod Main Board
To hold the Processor and Function boards, you will need one Main Board. Depending on your application, you may choose to have either one or two Function Boards.
MicroMod Processor Board
There are a variety of MicroMod Processor Boards available to choose from. You will probably want to avoid having the same Processor and Function Board since there is an ESP32 on both types of boards.
MicroMod Function Board
To add additional functionality to your Processor Board, you'll want to include one or two Function Boards when connecting them to the Main Board. Make sure to check out the catalog for other function boards.
Tools
You will need a screw driver to secure the Processor and Function Boards. The MicroMod Screwdriver is an excellent option for those looking for a low cost tool. The SparkFun Mini Screwdriver and Pocket Screwdriver Set can work as well. For users using a microSD card and want to easily read the contents of the memory card, you will need a microSD card adapter or USB reader.
Suggested Reading
If you aren't familiar with the MicroMod ecosystem, we recommend reading here for an overview. We recommend reading here for an overview if you decide to take advantage of the Qwiic connector.
MicroMod Ecosystem | Qwiic Connect System |
If you aren’t familiar with the following concepts, we also recommend checking out a few of these tutorials before continuing. Make sure to check the respective hookup guides for your Processor board and Function Board to ensure that you are installing the correct USB-to-serial converter. You may also need to follow additional instructions that are not outlined in this tutorial to install the appropriate software.
What is an Arduino?
Installing Arduino IDE
How to Install CH340 Drivers
Getting Started with MicroMod
Hardware Overview
The overall functionality of the Single and Double Main Boards are the same. We'll use the Single Main Board more in this section to highlight the features since this is also included in the Double Main Board. We'll switch to the Double Main Board when necessary to highlight the features that are only included in the Double Main Board.
The differences are that the Double Main Board includes:
- 3x switches
- two for the 3.3V power enable pins
- one for the secondary SPI CS pin
- ability to add a second MicroMod Function Board to the mix
- board's width
Main Board - Single V2.1 | Main Board - Double V2.2 |
Revision Changes
The following changes to the Main Board Single V2.1 and Main Board Double V2.2 include:
- Rotate silkscreen for the connectors and a majority of the labels.
- Add TVS diodes for ESD protection on the USB pins.
- Add SHLD jumper to isolate the USB Type C connector's shield pin.
- Add a 5V MEAS PTH jumper as a measurement for 5V.
- Remove the 500mA/100mA selector for the LiPo charge circuit. The board now charges at a default rate of 500mA only.
- Add a DIVIDER jumper to remove the resistor divider that is connected to processor's "BATT_VIN/3" pin for low power applications.
- Add a dedicated 3.3V/500mA voltage regulator for the Qwiic port.
- Add GPIO control of 3.3V voltage regulator (I2C_SCL1-Processor).
- Add a LED for the 3.3V Qwiic port with a QWIIC LED jumper to disable.
- Add a transistor to disable power to the microSD socket (can be controlled using I2C_SCL1-Processor).
- Add multiplexed primary UART pins to send serial data to Function Board(s).
- Add PTH pins for multiplexed UART (Main Board Single v2.1 only).
- Move PWR_EN0 from SDIO_Data2_Processor to PWM1 (Main Board - Single v2.1 only)
- Add two 2.2kΩ I2C pull-ups to the primary I2C pins with jumpers (I2C) to disable.
- Replace male header pins and 2-pin shunt with SMD switches to adjust the Function Board Power enable pins (Main Board - Double v2.2 only).
- Add option to adjust Function Board One's secondary SPI CS pin (i.e. "CS1-processor" and "A1-processor") with a SMD switch (Main Board - Double V2.2 only).
Power
There are two ways to power the Main Boards, Processor Board, and Function Board(s).
- USB
- Single Cell LiPo Battery
It is fine to connect a power source to the USB connector and LiPo battery's JST connector at the same time. The MicroMod Main Board has power-control circuitry to automatically select the best power source.
Power USB
One option of powering the board is through the USB Type C connector. You will need a USB Type C cable to power the board with 5V. Power connected to the board's USB C connector will go through a resettable PTC fuse (rated at 2A max) and then the AP7361C 3.3V voltage regulator (rated at 1A max). The little green component close to the USB connector is the resettable PTC fuse while the square IC is the voltage regulator. The voltage regulator accepts voltages between ~2.2V to 6.0V. For Main Boards V2+, there are now ESD protection diodes (the 6-pin IC next to the fuse) on the USB data lines. There is also now an additional AP7347DQ 3.3V voltage regulator (rated at 500mA) for the Qwiic connectors. The voltage regulator accepts voltages between ~1.7V to 5.5V.
Power LiPo
The other option is to connect a single cell LiPo battery (i.e. nominal 3.7V, 4.2V fully charged) to the 2-pin JST connector as shown below. For users interested in soldering headers, wire, or measuring a LiPo battery, the VBAT and GND is broken out next to the connector. A MCP73831 charge IC is included on the boards to safely charge the LiPo batteries via USB Type C connector. A corresponding status LED (labeled as CHG, not highlighted in the image below) will indicate when the board is charging or is fully charged. More information on the LED status is highlighted in the LEDs section. For Main Boards V2+, the default charge rate is now set to 500mA only. We recommend that users only use a single cell LiPo battery with a capacity of 500mAh or higher to safely charge the battery. There is also a small cutout on the edge of the board allowing users to place a LiPo battery underneath the board if they decide to place the board in an enclosure.
The voltage from the LiPo battery is then regulated down to 3.3V as it goes through the AP7361C 3.3V voltage regulator (rated at 1A max) for the rest of the board. The voltage is regulated down to 3.3V as it goes through the Qwiic connector's AP7347DQ 3.3V voltage regulator (rated at 500mA max) as well.
MicroMod Processor Board
The MicroMod ecosystem allows you to easily swap out processors depending on your application. The location of the M.2 connector labeled as Processor is where you would connect and secure a MicroMod Processor Board.
MicroMod Function Board
Beside the MicroMod Processor's socket is another M.2 connector for MicroMod Function Boards, which allow you to add additional functionality to your Processor Board. The Single Main Board includes one M.2 connector for a single Function Board while the Double Main Board includes two M.2 connectors for up two Function Boards.
Main Board - Single Function Board Location | Main Board - Double Function Board Location |
Reset and Boot Buttons
Each board includes one button for the RESET and another button for the BOOT. There is an additional reset and GND PTH pin next to the reset button. Hitting the reset button will restart your Processor Board. Hitting the boot button will put the Processor Board into a special boot mode. Depending on the Processor Board, this boot pin may not be connected.
SWD Pins
For advanced users, we broke out the 2x5 SWD programming pins. Note that this is not populated so you will need a compatible header and compatible JTAG programmer to connect.
MicroSD Card Socket
The board includes a microSD socket if your application requires you to log and save data to a memory card. The primary SPI pins (SDO, SDI, SCK) from your Processor and Function Board are connected to the microSD card socket. The CS pin for the microSD card socket is different on each board:
- The MicroMod Main Board - Single v2.1 is on Processor Board's pin
D1
. - The MicroMod Main Board - Double v2.2 is on Processor Board's pin
G4
.
For Main Boards V2+, there is a transistor (the tiny three pin IC below the microSD card socket) to toggle power to the microSD card socket's VCC pin. This is connected the Processor Board's secondary I2C clock pin (i.e. "I2C_SCL1") and is active low. For users using the Main Boards in low power applications, you can define the pin and set it to a logic HIGH
to disconnect power connected to the microSD card socket. Setting the pin to a logic LOW
will power the microSD card socket. Just make sure to close the file to avoid any corrupt data.
LEDs
There are four LEDs on the board:
- VIN - The VIN LED lights up to indicate when power available from the USB connector.
- QWC - The QWC LED lights up to indicate when there is a 3.3V available to the Qwiic connector after power is regulated down from the USB connector or LiPo battery. This is a new feature that was added in Main Boards v2+.
- 3V3 - The 3V3 LED lights up to indicate when there is a 3.3V available for the MicroMod Processor Board and Function Boards after power is regulated down from the USB connector or LiPo battery.
- CHG - The on-board yellow CHG LED can be used to get an indication of the charge status of your battery. Below is a table of other status indicators depending on the state of the charge IC.
Charge State | LED status |
No Battery | Floating (should be OFF, but may flicker) |
Shutdown | Floating (should be OFF, but may flicker) |
Charging | ON |
Charge Complete | OFF |
Jumpers
The following ten jumpers are included on both the Single and Double Main Boards.
- SHLD - By default, the jumper is closed and located on the bottom side of the board. This jumper connects the USB Type C connector's shield pin to GND. Cut this to isolate the USB Type C connector's shield pin. This is a new feature that was added in Main Boards v2+.
- 5V5 MEAS - By default, the jumper is closed and located on the top side of the board. This jumper is used to measure your system's current consumption. You can cut this jumper's trace and connect the PTHs to a ammeter/multimeter to probe the input into the 3.3V voltage regulator. Check out our How to Use a Multimeter tutorial for more information on measuring current. This is a new feature that was added in Main Boards V2+.
- 3V3 MEAS - By default, the jumper is closed and located on the top side of the board. This jumper is used to measure your system's current consumption. You can cut this jumper's trace and connect the PTHs to a ammeter/multimeter to probe the output from the 3.3V voltage regulator.
- PTC - By default, the jumper is open and located on the bottom of the board. For advanced users, add a solder blob to the jumper to bypass the resettable PTC fuse to pull more than 2A from the USB source.
- 3V3 EN - By default, this jumper is open and located on the bottom of the board. Closing this jumper enables processor control of the 3.3V bus.
- VIN LED - By default, this jumper is closed and located on the bottom of the board. Cut this trace to disable the LED that is connected to the input of the USB.
- QWIIC LED - By default, this jumper is closed and located on the bottom of the board. Cut this trace to disable the LED that is connected to the output of the Qwiic connector's 3.3V voltage regulator. This is a new feature that was added in Main Boards V2+.
- 3V3 LED - By default, this jumper is closed and located on the bottom of the board. Cut this trace to disable the LED that is connected to the output of the 3.3V voltage regulator.
- DIVIDER - By default, this jumper is closed and located on the bottom of the board. This is connected to processor's "BATT_VIN/3" pin. This is for advanced users that want to remove the resistor divider in low power applications.
- I2C - By default, this 3-pad jumper is closed by default and located on the bottom of the board. The 2.2kΩ pull-up resistors are attached to the primary I2C bus; if multiple devices are connected to the bus with the pull-up resistors enabled, the parallel equivalent resistance will create too strong of a pull-up for the bus to operate correctly. As a general rule of thumb, disable all but one pair of pull-up resistors if multiple devices are connected to the bus. This is a new feature that was added in Main Boards V2+.
Main Board - Single Top View Jumpers |
Main Board - Single Bottom View Jumpers |
Switches
Certain processors have limited GPIO (e.g. SAMD51, ESP32, and STM32 to name a few) and so these alternative power enable pins have been provided. The previous version of the Main Board Double used male jumper pins and 2-pin shunts for each Function Board power enable pin. For the Main Board Double v2.2, these are now replaced with SMD switches. There is an additional switch for the CS pin for users that require the use of more than one SPI chip select pin. Simply move the switch toward the side that fits your project's needs. The list below explains where the pins are routed when the switch set to each side. Make sure to check the hookup guide for your Processor and Function Board for more information about the the pin definitions.
- G6
- EN1_ALT - Setting the G5 switch toward the EN1_ALT position will route the Processor Board's
G6
toSDIO_DATA1
. As stated earlier, this is needed for Processor Boards that do not have aSDIO_DATA1
pin. Thus a general purpose pin was used as an alternative pin. - G6 PROC - Setting the switch toward the G6 PROC position will route the Processor Board's
G6
pin to the Function Board One's general purpose pin (i.e. FC1's "F4" pin).
- EN1_ALT - Setting the G5 switch toward the EN1_ALT position will route the Processor Board's
- G5
- EN0_ALT - Setting the G5 switch toward the EN0_ALT position will route the Processor Board's
G5
toSDIO_DATA2
. As stated earlier, this is needed for Processor Boards that do not have aSDIO_DATA2
pin. Thus a general purpose pin was used as an alternative pin. - G5 PROC - Setting the switch toward the G5 PROC position will route the Processor Board's
G5
pin to the Function Board One's general purpose pin (i.e. FC1's "F3" pin).
- EN0_ALT - Setting the G5 switch toward the EN0_ALT position will route the Processor Board's
- CS
- CS_ALT - Setting the CS switch toward the CS_ALT position will route the Processor Board's secondary SPI chip select pin
CS1
pin toA1
. As stated earlier, this is needed for Processor Boards that do not have aSDIO_DATA3
pin. In this case, an analog pin was used for the alternative pin. - CS DEF - Setting the switch toward the CS DEF position will route the Processor Board's CS1 pin to the Function Board One's chip select pin (i.e. FC1's "F1/CS" pin).
- CS_ALT - Setting the CS switch toward the CS_ALT position will route the Processor Board's secondary SPI chip select pin
Multiplexed Primary UART
For Main Boards V2+, a multiplexer was added after the Processor Board's primary UART pins (i.e. TX1 and RX1). Most users will not need to worry about using the multiplexer, which should be connected to Function Card 0's default UART pins (i.e. FC0's "Rx" and "TX" pins).
MicroMod Main Board - Single Mux and PTH Pins | MicroMod Main Board - Double Mux |
For those that have certain Function Boards that require device firmware updates (DFU), users will need to configure the multiplexer's input pins "1IN" and "2IN" by pulling either pin low. Setting "1IN" to LOW
will route primary UART lines to Function Card Zero's multiplexed pins (i.e. FC0's "DFU_FC_TX and "DFU_FC_RX" pins). Setting "2IN" to LOW
will route primary UART lines to Function Card One's multiplexed pins (i.e. FC1's "DFU_FC_TX and "DFU_FC_RX" pins). The MicroMod Cellular Function Board - Blues Wireless Notecarrier is one board that takes advantage of this feature. Since the Main Board Single V2.1 only has one location for a Function Board, the second set of multiplexed pins are broken out to a row of PTH pins (i.e. GND, SEL, RXI, TXO). Below is the truth table for the multiplexer. For more information, make sure to check out the respective schematics to view where the pins are connected.
Screenshot of the UART Multiplexer from the Main Board Single V2.1 Schematic |
Screenshot of the UART Multiplexer from the Main Board Double V2.2 Schematic |
Having a hard time seeing the schematic? Click on the image for a closer look.
Qwiic and I2C
The board includes a vertical and horizontal Qwiic connector. These are connected to the primary I2C bus on both the Processor and Function Board connectors allowing you to easily add a Qwiic-enabled device to your application. For Main Boards that are V2+, the 3.3V pin is connected to its own dedicated 3.3V voltage regulator as explained earlier. The I2C data and clock lines are also tied to 2.2kΩ pull-up resistors.
Note that there are two mounting holes for Qwiic-enabled boards that have a standard 1.0"x1.0" size board. The image below highlighted with a black square is where you would place the board.
MicroMod Pinout
Depending on your window size, you may need to use the horizontal scroll bar at the bottom of the table to view the additional pin functions. Note that the M.2 connector pins on opposing sides are offset from each other as indicated by the bottom pins where it says (Not Connected)*. There is no connection to pins that have a "-" under the primary function.
AUDIO | UART | GPIO/BUS | I2C | SDIO | SPI | Dedicated |
Processor Pins | Function Zero Pins | Main Board - Single Miscellaneous Pins |
|
---|---|---|---|
USB_VIN | - | USB_VIN | |
USB_D+_Processor | USBHOST_D+ | USB_D+ | |
USB_D-_Processor | USBHOST_D- | USB_D- | |
USB_D+_Processor | USBHOST_D+ | USB_D+ | |
USB_D-_Processor | USBHOST_D- | USB_D- | |
3.3V | - | 3.3V | |
3.3V_EN | - | 3.3V_EN | |
BATT_VIN / 3 | - | VIN/3 | |
GND | GND | GND | |
RESET | DFU_RST | RESET Button RST PTH |
|
BOOT | DFU_BOOT | Boot Button | |
SWDCK_Processor | - | SWDCK (2x5 Header) | |
SWDIO_Processor | - | SWDIO (2x5 Header) | |
D0_Processor | INT | F0 | - |
D1_Processor | - | SD Card CS (microSD Card) |
|
I2C_SDA_Processor | I2C_SDA | I2C_SDA (Qwiic Connector) | |
I2C_SCL_Processor | I2C_SCL | I2C_SCL (Qwiic Connector) | |
I2C_INT_Processor | I2C_INT | - | |
I2C_SDA1_Processor | - | QWIIC_EN | |
I2C_SCL1_Processor | - | SD_ENABLE (microSD CardPower) |
|
UART_TX1_Processor | UART_RX (DFU_Active [FC0] = HIGH ,SEL = HIGH ) |
TXO (DFU_Active [FC0] = HIGH ,SEL = LOW ) |
|
DFU_FC_TX (DFU_Active [FC0] = LOW ,SEL = HIGH ) |
|||
UART_RX_Processor | UART_TX (DFU_Active [FC0] = HIGH ,SEL = HIGH ) |
RXI (DFU_Active [FC0] = HIGH ,SEL = LOW ) |
|
DFU_FC_RX (DFU_Active [FC0]= LOW ,SEL = HIGH ) |
|||
UART_RTS_Processor | UART_CTS | - | |
UART_CTS_Processor | UART_RTS | - | |
- | - | SEL | |
PWM0_Processor | PWM0 | F2 | - |
PWM1_Processor | PWR_EN0 | - | |
A0_Processor | A0 | - | |
CAN_RX_Processor | CAN_TX | - | |
CAN_TX_Processor | CAN_RX | - | |
G0_Processor | F3 | - | |
G1_Processor | F4 | - | |
G2_Processor | F5 | - | |
G3_Processor | F6 | - | |
G4_Processor | F7 | - | |
SPI_CS0_Processor | CS | F1 | - |
SPI_SCK_Processor | SPI_SCK | SPI_SCK (microSD Card) |
|
SPI_DI_Processor | SPI_DO | SPI_DO (microSD Card) |
|
SPI_DO_Processor | SPI_DI | SPI_DI (microSD Card) |
Processor Pins | Function Zero Pins |
Function One Pins |
Main Board - Double Miscellaneous Pins | ||
---|---|---|---|---|---|
USB_VIN | - | - | USB_VIN | ||
USBHOST_D+_Processor | USBHOST_D+ | (No USB Host) | - | ||
USBHOST_D-_Processor | USBHOST_D- | (No USB Host) | - | ||
USB_D+_Processor | - | - | USB_D+ | ||
USB_D-_Processor | - | - | USB_D- | ||
3.3V | - | - | 3.3V | ||
3.3V_EN | - | - | 3.3V_EN | ||
BATT_VIN / 3 | - | - | VIN / 3 | ||
GND | GND | GND | GND | ||
RESET | DFU_RST | DFU_RST | RESET Button RST PTH |
||
BOOT | DFU_BOOT | DFU_BOOT | Boot Button | ||
SWDCK_Processor | - | - | SWDCK (2x5 Header) | ||
SWDIO_Processor | - | - | SWDIO (2x5 Header) | ||
I2C_SDA_Processor | I2C_SDA | I2C_SDA | I2C_SDA (Qwiic) | ||
I2C_SCL_Processor | I2C_SCL | I2C_SCL | I2C_SCL (Qwiic) | ||
I2C_INT_Processor | I2C_INT | - | I2C_INT | ||
I2C_SDA1_Processor | - | - | QWIIC_EN | ||
I2C_SCL1_Processor | - | - | SD_ENABLE | ||
UART1_TX_Processor | UART_RX (DFU_Active [FC0] = HIGH ,(DFU_Active [FC1]= HIGH ) |
- | - | ||
DFU_FC_TX (DFU_Active [FC0] = LOW ,(DFU_Active [FC0]= HIGH ) |
DFU_FC_TX (DFU_Active [FC1] = HIGH ,(DFU_Active [FC1] = LOW ) |
||||
UART_RX_Processor | UART_TX (DFU_Active [FC0] = HIGH ,(DFU_Active [FC1] = HIGH ) |
- | - | ||
DFU_FC_RX (DFU_Active [FC0] = LOW ,(DFU_Active [FC1] = HIGH ) |
DFU_FC_RX (DFU_Active [FC0] = HIGH ,(DFU_Active [FC1] = LOW ) |
||||
UART1_RTS_Processor | UART_RTS | (No Flow Control) | - | ||
UART_CTS_Processor | UART_CTS | (No Flow Control) | - | ||
UART2_TX_Processor | - | UART_RX | - | ||
UART2_RX_Processor | - | UART_TX | - | ||
D0_Processor | F0 | INT | - | - | |
D1_Processor | - | F0 | INT | - | |
PWM0_Processor | PWM | F2 | - | - | |
PWM1_Processor | - | PWM | F2 | - | |
A0_Processor | A0 | - | - | ||
A1_Processor | - | A0 | CS1_ALT Switch | ||
CAN_RX_Processor | CAN_TX | (No CAN BUS) | - | ||
CAN_TX_Processor | CAN_RX | (No CAN BUS) | - | ||
G0_Processor | F3 | - | - | ||
G1_Processor | F4 | - | - | ||
G2_Processor | F5 | - | - | ||
G3_Processor | F6 | - | - | ||
G4_Processor | F7 | - | SD Card CS (microSD Card) |
||
G5_Processor | - | F3 | PWN_EN0_ALT SWITCH | ||
G6_Processor | - | F4 | PWN_EN1_ALT SWITCH | ||
G7_Processor | - | F5 | - | ||
SPI_CS0_Processor | SPI_CS1 | F1 | - | - | |
SPI_CS1_Processor | - | SPI_CS1 | F1 | CS1_ALT Switch | |
SPI_SCK_Processor | SPI_SCK | SPI_SCK | SPI_SCK (microSD Card) |
||
SPI_DI_Processor | SPI_DO | SPI_DO | SPI_DO (microSD Card) |
||
SPI_DO_Processor | SPI_DI | SPI_DI | SPI_DI (microSD Card) |
||
SDIO_CLK_Processor | - | F7 | - | ||
SDIO_CMD_Processor | - | F6 | - | ||
SDIO_DATA1_Processor | - | PWR_EN1 | PWN_EN1_ALT SWITCH | ||
SDIO_DATA2_Processor | PWR_EN0 | - | PWN_EN0_ALT SWITCH |
Alternative Function |
Primary Function |
Bottom Pin |
Top Pin |
Primary Function |
Alternative Function |
---|---|---|---|---|---|
(Not Connected) | 75 | GND | |||
VIN | 74 | 73 | 3.3V | ||
VIN | 72 | 71 | Power EN | ||
- | 70 | 69 | - | ||
DFU_RST | 68 | 67 | - | ||
DFU_BOOT | 66 | 65 | - | ||
- | 64 | 63 | - | ||
- | 62 | 61 | F7 | ||
- | 60 | 59 | F6 | ||
- | 58 | 57 | F5 | ||
- | 56 | 55 | F4 | ||
- | 54 | 53 | F3 | ||
- | 52 | 51 | F2 | PWM | |
- | 50 | 49 | F1 | SPI_CS | |
- | 48 | 47 | F0 | INT | |
- | 46 | 45 | GND | ||
- | 44 | 43 | CAN_TX | ||
- | 42 | 41 | CAN_RX | ||
EEPROM_WP | 40 | 39 | GND | ||
A0 | 38 | 37 | USBHOST_D- | ||
EEPROM_A0 | 36 | 35 | USBHOST_D+ | ||
EEPROM_A1 | 34 | 33 | GND | ||
EEPROM_A2 | 32 | 31 | Module Key | ||
Module Key | 30 | 29 | Module Key | ||
Module Key | 28 | 27 | Module Key | ||
Module Key | 26 | 25 | Module Key | ||
Module Key | 24 | 23 | I2C_INT | ||
- | 22 | 21 | I2C_SCL | ||
- | 20 | 19 | I2C_SDA | ||
UART_CTS | 18 | 17 | - | ||
UART_RTS | 16 | 15 | UART_RX | ||
- | 14 | 13 | UART_TX | ||
- | 12 | 11 | - | ||
DFU_FC_ACTIVE | 10 | 9 | - | ||
- | 8 | 7 | SPI_SDO | ||
DFU_FC_RX | 6 | 5 | SPI_SDI | ||
DFU_FC_TX | 4 | 3 | SPI_SCK | ||
- | 2 | 1 | GND |
Alternative Function | Alternative Function | Alternative Function | Primary Function | Bottom Pin |
Top Pin |
Primary Function | Alternative Function | Alternative Function | Alternative Function |
---|---|---|---|---|---|---|---|---|---|
(Not Connected) | 75 | GND | |||||||
3.3V | 74 | 73 | G5 / BUS5 | ||||||
RTC_3V_BATT | 72 | 71 | G6 / BUS6 | ||||||
SPI_CS1# | SDIO_DATA3 (I/O) | 70 | 69 | G7 / BUS7 | |||||
SDIO_DATA2 (I/O) | 68 | 67 | G8 | ||||||
SDIO_DATA1 (I/O) | 66 | 65 | G9 | ADC_D- | CAM_HSYNC | ||||
SPI_POCI1 | SDIO_DATA0 (I/O) | 64 | 63 | G10 | ADC_D+ | CAM_VSYNC | |||
SPI PICO1 | SDIO_CMD (I/O) | 62 | 61 | SPI_POCI (I) | |||||
SPI SCK1 | SDIO_SCK (O) | 60 | 59 | SPI_PICO (O) | LED_DAT | ||||
AUD_MCLK (O) | 58 | 57 | SPI_SCK (O) | LED_CLK | |||||
CAM_MCLK | PCM_OUT | I2S_OUT | AUD_OUT | 56 | 55 | SPI_CS# | |||
CAM_PCLK | PCM_IN | I2S_IN | AUD_IN | 54 | 53 | I2C_SCL1 (I/O) | |||
PDM_DATA | PCM_SYNC | I2S_WS | AUD_LRCLK | 52 | 51 | I2C_SDA1 (I/O) | |||
PDM_CLK | PCM_CLK | I2S_SCK | AUD_BCLK | 50 | 49 | BATT_VIN / 3 (I - ADC) (0 to 3.3V) | |||
G4 / BUS4 | 48 | 47 | PWM1 | ||||||
G3 / BUS3 | 46 | 45 | GND | ||||||
G2 / BUS2 | 44 | 43 | CAN_TX | ||||||
G1 / BUS1 | 42 | 41 | CAN_RX | ||||||
G0 / BUS0 | 40 | 39 | GND | ||||||
A1 | 38 | 37 | USBHOST_D- | ||||||
GND | 36 | 35 | USBHOST_D+ | ||||||
A0 | 34 | 33 | GND | ||||||
PWM0 | 32 | 31 | Module Key | ||||||
Module Key | 30 | 29 | Module Key | ||||||
Module Key | 28 | 27 | Module Key | ||||||
Module Key | 26 | 25 | Module Key | ||||||
Module Key | 24 | 23 | SWDIO | ||||||
UART_TX2 (O) | 22 | 21 | SWDCK | ||||||
UART_RX2 (I) | 20 | 19 | UART_RX1 (I) | ||||||
CAM_TRIG | D1 | 18 | 17 | UART_TX1 (0) | |||||
I2C_INT# | 16 | 15 | UART_CTS1 (I) | ||||||
I2C_SCL (I/0) | 14 | 13 | UART_RTS1 (O) | ||||||
I2C_SDA (I/0) | 12 | 11 | BOOT (I - Open Drain) | ||||||
D0 | 10 | 9 | USB_VIN | ||||||
SWO | G11 | 8 | 7 | GND | |||||
RESET# (I - Open Drain) | 6 | 5 | USB_D- | ||||||
3.3V_EN | 4 | 3 | USB_D+ | ||||||
3.3V | 2 | 1 | GND |
Signal Group | Signal | I/O | Description | Voltage | Power | 3.3V | I | 3.3V Source | 3.3V |
---|---|---|---|---|
GND | Return current path | 0V | ||
USB_VIN | I | USB VIN compliant to USB 2.0 specification. Connect to pins on processor board that require 5V for USB functionality | 4.8-5.2V | |
RTC_3V_BATT | I | 3V provided by external coin cell or mini battery. Max draw=100μA. Connect to pins maintaining an RTC during power loss. Can be left NC. | 3V | |
3.3V_EN | O | Controls the carrier board's main voltage regulator. Voltage above 1V will enable 3.3V power path. | 3.3V | |
BATT_VIN/3 | I | Carrier board raw voltage over 3. 1/3 resistor divider is implemented on carrier board. Amplify the analog signal as needed for full 0-3.3V range | 3.3V | |
Reset | Reset | I | Input to processor. Open drain with pullup on processor board. Pulling low resets processor. | 3.3V |
Boot | I | Input to processor. Open drain with pullup on processor board. Pulling low puts processor into special boot mode. Can be left NC. | 3.3V | |
USB | USB_D± | I/O | USB Data ±. Differential serial data interface compliant to USB 2.0 specification. If UART is required for programming, USB± must be routed to a USB-to-serial conversion IC on the processor board. | |
USB Host | USBHOST_D± | I/O | For processors that support USB Host Mode. USB Data±. Differential serial data interface compliant to USB 2.0 specification. Can be left NC. | |
CAN | CAN_RX | I | CAN Bus receive data. | 3.3V |
CAN_TX | O | CAN Bus transmit data. | 3.3V | |
UART | UART_RX1 | I | UART receive data. | 3.3V |
UART_TX1 | O | UART transmit data. | 3.3V | |
UART_RTS1 | O | UART ready to send. | 3.3V | |
UART_CTS1 | I | UART clear to send. | 3.3V | |
UART_RX2 | I | 2nd UART receive data. | 3.3V | |
UART_TX2 | O | 2nd UART transmit data. | 3.3V | |
I2C | I2C_SCL | I/O | I2C clock. Open drain with pullup on carrier board. | 3.3V |
I2C_SDA | I/O | I2C data. Open drain with pullup on carrier board | 3.3V | |
I2C_INT# | I | Interrupt notification from carrier board to processor. Open drain with pullup on carrier board. Active LOW | 3.3V | |
I2C_SCL1 | I/O | 2nd I2C clock. Open drain with pullup on carrier board. | 3.3V | |
I2C_SDA1 | I/O | 2nd I2C data. Open drain with pullup on carrier board. | 3.3V | |
SPI | SPI_PICO | O | SPI Controller Output/Peripheral Input. | 3.3V |
SPI_POCI | I | SPI Controller Input/Peripheral Output. | 3.3V | |
SPI_SCK | O | SPI Clock. | 3.3V | |
SPI_CS# | O | SPI Chip Select. Active LOW. Can be routed to GPIO if hardware CS is unused. | 3.3V | |
SPI/SDIO | SPI_SCK1/SDIO_CLK | O | 2nd SPI Clock. Secondary use is SDIO Clock. | 3.3V |
SPI_PICO1/SDIO_CMD | I/O | 2nd SPI Controller Output/Peripheral Input. Secondary use is SDIO command interface. | 3.3V | |
SPI_POCI1/SDIO_DATA0 | I/O | 2nd SPI Peripheral Input/Controller Output. Secondary use is SDIO data exchange bit 0. | 3.3V | |
SDIO_DATA1 | I/O | SDIO data exchange bit 1. | 3.3V | |
SDIO_DATA2 | I/O | SDIO data exchange bit 2. | 3.3V | |
SPI_CS1/SDIO_DATA3 | I/O | 2nd SPI Chip Select. Secondary use is SDIO data exchange bit 3. | 3.3V | |
Audio | AUD_MCLK | O | Audio master clock. | 3.3V |
AUD_OUT/PCM_OUT/I2S_OUT/CAM_MCLK | O | Audio data output. PCM synchronous data output. I2S serial data out. Camera master clock. | 3.3V | |
AUD_IN/PCM_IN/I2S_IN/CAM_PCLK | I | Audio data input. PCM syncrhonous data input. I2S serial data in. Camera periphperal clock. | 3.3V | |
AUD_LRCLK/PCM_SYNC/I2S_WS/PDM_DATA | I/O | Audio left/right clock. PCM syncrhonous data SYNC. I2S word select. PDM data. | 3.3V | |
AUD_BCLK/PCM_CLK/I2S_CLK/PDM_CLK | O | Audio bit clock. PCM clock. I2S continuous serial clock. PDM clock. | 3.3V | |
SWD | SWDIO | I/O | Serial Wire Debug I/O. Connect if processor board supports SWD. Can be left NC. | 3.3V |
SWDCK | I | Serial Wire Debug clock. Connect if processor board supports SWD. Can be left NC. | 3.3V | |
ADC | A0 | I | Analog to digital converter 0. Amplify the analog signal as needed to enable full 0-3.3V range. | 3.3V |
A1 | I | Analog to digital converter 1. Amplify the analog signal as needed to enable full 0-3.3V range. | 3.3V | |
PWM | PWM0 | O | Pulse width modulated output 0. | 3.3V |
PWM1 | O | Pulse width modulated output 1. | 3.3V | |
Digital | D0 | I/O | General digital input/output pin. | 3.3V |
D1/CAM_TRIG | I/O | General digital input/output pin. Camera trigger. | 3.3V | |
General/Bus | G0/BUS0 | I/O | General purpose pins. Any unused processor pins should be assigned to Gx with ADC + PWM capable pins given priority (0, 1, 2, etc.) positions. The intent is to guarantee PWM, ADC and Digital Pin functionality on respective ADC/PWM/Digital pins. Gx pins do not guarantee ADC/PWM function. Alternative use is pins can support a fast read/write 8-bit or 4-bit wide bus. | 3.3V |
G1/BUS1 | I/O | 3.3V | ||
G2/BUS2 | I/O | 3.3V | ||
G3/BUS3 | I/O | 3.3V | ||
G4/BUS4 | I/O | 3.3V | ||
G5/BUS5 | I/O | 3.3V | ||
G6/BUS6 | I/O | 3.3V | ||
G7/BUS7 | I/O | 3.3V | ||
G8 | I/O | General purpose pin | 3.3V | |
G9/ADC_D-/CAM_HSYNC | I/O | Differential ADC input if available. Camera horizontal sync. | 3.3V | |
G10/ADC_D+/CAM_VSYNC | I/O | Differential ADC input if available. Camera vertical sync. | 3.3V | |
G11/SWO | I/O | General purpose pin. Serial Wire Output | 3.3V | |
General/Bus | F0/INT | I/O | General purpose pin for the Function Boards. Secondary use is for interrupts. | 3.3V |
F1/CS | I/O | General purpose pin for the Function Boards. Secondary use is for SPI chip select. | 3.3V | |
F2/PWM | I/O | General purpose pin for the Function Boards. Secondary use is for PWM. | 3.3V | |
F3 | I/O | General purpose pins for the Function Boards. | 3.3V | |
F4 | I/O | 3.3V | ||
F5 | I/O | 3.3V | ||
F6 | I/O | 3.3V | ||
F7 | I/O | 3.3V |
Low Power Considerations
For users using the Main Board for low power applications, there are a few methods to reduce power for your system. It was briefly explained earlier but we will compile a short list as shown below. The first would be to disable the status LEDs by cutting the jumpers on the back of the board. Of course, you could also disable the LEDs on any Qwiic-enabled boards that are connected as well. Using a Processor Board's GPIO, you could also toggle the voltage regulator on the Qwiic port and Function Boards when not in use. For users with Main Boards V2+, you could toggle power on the microSD card socket by pulling the transistor low using a GPIO.
- Manually disable the LEDs by cutting the following jumpers
- VIN LED
- 3V3 LED
- Qwiic LED
- Manually disabling any LEDs on any Qwiic-enabled boards used with the Main Boards
- GPIO control of the following
- Qwiic's voltage regulator
- Voltage Enable on the Function Board (EN0 and EN1)
- Transistor connected to the microSD card socket VCC pin
Dimensions
The board dimension of the MicroMod Main Board - Single V2.1 is 2.90" x 3.40" while the MicroMod Main Board - Double v2.2 is 2.90" x 4.90". Both boards include 5x mounting holes. Four are located on the edge of each board. The fifth mounting hole is located 0.80" away from another mounting hole to mount Qwiic-enabled boards that have the standard 1.0"x1.0" size board.
MicroMod Main Board - Single | MicroMod Main Board - Double |
Hardware Hookup
If you have not already, make sure to check out the Getting Started with MicroMod: Hardware Hookup for information on inserting your Processor and Function Boards to the Main Board.
Getting Started with MicroMod
October 21, 2020
USB
To program and power the Main Board, you will need to insert the USB-C cable into the USB connector. We will leave the other end disconnected when connecting a Processor or Function board to the Main Board.
When the boards are secure, insert the other end to a computer. When you are finished programming the processor, you can use a USB battery via the USB connector or LiPo battery via the JST connector to power the board.
Processor Board
Align the Processor Board's key into its M.2 connector's socket. Insert the board at an angle (~25°), push down, and tighten the screw. In this case, we had the MicroMod Artemis Processor Board secured in the M.2 connector socket. Depending on your application, you may have a different Processor Board.
Function Boards
Align the Function Board's key into its M.2 connector's socket. Insert the board at an angle (~25°), push down, and tighten one of the screw to hold the board down. Attach the second screw on the other side of the board. Once the board is aligned, tighten both screws fully to secure the board.
In this case, we had the Environmental Function Board secured in the M.2 connector socket. Depending on your application, you may have a different Function Board.
If you decide to have two function boards attached to the Main Board - Double, we recommend tightening the screw between the two Function Boards first to hold them down before attaching the remaining screws on either side of the Function Boards. Again, once the boards are aligned, tighten all three screws fully to secure the board. In this case, we had the Single Pair Ethernet Function Board and the Environmental Function Board secured in the M.2 connector sockets. Depending on your application, you may have different function boards.
Once the Function Boards are secure, attach any remaining cables, antennas, or components that your application may need. In this case, we would have attached a Single Pair Ethernet cable to the SPE Function Board.
Attach Any Additional Cables and Antennas |
Single Cell LiPo Battery
For mobile applications, attach a single cell LiPo battery to the 2-pin JST connector. Attach a USB cable to a USB port or charger when the battery is low to begin charging.
To remove the LiPo battery, you can pull the white JST connector away from the socket while also wiggling the connector side to side using your thumb and index finger.
Qwiic-Enabled Devices
To Qwiic-ly connect I2C devices, simply insert a Qwiic cable between one of the MicroMod Main Board's Qwiic ports and your Qwiic device. Of course, you can also daisy chain boards for applications that require more than one Qwiic-enabled device.
If you need to mount a Qwiic-enabled board to the MicroMod Main Board, you can grab some standoffs and mount a standard Qwiic 1.0"x1.0" sized board using the two mounting holes near the USB Type C connector. Place the standoff between the boards and tighten the screws to mount. The image below used standoffs with built-in threads.
MicroSD Card
With power removed from the board, insert a microSD card (with the pins facing toward the board) into the socket. You'll hear a nice click indicating that the microSD card is locked in place.
To remove, make sure power is off and press the microSD card into the socket to eject. You'll hear a nice click indicating that the card is ready to be removed from the socket.
Software Installation
Arduino Board Definitions and Driver
We'll assume that you installed the necessary board files and drivers for your Processor Board. In this case, we used the MicroMod Artemis Processor Board which uses the CH340 USB-to-serial converter. If you are using a different Processor Board, make sure to check out its hookup guide for your Processor Board.
Installing Board Definitions in the Arduino IDE
September 9, 2020
MicroMod Artemis Processor Board Hookup Guide
October 21, 2020
How to Install CH340 Drivers
August 6, 2019
Arduino Examples
Let's go over a few basic examples to get started with the MicroMod Main Board Single and Double. We'll toggle the 3.3V voltage regulators and log data to a microSD card on both boards.
Example 1: MicroMod Main Board - Single Enable Function Board
If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Hit the upload button.
language:c
/******************************************************************************
WRITTEN BY: Ho Yun "Bobby" Chan
@ SparkFun Electronics
UPDATED: 1/3/2023
DATE: 10/19/2021
GITHUB REPO: https://github.com/sparkfun/SparkFun_MicroMod_Main_Board_Single
DEVELOPMENT ENVIRONMENT SPECIFICS:
Firmware developed using Arduino IDE v1.8.12
========== DESCRIPTION==========
This example code toggles the Function Board's AP2112 3.3V voltage
regulator's enable pin. The Function Boards built-in power LED should blink.
This example is based on Arduino's built-in Blink Example:
https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
Note that this example code uses the MicroMod Main Board - Single. The MicroMod
Main Board - Double routes the PWR_EN# pins slightly different for the
two function boards.
========== HARDWARE CONNECTIONS ==========
MicroMod Artemis Processor Board => MicroMod Main Board - Single => Function Board
Feel like supporting open source hardware?
Buy a board from SparkFun!
MicroMod Artemis Processor Board - https://www.sparkfun.com/products/16401
MicroMod Main Board - Single - https://www.sparkfun.com/products/20748
MicroMod Environmental Function Board - https://www.sparkfun.com/products/18632
LICENSE: This code is released under the MIT License (http://opensource.org/licenses/MIT)
******************************************************************************/
/*Define the power enable pins for the processor board with either SDIO_DATA2 or A1.
Depending on the processor board, the Arduino pin may be different.
Note: For MicroMod Main Board - Single v2.1, there is now only one GPIO available
to toggle the Power Enable 0 (PWR_EN0) pin. The previous defines for a few
Processor Boards are still available for those that have v1.1.
For MicroMod Main Board - Single v1.1, certain Processor Boards like the
Artemis have SDIO_DATA2 and A1 available to control the Function Board's
voltage regulator. SAMD51, ESP32, and STM32 Processor Board pins do not
have SDIO_DATA2, so users will need to reference the Processor Pin A1.
Below are a few examples.*/
//==========ARTEMIS==========
//Function Board 0's "PWR_EN0" pin <= MicroMod Main - Single v2.1 PWM1 => Artemis Processor Board (D45)
#define PWR_EN0 45
//Function Board 0's "PWR_EN0" pin <= MicroMod Main - Single v1.1 SDIO_DATA2 => Artemis Processor Board (D4)
//#define PWR_EN0 4
//Alternative option that does the same thing. Make sure to just choose one for PWR_EN0
//Function Board 0's "PWR_EN0" pin <= MicroMod Main - Single v1.1 A1 => Artemis Processor Board (A35)
//#define PWR_EN0 35
//==========TEENSY==========
//Function Board 0's "PWR_EN0" pin <= MicroMod Main- Single v2.1 PWM1 => Teensy Processor Board (2)
//#define PWR_EN0 2
//Function Board 0's "PWR_EN0" pin <= MicroMod Main - Single v1.1 SDIO_DATA2 => Teensy Processor Board (39)
//#define PWR_EN0 39
//Alternative option that does the same thing. Make sure to just choose one for PWR_EN0
//Function Board 0's "PWR_EN0" pin <= MicroMod Main - Single v1.1 A1 => Teensy Processor Board (A1)
//#define PWR_EN0 15
//Note: For those using Main - Single v1.1;
// SAMD51, ESP32, and STM32 Processor Board Pins
// do not have SDIO_DATA2 and SDIO_DATA1.
//==========SAMD51==========
//Function Board 0's "PWR_EN0" pin <= MicroMod Main - Single v2.1 PWM1 => SAMD51 Processor Board (20)
//#define PWR_EN0 20
//Function Board 0's "PWR_EN0" pin <= MicroMod Main - Single v1.1 A1 => SAMD51 Processor Board (18)
//#define PWR_EN0 18
//==========ESP32==========
//Function Board 0's "PWR_EN0" pin <= MicroMod Main - Single v2.1 PWM1 => ESP32 Processor Board (12)
//#define PWR_EN0 12
//Function Board 0's "PWR_EN0" pin <= MicroMod Main - Single v1.1 A1 => ESP32 Processor Board (35)
//#define PWR_EN0 35
void setup() {
// initialize the digital pin as an output.
pinMode(PWR_EN0, OUTPUT);
}
void loop() {
digitalWrite(PWR_EN0, HIGH); // turn the 3.3V regulator on (HIGH is the voltage level)
delay(5000); // wait for a few seconds to do something with the function boards
digitalWrite(PWR_EN0, LOW); // turn the 3.3V regulator off by making the voltage LOW
delay(5000); // wait for a few seconds before turning function boards back on
}
After uploading, take a look at your Function Board's PWR LED. The LED will be on for about 5 seconds and then turn off for another 5 seconds. It will continue to repeat until power is removed from the MicroMod Main Board - Single.
Example 2: MicroMod Main Board - Double Enable Function Boards
If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Hit the upload button.
language:c
/******************************************************************************
WRITTEN BY: Ho Yun "Bobby" Chan
@ SparkFun Electronics
UPDATED: 1/3/2023
DATE: 10/19/2021
GITHUB REPO: https://github.com/sparkfun/SparkFun_MicroMod_Main_Board_Double
DEVELOPMENT ENVIRONMENT SPECIFICS:
Firmware developed using Arduino IDE v1.8.12
========== DESCRIPTION==========
This example code toggles the Function Board's AP2112 3.3V voltage
regulator's enable pin. The Function Boards built-in power LED should blink.
This example is based on Arduino's built-in Blink Example:
https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
Note that this example code uses the MicroMod Main Board - Double. The MicroMod
Main Board - Single routes the PWR_EN0 pin slightly different for the
function board.
========== HARDWARE CONNECTIONS ==========
MicroMod Artemis Processor Board => MicroMod Main Board - Double => Function Boards
Feel like supporting open source hardware?
Buy a board from SparkFun!
MicroMod Artemis Processor Board - https://www.sparkfun.com/products/16401
MicroMod Main Board - Double - https://www.sparkfun.com/products/20595
MicroMod Environmental Function Board - https://www.sparkfun.com/products/18632
LICENSE: This code is released under the MIT License (http://opensource.org/licenses/MIT)
******************************************************************************/
/*Define the power enable pins for the processor board with SDIO_DATA2 and SDIO_DATA1.
Depending on the processor board, the Arduino pin may be different.
Note: Certain Processor Boards like the Artemis have more than one pin available
to control the Function Board's voltage regulator (e.g. SDIO_DATA2 and G5).
SAMD51, ESP32, and STM32 Processor Board pins do not have SDIO_DATA2, so
users will need to reference the Processor Pin G5. Below are a few examples. */
//==========ARTEMIS==========
// We suggest flipping the switch to the G5 PROC and G6 PROC. The volrage regulators will work reguardless
// since SDIO_DATA2 and SDIO_DATA1 are connected regardless of what side the switch is on.
// Function Board 0's "PWR_EN0" pin <= MicroMod Main - Double SDIO_DATA2 => Artemis Processor Board (D4)
#define PWR_EN0 4
// Function Board 1's "PWR_EN1" pin <= MicroMod Main - Double SDIO_DATA1 => Artemis Processor Board (D26)
#define PWR_EN1 26
// Make sure switch is flipped over to the EN0 ALT and & EN1 ALT.
// Alternative option that does the same thing. Make sure to just choose one for PWR_EN0 and PWR_EN1.
// Function Board 0's "PWR_EN0" pin <= MicroMod Main - Double G5 => Artemis Processor Board (A29)
//#define PWR_EN0 29
// Function Board 1's "PWR_EN0" pin <= MicroMod Main - Double G6 => Artemis Processor Board (D14)
//#define PWR_EN1 14
//==========TEENSY==========
// We suggest flipping the switch to the G5 PROC and G6 PROC. The volrage regulators will work reguardless
// since SDIO_DATA2 and SDIO_DATA1 are connected regardless of what side the switch is on.
// Function Board 0's "PWR_EN0" pin <= MicroMod Main - Double SDIO_DATA2 => Teensy Processor Board (D39)
//#define PWR_EN0 39
// Function Board 1's "PWR_EN1" pin <= MicroMod Main - Double SDIO_DATA1 => Teensy Processor Board (D34)
//#define PWR_EN1 34
// Make sure switch is flipped over to the EN0 ALT and & EN1 ALT.
// Alternative option that does the same thing. Make sure to just choose one for PWR_EN0 and PWR_EN1
// Function Board 0's "PWR_EN0" pin <= MicroMod Main - Double G5 => Teensy Processor Board (45)
//#define PWR_EN0 45
// Function Board 1's "PWR_EN1" pin <= MicroMod Main - Double G6 => Teensy Processor Board (6)
//#define PWR_EN1 6
//Note: The SAMD51, ESP32, and STM32 Processor Board Pins do not have SDIO_DATA2 and SDIO_DATA1.
//==========SAMD51==========
// Make sure switch is flipped over to the EN0 ALT and & EN1 ALT.
// Function Board 0's "PWR_EN0" pin <= MicroMod Main - Double G5 => SAMD51 Processor Board (D7)
//#define PWR_EN0 7
//Function Board 1's"PWR_EN1" pin <= MicroMod Main - Double G6 => SAMD51 Processor Board (D8)
//#define PWR_EN1 8
//==========ESP32==========
// Make sure switch is flipped over to the EN0 ALT and & EN1 ALT.
// Function Board 0's "PWR_EN0" pin <= MicroMod Main - Double G5 => ESP32 Processor Board (32)
//#define PWR_EN0 32
// Function Board 1's"PWR_EN1" pin <= MicroMod Main - Double G6 => ESP32 Processor Board (33)
//#define PWR_EN1 33
void setup() {
// initialize the digital pins as an output.
pinMode(PWR_EN0, OUTPUT);
pinMode(PWR_EN1, OUTPUT);
}
void loop() {
digitalWrite(PWR_EN0, HIGH); // turn the 3.3V regulator on (HIGH is the voltage level)
digitalWrite(PWR_EN1, HIGH); // turn the 3.3V regulator on (HIGH is the voltage level)
delay(5000); // wait for a few seconds to do something with the function boards
digitalWrite(PWR_EN0, LOW); // turn the 3.3V regulator off by making the voltage LOW
digitalWrite(PWR_EN1, LOW); // turn the 3.3V regulator off by making the voltage LOW
delay(5000); // wait for a few seconds before turning function boards back on
}
After uploading, take a look at the PWR LEDs on the Function Boards. The LEDs will be on for about 5 seconds and then turn off for another 5 seconds. It will continue to repeat until power is removed from the MicroMod Main Board - Double.
Example 3: Reading and Writing to a MicroSD Card
const int chipSelect = 10;
To one of the following values.
//==========TEENSY==========
// default value used in Teensy SD Example Code
//const int chipSelect = 10;
// The microSD Card CS pin is D1 for the MicroMod Main Board - Single and Teensy Processor (5). Adjust for your processor if necessary.
const int chipSelect 5;
// The microSD Card's CS pin is G4 for the MicroMod Main Board - Double and Teensy Processor (44). Adjust for your processor if necessary.
//const int chipSelect 44;
The example below uses the built-in SD Arduino library. The only difference in the code is the CS pin for the microSD card, which you will need to adjust for your processor board (in this case we use the Artemis Processor Board). Make sure to reference your Processor Board's CS pin for either the Main Board - Single (D1) or Main Board - Double (G4).
If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Hit the upload button.
language:c
/*
SD Card Read/Write
This example shows how to read and write data to and from an SD card file
The circuit:
SD card attached to SPI bus as follows:
SD Card <=> MicroMod Main Board <=> Artemis Processor Board
-----------------------------------------------------------------
SD ENABLE <=> I2C_SDA1-PROCESSOR <=> pin 9
PICO/SDO <=> SPI_PROCESSOR_SDO <=> pin 38
POCI/SDI <=> SPI_PROCESSOR_SDI <=> pin 43
CLK <=> SPI_PROCESSOR_CLK <=> pin 42
CS <=> D1_PROCESSOR <=> pin 1 (Main Board - Single)
or ...
CS <=> G4_PROCESSOR <=> pin 28 (Main Board - Double)
created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
*/
#include <SPI.h>
#include <SD.h>
//==========ARTEMIS==========
// The microSD Card CS pin is D1 for the MicroMod Main Board - Single and Artemis Processor (D1). Adjust for your processor if necessary.
const int SD_CS_PIN = 1;
// The microSD Card's CS pin is G4 for the MicroMod Main Board - Double and Artemis Processor (D28). Adjust for your processor if necessary.
//const int SD_CS_PIN = 28;
File myFile;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.print("Initializing SD card...");
if (!SD.begin(SD_CS_PIN)) {
Serial.println("initialization failed!");
while (1);
}
Serial.println("initialization done.");
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
myFile = SD.open("test.txt", FILE_WRITE);
// if the file opened okay, write to it:
if (myFile) {
Serial.print("Writing to test.txt...");
myFile.println("testing 1, 2, 3.");
// close the file:
myFile.close();
Serial.println("done.");
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
// re-open the file for reading:
myFile = SD.open("test.txt");
if (myFile) {
Serial.println("test.txt:");
// read from the file until there's nothing else in it:
while (myFile.available()) {
Serial.write(myFile.read());
}
// close the file:
myFile.close();
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
}
void loop() {
// nothing happens after setup
}
Open the Arduino Serial Monitor at 9600 baud. If all goes well, you should see the following output if this is the first time writing to the card! Note that you may see "testing 1, 2, 3." written a few times if you hit the reset button.
language:bash
Initializing SD card...initialization done.
Writing to test.txt...done.
test.txt:
testing 1, 2, 3.
If you are looking to go the extra mile to see if data was saved, close the Serial Monitor and remove power from the MicroMod Main Board. Eject your microSD card from the socket and insert into a microSD card adapter. Then insert the microSD card into your computer's card reader or USB port. Open the test.txt file in a text editor. You should see an output similar to what you saw in the Serial Monitor after the file was opened as shown below. If you let the program run a few times by hitting the reset button or opening the Serial Monitor, you may see it written a few times.
language:bash
testing 1, 2, 3.
Besides verifying the data in the file, this step is also useful if you adjust the code to continuously log data in a CSV format. After logging data, you could the open text document in a spreadsheet and graph the values!
Example 4: Reading and Writing to a MicroSD Card (Low Power)
The example below uses the built-in SD Arduino library like the previous example. However, it toggles the power for the microSD card socket with SD_ENABLE
. The pin is active low so by setting the pin HIGH, power will be disconnected. Make sure to close the file before removing power.
If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Hit the upload button.
language:c
/*
SD Card Read/Write
This example shows how to read and write data to and from an SD card file
The circuit:
SD card attached to SPI bus as follows:
SD Card <=> MicroMod Main Board <=> Artemis Processor Board
-----------------------------------------------------------------
SD ENABLE <=> I2C_SDA1-PROCESSOR <=> pin 9
PICO/SDO <=> SPI_PROCESSOR_SDO <=> pin 38
POCI/SDI <=> SPI_PROCESSOR_SDI <=> pin 43
CLK <=> SPI_PROCESSOR_SCK <=> pin 42
CS <=> D1_PROCESSOR <=> pin 1 (Main Board - Single)
or ...
CS <=> G4_PROCESSOR <=> pin 28 (Main Board - Double)
created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
*/
#include <SPI.h>
#include <SD.h>
//==========ARTEMIS==========
// The microSD Card CS pin is D1 for the MicroMod Main Board - Single and Artemis Processor (D1). Adjust for your processor if necessary.
const int SD_CS_PIN = 1;
// The microSD Card's CS pin is G4 for the MicroMod Main Board - Double and Artemis Processor (D28). Adjust for your processor if necessary.
//const int SD_CS_PIN = 28;
// The microSD Card CS pin is SDA1 for the MicroMod Main Board - Single and Artemis Processor (D9). Adjust for your processor if necessary.
const int SD_ENABLE = 9;
File myFile;
void setup() {
pinMode(SD_ENABLE, OUTPUT); //sets the digital pin as output
digitalWrite(SD_ENABLE, LOW); //Power MicroSD card socket, pin is active low
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.print("Initializing SD card...");
if (!SD.begin(SD_CS_PIN)) {
Serial.println("initialization failed!");
while (1);
}
Serial.println("initialization done.");
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
myFile = SD.open("test.txt", FILE_WRITE);
// if the file opened okay, write to it:
if (myFile) {
Serial.print("Writing to test.txt...");
myFile.println("testing 1, 2, 3.");
// close the file:
myFile.close();
Serial.println("done.");
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
// re-open the file for reading:
myFile = SD.open("test.txt");
if (myFile) {
Serial.println("test.txt:");
// read from the file until there's nothing else in it:
while (myFile.available()) {
Serial.write(myFile.read());
}
// close the file:
myFile.close();
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
digitalWrite(SD_ENABLE, HIGH); //remove power from MicroSD card socket for low power applications
}// end setup()
void loop() {
// nothing happens after setup
}//end loop()
Open the Arduino Serial Monitor at 9600 baud. If all goes well, you should see the same output in the Serial Monitor and data written to the microSD card.
Example 5: MicroMod Main Enable Qwiic Boards
If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Hit the upload button.
language:c
/******************************************************************************
WRITTEN BY: Ho Yun "Bobby" Chan
@ SparkFun Electronics
DATE: 1/3/2023
GITHUB REPO: https://github.com/sparkfun/SparkFun_MicroMod_Main_Board_Single
DEVELOPMENT ENVIRONMENT SPECIFICS:
Firmware developed using Arduino IDE v1.8.12
========== DESCRIPTION==========
This example code toggles the Qwiic Port's AP7347DQ 3.3V voltage
regulator's enable pin. The Qwiic-enabled boards with built-in
power LED should blink. The Main Board's QWC LED will also blink
as well. This example is based on Arduino's built-in Blink Example:
https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
Note that this example code works for both the MicroMod Main Board - Single v2.1
and Double v2.2.
========== HARDWARE CONNECTIONS ==========
MicroMod Artemis Processor Board => MicroMod Main Board - Single => Qwiic Board
Feel like supporting open source hardware?
Buy a board from SparkFun!
MicroMod Artemis Processor Board - https://www.sparkfun.com/products/16401
MicroMod Main Board - Single - https://www.sparkfun.com/products/20748
MicroMod Environmental Function Board - https://www.sparkfun.com/products/18632
SparkFun GPS Breakout - Chip Antenna, SAM-M8Q - https://www.sparkfun.com/products/15210
LICENSE: This code is released under the MIT License (http://opensource.org/licenses/MIT)
******************************************************************************/
/*Define the power enable pin for the processor board for I2C_SCL1-PROCESSOR.
Depending on the processor board, the Arduino pin may be different.*/
//==========ARTEMIS==========
// Qwiic Port's "Qwiic EN" pin <= MicroMod Main Board I2C_SCL1-PROCESSOR => Artemis Processor Board (D8)
#define QWIIC_EN 8
//==========TEENSY==========
// Qwiic Port's "QWIIC_EN" pin <= MicroMod Main Board I2C_SCL1-PROCESSOR => Teensy Processor Board (24)
//#define QWIIC_EN 24
//==========SAMD51==========
// Qwiic Port's "QWIIC_EN" pin <= MicroMod Main Board I2C_SCL1-PROCESSOR => SAMD51 Processor Board (36)
//#define QWIIC_EN 36
//==========ESP32==========
// Qwiic Port's "QWIIC_EN" pin <= MicroMod Main Board I2C_SCL1-PROCESSOR => ESP32 Processor Board (?25??)
//#define QWIIC_EN 25
void setup() {
// initialize the digital pin as an output.
pinMode(QWIIC_EN, OUTPUT);
}
void loop() {
digitalWrite(QWIIC_EN, HIGH); // turn the 3.3V regulator on (HIGH is the voltage level)
delay(5000); // wait for a few seconds to do something with the Qwiic-enabled board(s)
digitalWrite(QWIIC_EN, LOW); // turn the 3.3V regulator off by making the voltage LOW
delay(5000); // wait for a few seconds before turning Qwiic-enabled board(s) back on
}
Once uploaded, check out your Qwiic-enabled board to see if the power LED turns on/off every 5 seconds. Not all boards have an LED populated for power. In that case, you can also check your Main Board's built-in LED labeled as QWC. The LED will also turn on and off.
More Examples!
Sweet! Now that we know that we can read and write to the microSD card, try exploring the other examples in either the SD or SdFat Arduino libraries. Or check out the following MicroMod tutorials that have a built-in microSD card socket for ideas on data logging. Better yet, try adding a sensor and write some code to log some data!
MicroMod Weather Carrier Board Hookup Guide
MicroMod Data Logging Carrier Board Hookup Guide
MicroMod Asset Tracker Carrier Board Hookup Guide
Looking for more examples with a Function Board? Below are a few Function Board examples from our tutorials that are tagged with MicroMod.
1W LoRa MicroMod Function Board Hookup Guide
MicroMod WiFi Function Board - ESP32 Hookup Guide
MicroMod Environmental Function Board Hookup Guide
MicroMod WiFi Function Board - DA16200 Hookup Guide
Better yet, try connecting a Qwiic-enabled device to the Main Board's Qwiic connector. Below are a few examples from our tutorials that are tagged with Qwiic.
Spectral Triad (AS7265x) Hookup Guide
SparkFun Qwiic Digital Temperature Sensor - TMP102 Hookup Guide
Getting Started with the Autonomous Kit for the Sphero RVR
Programming the SparkFun Edge with Arduino
Troubleshooting
If you need technical assistance and more information on a product that is not working as you expected, we recommend heading on over to the SparkFun Technical Assistance page for some initial troubleshooting.
If you don't find what you need there, the SparkFun Forums: MicroMod are a great place to find and ask for help. If this is your first visit, you'll need to create a Forum Account to search product forums and post questions.
Resources and Going Further
Now that you've successfully got your MicroMod Main Board with a Processor Board, it's time to incorporate it into your own project! For more information, check out the resources below:
- MicroMod Main Board - Single V2.1
- MicroMod Main Board - Double V2.2
Looking for more inspiration? Check out these other tutorials related to MicroMod.