1W LoRa MicroMod Function Board Hookup Guide

Pages
Contributors: Nate, santaimpersonator
Favorited Favorite 0

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:

LoRaWAN Library

The MCCI LoRaWAN LMIC Library library provides support for an end node/device (i.e. 1W LoRa MicroMod Function Board) integration into a LoRaWAN network and communication with a LoRaWAN server. Users can install this library through the Arduino Library Manager. Search for MCCI LoRaWAN LMIC 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:

Notes:
  • Initially we were inclined to utilize the Arduino-LMIC library. However, we followed the repository's recommendation and chose to utilize the MCCI LoRaWAN LMIC Library instead.
  • Support for this library has only been confirmed with The Things Stack - Community Edition's (i.e. V3 or previously TTN) and Helium's servers.
  • To utilize this library, users are expected to be able to modify various files for regional configuration and compatibility with specific processor boards.
  • We assume that users are familiar with the device registration process for each LoRaWAN server. For more information, please refer to the LoRaWAN server's documentation:
    • Helium Device Registration
      • Usage Cost: 1 Data Credit (1 DC = 0.001ยข in USD) per packet (up to 24 bytes)
      • After a device is first added/registered to an account, it takes approx. 20 min for it to get added to the blockchain. Until then, hotspots will not recognize the device and relay its data packets.
    • The Things Stack Device Registration:
      • The information below also assumes that users have migrated to and are currently using The Things Stack Community Edition (or V3).
      • When manually registering a device on The Things Stack, users will need to set the LoRaWAN version to MAC V1.0.3 (per the library specifications).
      • Devices registered with the V3 console will only work with gateways on the V3 console. (i.e. Data transmissions from a device registered on the V3 console will not be passed to the server, if its transmissions are only received by a gateway on registered to the V2 console.)
Warning: The Helium network is a pay-to-use 3rd party service, which does involve the use of cryptocurrency. Please, use at your own discretion.
  • We have no control over its service.
  • We are not liable for any customer's choice to utilize the network.
  • The cryptocurrency market valuation can be volitile.
  • There may be legal and financial implications for digital wallets.
  • etc.

To be able to utilize this library with the 1W LoRa function board and various MicroMod processor boards, users will need to make the following modifications to the library's files:

Regional Configuration

In the lmic_project_config.h file make sure that #define CFG_us915 1 and #define CFG_sx1276_radio 1 are uncommented.

language:c
// project-specific definitions
//#define CFG_eu868 1
#define CFG_us915 1
//#define CFG_au915 1
//#define CFG_as923 1
// #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP      /* for as923-JP; also define CFG_as923 */
//#define CFG_kr920 1
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS
Processor Board Compatibility
nRF52840 Processor Board

In the hal.cpp file, users will need to modify lines 368-370 (based on the default code) to provide compatibility with the nRF52840 processor board to the library:

language:c
#if !defined(ARDUINO_ARDUINO_NANO33BLE)
void hal_sleep () {
    // Not implemented
}
#endif // !defined(ARDUINO_ARDUINO_NANO33BLE)
Artemis Processor Board
Note: Currently, the Apollo3 Arduino core does not support the use of the noInterrupts() and Interrupts() functions. There is already an issue filed with the GitHub repository. Once this issue has been resolved, the modifications below will no longer be necessary.

In the hal.cpp file, users will need to modify lines 339-347 (based on the default code) to provide compatibility with the Artemis processor board to the library:

language:c
void hal_disableIRQs () {
    #if !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)
        noInterrupts();
    #endif // !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)

    irqlevel++;
}

void hal_enableIRQs () {
    if(--irqlevel == 0) {
        #if !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)
            interrupts();
        #endif // !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)
ES32 Processor Board

In reference to issue #714 for the library, users will need to add the following lines to the end of lmic_project_config.h file, which is the same file used for the regional configuration.

language:c
#if defined(ARDUINO_ESP32_MICROMOD)
    #define hal_init LMICHAL_init  // ESP32: https://github.com/mcci-catena/arduino-lmic/issues/714
#endif // defined(ARDUINO_ESP32_MICROMOD)