Quantcast
Channel: SparkFun Tutorials
Viewing all articles
Browse latest Browse all 1123

1W LoRa MicroMod Function Board Hookup Guide

$
0
0

1W LoRa MicroMod Function Board Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t1996

Introduction

Frequency Operation

This LoRa module can only be used in the 915MHzLoRaWAN frequency band (i.e. 902 to 928 MHz). It is not compatible with other frequency bands; double check the frequency band used in your region. Check out these resources from The Things Network for an unofficial summary of regional radio regulations and list of the regional frequency plans.

The 1W LoRa MicroMod Function Board adds LoRa capabilities to your MicroMod project. It is intended to be used in conjunction with a MicroMod processor board and a MicroMod main board, which provides the electrical interface between a processor board and the function board(s).

SparkFun MicroMod LoRa Function Board

SparkFun MicroMod LoRa Function Board

WRL-18573
$39.95

Match up the board's M.2 edge connector to the slot of the M.2 connector and secure the function board with the screws provided with the main board.

Utilizing the 915M30S LoRa module from EBYTE, which is a 1W (30dBm) transceiver based around the SX1276 from Semtech. There is a robust edge mount RP-SMA connector for large LoRa (915MHz) antennas; with modification, a U.FL connector is also available. We've successfully tested a 12 miles line-of-sight transmission with this module (user results may vary).

With the MicroMod standardization, users no longer need to cross-reference schematics with datasheets, while fumbling around with jumper wires. Simply, match up the function board's M.2 edge connector to the slot of the M.2 connector on the main board and secure the function board with screws. All connections are hardwired to compatible pins of the processor board and the pin connections are standardized for the processor boards.

Required Materials

To get started, users will need a few of the items listed below. (You may already have a some of these items; read through the guide and modify your cart accordingly.)

MicroMod Processor Board

A processor board is required for the MicroMod system to operate. Users can choose a processor board, based upon their needs, to attach to the MicroMod M.2 connector of the main board. Below, are few options:

SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95
SparkFun MicroMod Teensy Processor

SparkFun MicroMod Teensy Processor

DEV-16402
$19.95
2
SparkFun MicroMod nRF52840 Processor

SparkFun MicroMod nRF52840 Processor

WRL-16984
$19.95
SparkFun MicroMod RP2040 Processor

SparkFun MicroMod RP2040 Processor

DEV-17720
$11.95

MicroMod Main Board

A main board provides the electrical connections between the function and processor boards to operate. Users can choose a main board based upon their needs. Below, are few options:

SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Main Board - Double

SparkFun MicroMod Main Board - Double

DEV-18576
$17.95

Required Hardware

A Phillips screw driver is necessary to attach the processor board and function board(s) to the main board. Additionally, a USB-C cable is needed to connect the main board to a computer. The LoRa function board also requires a LoRa antenna for the transceiver to operate.

USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$4.95
3
SparkFun Mini Screwdriver

SparkFun Mini Screwdriver

TOL-09146
$0.95
3

Below, is a selection of our 915MHz frequency band RP-SMA antennas.

Pycom LoRa and Sigfox Antenna Kit - 915MHz

Pycom LoRa and Sigfox Antenna Kit - 915MHz

WRL-14676
$11.95
915MHz LoRa Antenna RP-SMA - 1/2 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/2 Wave 2dBi

WRL-14876
$7.95
915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

WRL-14875
$8.95

Optional Hardware

A LoRa gateway provides internet connection for LoRaWAN network. Below are a few options from our LoRa product category.

Nebra Outdoor HNT Hotspot Miner (915MHz)

Nebra Outdoor HNT Hotspot Miner (915MHz)

WRL-17844
10
LoRa Raspberry Pi 4 Gateway with Enclosure

LoRa Raspberry Pi 4 Gateway with Enclosure

WRL-16447
3
Nebra Indoor HNT Hotspot Miner (915MHz)

Nebra Indoor HNT Hotspot Miner (915MHz)

WRL-17843
13

Users can also use other LoRa boards for peer-to-peer communication. Below are a few options from our LoRa product category.

SparkFun Pro RF - LoRa, 915MHz (SAMD21)

SparkFun Pro RF - LoRa, 915MHz (SAMD21)

WRL-15836
$31.50
SparkFun LoRa Thing Plus - expLoRaBLE

SparkFun LoRa Thing Plus - expLoRaBLE

