Development Environment
This chapter explains how to install all required dependencies.
- Arduino IDE
- AVR-IoT Cellular Library
- (OPTIONAL) MPLAB Data Visualizer (or any other COM port reader)
Arduino IDE
The DxCore must be installed in Arduino for the firmware to work. Even if Arduino is already installed on your system, read through this section to make sure all dependencies are installed.
Step 1: Install the Arduino IDE
Download: Arduino IDE
The Arduino IDE is a set of tools to develop, compile and upload Arduino code onto compatible devices.
Install the Arduino IDE through the installation given on the Arduino website. If you are unfamiliar with Arduino, see the Arduino Introductory Guide.
Step 2: Install the DxCore
Download: SpenceKonde/DxCore
In Arduino, a core is a piece of middleware that translates Arduino calls to the appropriate calls for the target MCU. For instance, a digitalWrite(PB5, HIGH)
gets translated into PORTB.OUT |= (1 << 5)
. The Arduino firmware running on the cellular board uses the SpenceKonde/DxCore core to achieve this translation.
Install the core by following the official instructions at the DxCore's GitHub page.
The installation instructions from the DxCore's GitHub page list a boards manager URL. This URL is at the moment not working.
We've provided an alternative which can be used instead: https://raw.githubusercontent.com/bobcmartin/DxCore/package_DxCore2_index/package_dxcore_install.json
Step 3: Configuring the Arduino IDE
Some settings must be set in the Arduino IDE for the library to function.
- Set the Board to AVR DB-Series (no bootloader)
Tools -> Board -> DxCore -> AVR DB-series (no bootloader)
- Set the Chip to AVR128DB48
Tools -> Chip -> AVR128DB48
- Set the Wire Library mode to 2x Wire, Master or Slave
Tools -> Wire Library mode -> 2x Wire, Master or Slave
- Set the Port to the port the device is at (for more information, look here).
Tools -> Port -> your device port
- Set the Programmer to Curiosity Nano
Tools -> Programmer -> Curiosity Nano
- Optional: Set printf() to Full to be able to print floats
Tools -> printf() -> Full, 2.6k, prints floats
Installing the AVR-IoT Cellular Library
This library is available in the Arduino Library Manager. If you want to install this library manually, follow the Manual install section below.
In Arduino IDE, click on the Tools > Manage libraries... dropdown menu. Then search for AVR-IoT Cellular as depicted in the screenshot below and click Install.
Manual install
In the Arduino IDE, several library examples can be found under File -> Examples -> AVR-IoT-Cellular
.
MPLAB Data Visualizer (Optional)
This dependency is optional, as the UART logs can also be read using the web based serial terminal or the Arduino IDE.
Download: MPLAB Data Visualizer
The MPLAB Data Visualizer is a tool used to communicate with Microchip solutions. For this particular board, it has two use-cases:
- Output logs from the board through a virtual COM-port and UART.
- Visualizing sensor data as a graph using the data streamer protocol.
For more information, see the MPLAB Data Visualizer User Guide.
Bonus Tip: Visual Studio Code
It's possible to use Visual Studio Code instead of the Arduino IDE through the Arduino Plugin.
The settings in Step 3: Configuring the Arduino IDE must be applied in VSCode. To set these settings, open the board configuration menu. The default shortcut is CTRL+SHIFT+P
.
For speeding up compilation times when utilizing the Arduino extension within VS Code, it's necessary to specify a build folder. In order to do this, you have to modify the .vscode/arduino.json
file within your workspace (where the sketch is located) and append "output": "./build"
. Your configuration should look something like this: