A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.sparkfun.com/tutorials/2683 below:

MicroMod Main Board Hookup Guide V2

Contributors:

bboyho

,

Elias The Sparkiest Introduction Note:

This tutorial is for the MicroMod Main Board - Single V2.1 and Double V2.2. For users with the older versions of the Main Boards, make sure to check out the

older tutorial

.

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.

SparkFun MicroMod RP2040 Processor DEV-17720

The SparkFun MicroMod Pi RP2040 Processor Board is a low-cost, high-performance board with flexible digital interfaces featur…

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.

Pocket Screwdriver Set TOL-12891

What should every hacker have available to them? That's right, a screwdriver (you have to get into those cases somehow). What…

MicroMod Screwdriver TOL-19012

This is a pocket size magnetic tip Philips head screwdriver designed to be used specifically with the MicroMod ecosystem.

SparkFun Mini Screwdriver TOL-09146

This is just your basic reversible screwdriver - pocket sized! Both flat and phillips heads available. Comes with pin clip an…

microSD USB Reader COM-13004

This is an awesome little microSD USB reader. Just slide your microSD card into the inside of the USB connector, then stick t…

Retired 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.

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?

What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

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:

Revision Changes

The following changes to the Main Board Single V2.1 and Main Board Double V2.2 include:

Power

There are two ways to power the Main Boards, Processor Board, and Function Board(s).

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.

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:

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:

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.

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.

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).

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.

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: Not highlighted are the Processor Board's secondary I2C pins. Note that the "I2C_SCL1" pin is also connected to the Qwiic connector's 3.3V voltage regulator (i.e. "QWIIC_EN"). Additionally, the I2C_SDA1 is connected to the microSD card socket's transistor to toggle power (i.e. SD_ENABLE).

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.

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.

Note: You'll notice that the Main Boards have the USB C connector, microSD card socket, and Qwiic connector on one side of the board. This is part of the design for users that decide to place the MicroMod Main Board in an enclosure!

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.

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.

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

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

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 Note:

For the MicroMod Teensy, make sure to check out the SdFat library included with the Teensyduino add-on. Once the board is selected, head to the menu to open the examples (

File

>

Examples

>

SD

). You'll need to modify the defined pin from:

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).

Note: The SPI pins will be defined as macros with your processor's board definitions so we won't need to define PICO, POCI, or CLK pins. Sweet!

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 Asset Tracker Carrier Board Hookup Guide

Get started with the SparkFun MicroMod Asset Tracker Carrier Board following this Hookup Guide. The Asset Tracker uses the u-blox SARA-R510M8S LTE-M / NB-IoT module to provide a host of data communication options.

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

Everything you need to get started with the 1W LoRa MicroMod function board; a MicroMod function board that provides LoRa capabilities for your MicroMod project. Must be used in conjunction with a MicroMod main board and processor.

MicroMod WiFi Function Board - ESP32 Hookup Guide

The MicroMod ESP32 Function Board adds additional wireless options to MicroMod Processor Boards that do not have that capability. This special function board acts as a coprocessor that takes advantage of Espressif's ESP32 WROOM to add WiFi and Bluetooth® to your applications.

MicroMod Environmental Function Board Hookup Guide

The SparkFun MicroMod Environmental Function Board adds additional sensing options to the MicroMod Processor Boards. This function board includes three sensors to monitor air quality (SGP40), humidity & temperature (SHTC3), and CO2 concentrations (STC31) in your indoor environment. To make it even easier to use, all communication is over the MicroMod's I2C bus! In this tutorial, we will go over how to connect the board and read the sensors.

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.

Qwiic Accelerometer (MMA8452Q) Hookup Guide

Freescale’s MMA8452Q is a smart, low-power, three-axis, capacitive micro-machined accelerometer with 12-bits of resolution. It’s perfect for any project that needs to sense orientation or motion. We’ve taken that accelerometer and stuck it on a Qwiic-Enabled breakout board to make interfacing with the tiny, QFN package a bit easier.

Pro Micro RP2040 Hookup Guide

This tutorial covers the basic functionality of the Pro Micro RP2040 and highlights the features of the dual-core ARM Cortex-M0+ processors development board. Get started with the first microcontroller from the Raspberry Pi Foundation!

Troubleshooting Not working as expected and need help?

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:

Looking for more inspiration? Check out these other tutorials related to MicroMod.

1W LoRa MicroMod Function Board Hookup Guide

Everything you need to get started with the 1W LoRa MicroMod function board; a MicroMod function board that provides LoRa capabilities for your MicroMod project. Must be used in conjunction with a MicroMod main board and processor.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4