WRL-17506
$49.95
2
Interface Cable RP-SMA to U.FL

Interface Cable RP-SMA to U.FL

WRL-00662
$4.95
1
915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

WRL-14875
$8.95

To modify the jumpers, users will need soldering equipment and/or a knife.

Solder Lead Free - 100-gram Spool

Solder Lead Free - 100-gram Spool

TOL-09325
$8.95
7
Chip Quik No-Clean Flux Pen  - 10mL

Chip Quik No-Clean Flux Pen - 10mL

TOL-14579
$7.95
4
Weller WLC100 Soldering Station

Weller WLC100 Soldering Station

TOL-14228
$67.95
2
Hobby Knife

Hobby Knife

TOL-09200
$2.95
2

Suggested Reading

The MicroMod ecosystem is a unique way to allow users to customize their project to their needs. Click on the banner below for more information.

MicroMod Logo


For users who aren't familiar with the following concepts, we also recommend reading the following tutorials before continuing.

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

Serial Peripheral Interface (SPI)

SPI is commonly used to connect microcontrollers to peripherals such as sensors, shift registers, and SD cards.

Pulse Width Modulation

An introduction to the concept of Pulse Width Modulation.

Logic Levels

Learn the difference between 3.3V and 5V devices and logic levels.

I2C

An introduction to I2C, one of the main embedded communications protocols in use today.

Analog vs. Digital

This tutorial covers the concept of analog and digital signals, as they relate to electronics.

Processor Interrupts with Arduino

What is an interrupt? In a nutshell, there is a method by which a processor can execute its normal program while continuously monitoring for some kind of event, or interrupt. There are two types of interrupts: hardware and software interrupts. For the purposes of this tutorial, we will focus on hardware interrupts.

SparkFun expLoRaBLE Hookup Guide

Check out our latest LoRaWAN development board with Bluetooth capabilities! With this guide, we'll get you passing data to The Things Network in no time.

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!

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!
New!

MicroMod Main Board Hookup Guide

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). In this tutorial, we will focus on the basic functionality of the Main Board - Single and Main Board - Double.

Installing an Arduino Library

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

Installing Arduino IDE

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

Installing Board Definitions in the Arduino IDE

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.

Hardware Overview

Board Dimensions

The overall board dimensions are roughly 65 x 35 mm with an approximate 6 mm protrusion of the RP-SMA antenna connector.

board dimensions
The dimensions for the LoRa MicroMod Function Board. (Click to enlarge)

M.2 Edge Connector and Screw Slots

Like other function and processor boards, there is a polarized M.2 edge connector, which provides a standardized electrical connection. The attachment points for the screws prevent users from connecting a processor board into a function board slot and vice-versa.

function board attachment points
The Micromod M.2 edge connector and screw slots on the LoRa Function Board. (Click to enlarge)

Power

There is a power status LED to help make sure that your LoRa function board is getting (5V) power. Power is provided through the (MicroMod) M.2 edge connector. The LoRa module is meant to run on 5V with 3.3V logic levels. A jumper is available on the back of the board to remove power to the LED for low-power applications (see the Jumpers section below).

power led
Power LED on the LoRa MicroMod Function Board. (Click to enlarge)

E19-915M30S LoRa Module

Note: The range verification was performed in a clear and open area (direct line-of-sight) with a 5dBi antenna gain, height of 2.5m, and data rate 0.3 kbps. Users results may vary.

The Chengdu Ebyte E19-915M30S RF transceiver module is a 1W 915MHz LoRa module, based on the SX1276 from Semtech. It is FCC, CE, and RoHS certified and has been tested up to a range of 10km by the manufacturer. PLease refer to the datasheet for more details.

  • Global license free ISM 915MHz band
  • 1W maximum transmission power
    • Software multi-level adjustable
  • 256Byte FIFO data buffer

SX1276

The E19-915M30S transceiver is based on the SX1276 chip from Semtech. Please refer to the datasheet for more details.

