Programming Resources

Bootloader

The bootloader is a permanent part of FLASH memory that’s executed before anything else. The bootloader’s main responsibility is to update the other software (Radiocrafts Platform and the ICI application). It’s also responsible for enforcing encryption and security on the module and the applications. The bootloader is capable of:

  • Loading the ICI application onto the module via UART

  • Loading the platform image onto the module via UART

  • Locking the module

  • Using encryption keys

  • Loading the ICI application onto the module from internal FLASH (when using OTA)

  • Loading the platform image onto the module from internal FLASH (when using OTA)

  • Printing module info

See the RIIM SDK User Manual for more information.

Configuring and Programming the Module

Each module comes pre-programmed with firmware for the network stack, drivers, and application framework. Based on this, the customer can program the behavior of each device using a simple API. This eliminates the need for an external MCU. For developing the ICI application and programming the module, the user is provided with an SDK. This is described in the RIIM SDK User Manual. The ICI application is transferred to the module via UART through the built-in bootloader.

Connecting Peripherals

RIIM modules provide many standard electrical interfaces that the user can connect peripherals to. The API includes drivers for all of them, and they consist of easy-to-use functions implemented in efficient C code. The figure shows the pinout and the available interfaces:

RC1882-IPM module pinout

RC1882-IPM module pinout

GPIO

9 GPIOs (GPIO_0 – GPIO_8) are available to the user. They can be configured as input, push-pull output or open-drain output, with optional pull resistors on inputs. They operate at the module’s supply voltage; care must be taken not to exceed this level.

In addition to simple input/output, GPIOs support:

  • Interrupt handlers — register a callback triggered on rising, falling, or both edges.

  • PWM output — GPIO.startPWM() generates a hardware PWM signal with configurable frequency and duty cycle. Only one pin can output PWM at a time.

SPI

The module includes one 4-wire Serial Peripheral Interface (SCLK, MOSI, MISO). The clock frequency is set in Hz when calling SPI.init(). Chip select is not part of the SPI module; use a GPIO pin for chip select, which allows several SPI devices to share the same bus.

I2C

The Inter-Integrated Circuit (I2C) bus includes internal 4.7 kΩ pull-up resistors and operates at the module’s supply voltage. It supports both 100 kHz (standard) and 400 kHz (fast) modes, as well as clock stretching. The module always operates as the I2C master.

ADC

The module provides two external ADC channels (ADC0 and ADC1). Each channel can be configured with one of two voltage references:

  • ADC_FIXED_REFERENCE — fixed internal reference of 4.3 V (Warning: Still, do not exceed maximum GPIO voltage! The pin does not tolerate higher voltages.)

  • ADC_BATTERY_REFERENCE — scales with the supply voltage, useful for battery monitoring

The ADC.convertToMicroVolts() function returns the measured voltage in µV directly, avoiding manual scaling.

UART

The primary UART supports the standard serial port protocol (RS232-compatible). It can be connected to sensors, GPS modules, terminal programs, or similar. By enabling the CTS pin as an RXTX control line, the UART can drive an RS485 half-duplex bus.

SECUART

The secondary UART (SECUART) uses dedicated pins separate from the primary UART, and is available regardless of whether SLIP is in use on the primary UART. It supports the same baud rate, parity, data bits, and stop bit options as the primary UART.

SECUART has two additional capabilities:

  • RS485 half-duplex control — SECUART.enableRXTX(true) toggles the CTS/RXTX pin automatically around each transmission, driving an RS485 transceiver without additional GPIO logic.

  • Wake-on-UART — SECUART.wakeOnUART() registers a callback that fires when activity is detected on the SECUART RX pin, enabling the module to wake from a low-power sleep state on incoming serial data.

Note

SECUART is available from platform version 4.1.0 onwards.

Internal module resources

EEPROM

The RC18xxCEF-IPM module (note the E) includes an I2C EEPROM. This is the Microchip 24AA32A. This EEPROM has the I2C address of 0x50 (0b1010000x). Please see the EEPROM datasheet for details and use the ICI I2C API for interfacing this EEPROM. The EEPROM is exclusively for user data and isn’t used by any on-board Radiocrafts functions.

OTA (Over the Air Download)

OTA is part of the Radiocrafts Platform firmware. When radio packets containing firmware are received, they’re stored in the FLASH memory. The firmware is updated after a reset if the entire firmware is received and is error-free. Both the Radiocrafts Platform and the ICI application can be updated using OTA. Security can be ensured by using encrypted images.

Border Router Functions

A typical border router is shown below. This is basically how the Radiocrafts RIIM Border Router Concept is designed and is all that’s needed to realize a complete border router. In fact, you can do without the USB connection as well.

Border Router logical layout

Border Router logical layout

The Border Router uses the RC1882CEF-IPM module to realize all functionality needed for the Border Router and the interface towards the local network or internet. For easy integration and stand-alone operation, it can be connected to an Ethernet MAC/PHY IC via SPI, such as the Microchip ENC28J60. It’s also possible to use SLIP instead for full IPv6 addressability.

Like any other RC18xx-IPM module, it can run arbitrary code as well. This means that the user can implement a custom interface to a custom gateway via, for instance, the UART, if that’s desirable, and simultaneously interface sensors.

Radiocrafts Border Router Concept

Radiocrafts Border Router Concept