Part NumberSX1276
Frequency Range137 - 1020 MHz
Spreading Factor6 - 12
Bandwidth7.8 - 500 kHz
Effective Bitrate.018 - 37.5 kbps
Est. Sensitivity-111 to -148 dBm
CharacteristicDescription
Operating Voltage3.3 - 5.5 V
Current Consumption 630 mA (TX)) 23 mA (RX)) 3 µA (Sleep)
Operating Temperature-40 - 85 °C
Operating Humidity[1]10 - 90%
Communication InterfaceSPI (0 - 10 Mbps)
Logic Level3.3 V
Frequency Range900 - 931 MHz
Transmit Power28.5 - 30 dBm (max)
ModulationLoRa, FSK, GFSK, MSK, GMSK, OOK
Data Rate FSK: 1.2 - 300 kbps
LoRa: 0.018 - 37.5 kbps
Antenna Impedance50 Ω

LoRa module
The E19-915M30S RF transceiver module on the LoRa MicroMod Function Board. (Click to enlarge)

Pin Connections

Below is a table of the pin connections available on the E19-915M30S RF transceiver module. However, not all the pins listed are utilized by the LoRa function board (see the Function Board Pinout Table section below).

Pin #Pin NameI/O DirectionPin Description
1GNDGround
2DIO5Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
3DIO4Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
4DIO3Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
5DIO2Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
6DIO1Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
7DIO0Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
8RSTInputReset
9GNDGround
10GNDGround
11VCCInputPower supply: 4.75~5.5V (Ceramic filter capacitoris advised to add)
12SCKInputSPI - Clock Signal
13MISOOutputSPI - Data from Peripheral Device
14MOSIInputSPI - Data to Peripheral Device
15NSSInputSPI - Chip Select
16TXENInputRadio frequency switch control, make sure the TXEN pin is in high level, RXEN pin is in low level when transmitting.
17RXENInputRadio frequency switch control, make sure the RXEN pin is in high level, TXEN pin is in low level when receiving.
18GNDGround
19ANTAntenna
20GNDGround
21GNDGround
22GNDGround

MicroMod Edge Connector

The MicroMod M.2 edge connector provides a standardized interface for the pin connection of a function board.

function board edge connector
The Micromod M.2 edge connector on the LoRa Function Board. (Click to enlarge)

Function Board Pinout Table

The tables below outline the pin on the M2. edge connector and their functions.

AUDIOUARTGPIO/BUSI2CSDIOSPI0Dedicated
FunctionsBottom
Pin
   Top   
Pin
Functions
(Not Connected)75GND
3.3V7473G5 / BUS5
RTC_3V_BATT7271G6 / BUS6
SPI_CS1#SDIO_DATA3 (I/O)7069G7 / BUS7
SDIO_DATA2 (I/O)6867G8
SDIO_DATA1 (I/O)6665G9ADC_D- CAM_HSYNC
SPI_CIPO1SDIO_DATA0 (I/O)6463G10ADC_D+CAM_VSYNC
SPI COPI1SDIO_CMD (I/O)6261SPI_CIPO (I)
SPI SCK1SDIO_SCK (O)6059SPI_COPI (O)LED_DAT
AUD_MCLK (O)5857SPI_SCK (O)LED_CLK
CAM_MCLKPCM_OUTI2S_OUTAUD_OUT5655SPI_CS#
CAM_PCLKPCM_INI2S_INAUD_IN5453I2C_SCL1 (I/O)
PDM_DATAPCM_SYNCI2S_WSAUD_LRCLK5251I2C_SDA1 (I/O)
PDM_CLKPCM_CLKI2S_SCKAUD_BCLK5049BATT_VIN / 3 (I - ADC) (0 to 3.3V)
G4 / BUS44847PWM1
G3 / BUS34645GND
G2 / BUS24443CAN_TX
G1 / BUS14241CAN_RX
G0 / BUS04039GND
A13837USBHOST_D-
GND3635USBHOST_D+
A03433GND
PWM03231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423SWDIO
UART_TX2 (O)2221SWDCK
UART_RX2 (I)2019UART_RX1 (I)
CAM_TRIGD11817UART_TX1 (0)
I2C_INT#1615UART_CTS1 (I)
I2C_SCL (I/0)1413UART_RTS1 (O)
I2C_SDA (I/0)1211BOOT (I - Open Drain)
D0109USB_VIN
SWOG1187GND
RESET# (I - Open Drain)65USB_D-
3.3V_EN43USB_D+
3.3V21GND
LoRa Func. Board PinFunctionBottom
Pin
   Top   
Pin
FunctionsLoRa Func. Board Pin
(Not Connected)-75GND
VIN74733.3V3.3V IN
VCC INVIN7271Power ENPower EN
-7069-
-6665-
-6463-
-6261F7
-6059F6LoRa DIO2
-5857F5LoRa DIO1
-5655F4LoRa RST
-5453F3LoRa RX EN
-5251F2PWMLoRa TX EN
-5049F1SPI_CS0LoRa NSS (CS)
-4847F0INTLoRa DIO0
-4645GND
-4443-
-4241-
EEPROM WP-4039GND
A03837USBHOST_D-
EEPROM A0EEPROM_A03635USBHOST_D+
EEPROM A1EEPROM_A13433GND
EEPROM A2EEPROM_A23231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423I2C_INT
2221I2C_SCLEEPROM SCL
2019I2C_SDAEEPROM SDA
UART_CTS1817
UART_RTS1615UART_RX
1413UART_TX
1211GND
109
87SPI_CIPOLoRa SDO
65SPI_COPILoRa SDI
43SPI_SCKLoRa SCK
21GND
Signal
Group
SignalI/ODescriptionVoltage
Power3.3VI3.3V Source3.3V
GNDReturn current path0V
USB_VINIUSB VIN compliant to USB 2.0 specification. Connect to pins on processor board that require 5V for USB functionality4.8-5.2V
RTC_3V_BATTI3V 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_ENOControls the carrier board's main voltage regulator. Voltage above 1V will enable 3.3V power path.3.3V
BATT_VIN/3ICarrier 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 range3.3V
ResetResetIInput to processor. Open drain with pullup on processor board. Pulling low resets processor.3.3V
BootIInput to processor. Open drain with pullup on processor board. Pulling low puts processor into special boot mode. Can be left NC.3.3V
USBUSB_D±I/OUSB 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 HostUSBHOST_D±I/OFor processors that support USB Host Mode. USB Data±. Differential serial data interface compliant to USB 2.0 specification. Can be left NC.
CANCAN_RXICAN Bus receive data.3.3V
CAN_TXO CAN Bus transmit data.3.3V
UARTUART_RX1IUART receive data.3.3V
UART_TX1OUART transmit data.3.3V
UART_RTS1OUART ready to send.3.3V
UART_CTS1IUART clear to send.3.3V
UART_RX2I2nd UART receive data.3.3V
UART_TX2O2nd UART transmit data.3.3V
I2CI2C_SCLI/OI2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDAI/OI2C data. Open drain with pullup on carrier board3.3V
I2C_INT#IInterrupt notification from carrier board to processor. Open drain with pullup on carrier board. Active LOW3.3V
I2C_SCL1I/O2nd I2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDA1I/O2nd I2C data. Open drain with pullup on carrier board.3.3V
SPISPI_COPIOSPI Controller Output/Peripheral Input.3.3V
SPI_CIPOISPI Controller Input/Peripheral Output.3.3V
SPI_SCKOSPI Clock.3.3V
SPI_CS#OSPI Chip Select. Active LOW. Can be routed to GPIO if hardware CS is unused.3.3V
SPI/SDIOSPI_SCK1/SDIO_CLKO2nd SPI Clock. Secondary use is SDIO Clock.3.3V
SPI_COPI1/SDIO_CMDI/O2nd SPI Controller Output/Peripheral Input. Secondary use is SDIO command interface.3.3V
SPI_CIPO1/SDIO_DATA0I/O2nd SPI Peripheral Input/Controller Output. Secondary use is SDIO data exchange bit 0.3.3V
SDIO_DATA1I/OSDIO data exchange bit 1.3.3V
SDIO_DATA2I/OSDIO data exchange bit 2.3.3V
SPI_CS1/SDIO_DATA3I/O2nd SPI Chip Select. Secondary use is SDIO data exchange bit 3.3.3V
AudioAUD_MCLKOAudio master clock.3.3V
AUD_OUT/PCM_OUT
I2S_OUT/CAM_MCLK
OAudio data output. PCM synchronous data output. I2S serial data out. Camera master clock.3.3V
AUD_IN/PCM_IN
I2S_IN/CAM_PCLK
IAudio data input. PCM syncrhonous data input. I2S serial data in. Camera periphperal clock.3.3V
AUD_LRCLK/PCM_SYNC
I2S_WS/PDM_DATA
I/OAudio left/right clock. PCM syncrhonous data SYNC. I2S word select. PDM data.3.3V
AUD_BCLK/PCM_CLK
I2S_CLK/PDM_CLK
OAudio bit clock. PCM clock. I2S continuous serial clock. PDM clock.3.3V
SWDSWDIOI/OSerial Wire Debug I/O. Connect if processor board supports SWD. Can be left NC.3.3V
SWDCKISerial Wire Debug clock. Connect if processor board supports SWD. Can be left NC.3.3V
ADCA0IAnalog to digital converter 0. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
A1IAnalog to digital converter 1. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
PWMPWM0OPulse width modulated output 0.3.3V
PWM1OPulse width modulated output 1.3.3V
DigitalD0I/O General digital input/output pin.3.3V
D1/CAM_TRIGI/OGeneral digital input/output pin. Camera trigger.3.3V
General
Bus
G0/BUS0I/OGeneral 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/BUS1I/O3.3V
G2/BUS2I/O3.3V
G3/BUS3I/O3.3V
G4/BUS4I/O3.3V
G5/BUS5I/O3.3V
G6/BUS6I/O3.3V
G7/BUS7I/O3.3V
G8I/OGeneral purpose pin3.3V
G9/ADC_D-
CAM_HSYNC
I/ODifferential ADC input if available. Camera horizontal sync.3.3V
G10/ADC_D+
CAM_VSYNC
I/ODifferential ADC input if available. Camera vertical sync.3.3V
G11/SWOI/OGeneral purpose pin. Serial Wire Output3.3V

EEPROM

There is an I2C serial EEPROM on the LoRa function board. It has been reserved for future use, but users have access to it. A jumper is available on the back of the board to write protect the EEPROM (see the Jumpers section below).

EEPROM
EEPROM on the LoRa MicroMod Function Board. (Click to enlarge)

RP-SMA Antenna Connector

Warning: Users should attach the antenna before powering their LoRa function board. Transmitting without an antenna connected may potentially damage the transceiver module.

The LoRa function board features a sturdy RP-SMA antenna connector for users to attach an antenna of their choice. While this antenna connector is fairly robust, users should not expect to leverage a lot of weight off of it.

The edge-type antenna connector allows for the threads to protrude just beyond the edge of the board. Along with the dimensions of the LoRa function board, this feature is designed so that the connection also extends past the edge of the main board that the function board interfaces with; and is therefore, well suited to be used with an enclosure.

Antenna Connector
RP-SMA antenna connector on the LoRa MicroMod Function Board. (Click to enlarge)

Note: Users who wish to use the u.FL connector can modify the position of this 0Ω resistor. Due to the size and position of the resistor, we only recommended for highly experience soldering experts attempt this modification. More novice users could potentially damage their LoRa function board if they attempt this modification.

antenna jumper
Antenna select jumper on the E19-915M30S RF transceiver module. (Click to enlarge)

Jumpers

There are three jumpers available on the LoRa function board.

LED Power

For more low power projects, the PWR jumper can be cut to remove power from the red power LED.

LED power jumper
LED power jumper on the LoRa MicroMod Function Board. (Click to enlarge)

Current Measurement

For users who would like to measure the current going to LoRa function board, the MEAS jumper can be cut and used for measurements. This jumper is only connected to the 5V power, which is used by only the E19-915M30S RF transceiver module and power LED.

Current measurement jumper
Current measurement jumper on the LoRa MicroMod Function Board. (Click to enlarge)

EEPROM Write Protection

To permanently write protect the EEPROM on the LoRa function board, users can bridge the WP jumper.

EEPROM WP jumper
EEPROM WP jumper on the LoRa MicroMod Function Board. (Click to enlarge)

Software Overview

Getting Started with MicroMod

For those unfamiliar with the MicroMod ecosystem, be sure to review the Getting Started with MicroMod guide. Also, make sure that the correct board definitions are installed in the Arduino IDE, for the associated processor board.

Getting Started with MicroMod

October 21, 2020

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

Programming

Note: Make sure that the correct board definitions are installed in the Arduino IDE, for the connected processor board. Depending on the processor board, users may need to install drivers (if they have not done so already). For help installing board definitions, use the MicroMod processor boards landing page and review the associated hookup guide for that hardware.

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 Library

Note: The example for this tutorial assumes users have the latest version of the Arduino IDE installed. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide:

Installing an Arduino Library

January 11, 2013

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

SparkFun External EEPROM Arduino Library

We've written a library to easily get setup and read/write data on the EEPROM. You can install this library through the Arduino Library Manager. Search for SparkFun External EEPROM Arduino Library and you should be able to install the latest version. If you prefer manually downloading the libraries from the GitHub repository, you can grab them here:

For more details on this Arduino library and its use, please refer to the Serial EEPROM hookup guide:

Reading and Writing Serial EEPROMs

August 11, 2017

EEPROM is a great way to add extra memory to your microcontroller project. Wait 'til you see how easy it is to use!

RadioLib Arduino Library

The RadioLib library provides support for peer-to-peer RF communication with the 1W LoRa MicroMod Function Board. Users can install this library through the Arduino Library Manager. Search for RadioLib and you should be able to install the latest version. If you prefer manually downloading the libraries from the GitHub repository, you can grab them here:

Note: Peer-to-peer refers to direct RF communication using a specific modulation protocol (similar to a 2-way walkie talkie); and is not to be confused with a mesh network or LoRaWAN network integration.

For more details on this Arduino library, check out the Arduino reference page, the API refernce page, and GitHub repository. Additional specifics of the library that users may be interested in can be found in the links below:

Hadware Assembly

For those unfamiliar with the MicroMod ecosystem, be sure to review the Getting Started with MicroMod guide.

Getting Started with MicroMod

October 21, 2020

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

Processor Board and Main Board

To get started users will need a compatible processor and main board. Insert the MicroMod processor board into the M.2 socket for the processor board at an angle, with its edge connector aligned to the matching slots.

Note: The dimensions of the processor board's edge connector prevents it from mating with the slots of the M.2 socket in reverse. As an extra safeguard, the screw insert is spaced to only match the screw key of MicroMod processor boards.

When inserted properly, the processor board will rest at an angle:

MicroMod processor board inserted into the carrier board
Inserting a processor board into the M.2 socket. (Click to enlarge)

To secure the processor board, gently hold down on the board and attach the M.2 screw with a Phillip's head (PH0 or PH1) screw driver. Below, is an example of an assembled MicroMod system:

MicroMod processor board attached to the Qwiic carrier board
A processor board attached to the MicroMod Qwiic Carrier Board. (Click to enlarge)

Function Board and Main Board

Warning: The LoRa module is susceptible to electrostatic discharge. Therefore, it is recommended that users a static discharge strap, like the one included in the iFixit Pro Tech Toolkit.


Static discharge strap in the upper righthand corner. (Click to enlarge)

Users should also address any humidity and temperature concerns, when utilizing the LoRa function board.

Note: The dimensions of the function board's edge connector prevents it from mating with the slots of the M.2 socket in reverse. As an extra safeguard, the screw inserts are spaced to only match the screw key of MicroMod function board.

Similarly to the processor board, insert the MicroMod function board into the M.2 socket for the function board at an angle, with its edge connector aligned to the matching slots.

When inserted properly, the function board will rest at an angle:

MicroMod function board inserted into the main board
Inserting a function board into the M.2 socket. (Click to enlarge)

To secure the function board, gently hold down on the board and attach the M.2 screw with a Phillip's head (PH0 or PH1) screw driver. Below, is an example of an assembled MicroMod system:

MicroMod function board attached to the main board
A function board attached to the MicroMod Main Board. (Click to enlarge)

Don't forget to attach the antenna for the LoRa function board. Transmitting or powering the LoRa module without an attached antenna has the potential to permanently damage the transceiver.

Fully assembled main board with processor board and function board
Fully assembled main board with processor board and function board. (Click to enlarge)

Main Board Example - Pin Connection Table

This table summarizes the pins utilized on the LoRa function board's MicroMod edge connector and their connections to the main board's processor pins; based on the slot that the LoRa function board is inserted to.

Function Board
Pin Name
MicroMod
Pin Number
I/O
Direction
Description Main Board's
Processor Pin
Slot 0Slot 1
VCC72Input Power supply: 4.75~5.5V
  • Power LED
  • Transceiver's Power
-
3.3V73Input Power supply: 3.3V
  • EEPROM's Power
  • Logc-level conversion
-
GND11-Ground-
Power Enable71InputControls the 3.3V power6866
SCK3InputSPI - Clock signal for transceiverSCK (57)
CIPO7OutputSPI - Data from transceiverCIPO (59)
COPI5InputSPI - Data to transceiverCOPI (61)
NSS49 (F1)InputSPI - Chip select for transceiverCS0 (55)CS1 (70)
RST55 (F4)InputResets transceiverG1 (42)G6 (71)
DIO047 (F0) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).D0 (10)D1 (18)
DIO157 (F5) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).G2 (44)G7 (69)
DIO259 (F6) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).G3 (46)G8 (62)
TXEN51 (F2)InputTransceiver's RF control switch: The TXEN pin is in high level, RXEN pin is in low level when transmitting.PWM0 (32)PWM1 (47)
RXEN53 (F3)InputTransceiver's RF control switch: The RXEN pin is in high level, TXEN pin is in low level when receiving.G0 (40)G5 (73)
SCL21InputI2C - Clock signal for EEPROMSCL (14)
SDA19 Input
Output
I2C - Data signal for EEPROMSDA (12)
EEPROM WP40InputControls the write protection pin for the EEPROM. Pull low to enable.-
EEPROM A06InputControls EEPROM's I2C address configuration.-
EEPROM A14InputControls EEPROM's I2C address configuration.-
EEPROM A22InputControls EEPROM's I2C address configuration.-

Programming

To program the processor board utilized on the Main Board; connect the board to a computer with a USB-C cable. Depending on the processor board, users may need to install drivers (if they have not done so already).

Note: Make sure that the correct board definitions are installed in the Arduino IDE, for the selected processor board. For help installing board definitions, use the MicroMod processor boards landing page and review the associated hookup guide for that hardware.

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.

Example

Peer-to-Peer Communication

Note: The example codes assume that the LoRa function board is inserted into the 0function board slot of the main board.

The example codes below, allow users to communicate between two LoRa function boards. Simply download, extract the files, and upload the code the main board with associated processor and function boards.

Additional examples have also been provided for users who would like to use their expLoRable (LoRa Thing Plus) board to communicate with a LoRa function board.

The example codes were tested under the following parameters:
  • Arduino IDE version: 1.8.16
    • If not using the Teensy - Windows App Store version 1.8.51.0
  • RadioLib Library version: 4.6.0
  • MicroMod Processor Boards and Arduino Cores:
    ProcessorBoard Definition
    RP2040Arduino Mbed OS RP2040 Boards version: 2.5.2
    ESP32esp32 version: 2.0.0
    STM32SparkFun STM32 Boards version: 2.0.0
    ArtemisSparkFun Apollo3 Boards version: 2.1.1
    SAMD51SparkFun SAMD Boards (dependency Arduino SAMD Boards version 1.8.1) version: 1.8.5
    • Requires - Arduino SAMD Boards (32-bit ARM Cortex-M0+) version: 1.8.11
    nRF52840[DEPRECATED - Please install standalone packages] Arduino Mbed OS Boards version: 1.3.1
    TeensyTeensyduino version: 1.55

Once uploaded, users can open the serial monitor to view the progress of the data transmission or reception. When using the RP2040 processor board, the example code will wait until the Serial Monitor is opened to execute the code and transmit/receive data.

peer-to-peer data transmission example
An example of the data transmission between an expLoRaBLE board and the LoRa MicroMod Function Board in the Serial Monitor. (Click to enlarge)

Code Breakdown

In order to get the built-in example for the RadioLib library working, a few changes needed to be made. Below, is a short explanation of the modifications made to the example code that we provide (see above), to include compatibility with all the available processor boards.

CS Pin Definition

The SPI library for the Arduino IDE, by default expects the chip select pin to be defined as PIN_SPI_SS. However, this pin definition is different for the ESP32 and Artemis (Apollo3) Arduino cores. Therefore, the code below was inserted to allow the code to compile for all the various processor boards.

language:c
// Redefine CS Pin Name
// SPI_CS0:     ESP32
// SS:          ESP32, nRF, RP2040
// SPI_CS:      Artemis
// PIN_SPI_SS:  STM32, SAMD51, nRF, RP2040

#ifndef PIN_SPI_SS
    // For Artemis
    #ifdef SS
        #define PIN_SPI_SS SPI_CS
    #endif
    // For ESP32
    #ifdef SPI_CS0
        #define PIN_SPI_SS SS
    #endif
#endif
MicroMod Pin Names

Unfortunately, for the RP2040 MicroMod processor board hasn't been included in the MbedOS Arduino core; current progress is on hold(please refer to this issue in the GitHub repository). However, with the modifications below, the RP2040 Pico board definition can be used.

By using the RP2040 Pico board definition, the generic MicroMod processor board's pin names obviously can't be used. Therefore, all the pins must be declared by their GPIO pin numbers. In addition, the default pin connections for the SPI bus on the RP2040 MicroMod processor board differs from the RP2040 Pico. To accommodate for the different pin connections, a custom SPI object was created and passed into the library.

language:c
// SX1276 pin connections:
//       | SLOT 0 | SLOT 1 |
//==========================
// cs    |   CS0  |   CS1  |
// dio0  |   D0   |   D1   |
// dio1  |   G2   |   G7   |
// dio2  |   G3   |   G8   |
// rst   |   G1   |   G6   |
// tx_en |  PWM0  |  PWM1  |
// rx_en |   G0   |   G5   |

#if defined(ARDUINO_RASPBERRY_PI_PICO)
    // MM RP2040 Processor Board (Using RP2040 Pico board definition)
    int pin_cs = 21;
    int pin_dio0 = 6;
    int pin_tx_enable = 13;
    int pin_rx_enable = 16;
    int pin_nrst = 17;
    int pin_dio1 = 18;

    // Redefine SPI pins
    int miso = 20;
    int mosi = 23;
    int sck = 22;

    // Custom SPI object
    MbedSPI SPI_mm(miso, mosi, sck);

    SX1276 radio = new Module(pin_cs, pin_dio0, pin_nrst, pin_dio1, SPI_mm);

#else

Similarly to the RP2040, the Teensy MicroMod processor board definition doesn't include the generic MicroMod processor board pin names yet (we are currently working on this update). Therefore, all the pins must be declared by their pin numbers.

language:c
    #if defined(ARDUINO_TEENSY_MICROMOD)
        // MM Teensy Processor Board
        int pin_cs = 10;
        int pin_dio0 = 4;
        int pin_tx_enable = 3;
        int pin_rx_enable = 40;
        int pin_nrst = 41;
        int pin_dio1 = 42;

    #else
RP2040 Special Consideration

As mentioned above, a custom SPI object was created and passed into the library for the RP2040 MicroMod processor board. However, the library doesn't initialize the SPI bus when it is passed in. Therefore, the setup() loop includes a modification to start the SPI bus operation.

In our testing, the RP2040 MicroMod processor board had issues with the printouts on the serial port. Adding a while() statement to wait for the serial port to be accessed by the Serial Monitor, resolved the issue.

language:c
#if defined(ARDUINO_RASPBERRY_PI_PICO)
    // Wait for serial monitor/port to open
    while (!Serial){
        ; // wait for serial port
    }

    // Start SPI bus
    SPI_mm.begin();
#endif
Enabling the STM32 Serial Port

When uploading to the provided example code (see above) to the STM32 MicroMod processor board, users will need to enable the serial port on the processor board. Otherwise, when the Serial Monitor is opened, nothing will appear. The following settings must be used in the in the Tools drop down menu:

STM32 serial port configuration
The STM32 MicroMod processor board settings in the Tools drop-down menu to enable the microcontroller's serial port. (Click to enlarge)

Resources and Going Further

For more information on the SparkFun 1W LoRa Function Board, check out the links below:

Hardware Documentation:

MicroMod Documentation:

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

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!

MicroMod Artemis Processor Board Hookup Guide

Get started with the Artemis MicroMod Processor Board in this tutorial!

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!

SparkFun MicroMod Input and Display Carrier Board Hookup Guide

A short Hookup Guide to get started with the SparkFun MicroMod Input and Display Carrier Board

MicroMod Machine Learning Carrier Board Hookup Guide

Get hacking with this tutorial on our Machine Learning Carrier Board!

Qwiic Carrier Board Hookup Guide

The Qwiic carrier board is the latest way to rapid prototype with the included M.2 socket to swap processor boards and Qwiic connectors to easily connect I2C devices.

MicroMod Update Tool Hookup Guide

Follow this guide to learn how to use the MicroMod Update Tool to interact directly with the UART on the MicroMod Asset Tracker's SARA-R5. Using this board you can talk directly to the module using u-blox's m-center software as well as update the firmware using EasyFlash.

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.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado


Viewing all articles
Browse latest Browse all 1123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>