Using Lua to Access I/O Devices Connected to the Receiver

A common request from users of OEM7 receivers is have the receiver interact with other equipment in the embedded system. For example, manipulating GPIOs to control external devices or monitor other sensors. To meet this need, OEM7 receivers provide access to the:

  • I2C bus

  • CAN bus

I2C Bus

OEM7600, OEM7700 and OEM7720 receivers have I2C bus signals available which allows connections to a variety of devices.

“The I2C bus was designed by Philips in the early ’80s to allow easy communication between components which reside on the same circuit board. Philips Semiconductors migrated to NXP in 2006”. (i2c-bus.org)

OEM7 receivers that provide access to the I2C signals support three commands and one log to interact with I2C devices connected to the receiver:

In the SampleScripts folder of the NovAtel API you will find two examples of I2C “drivers” for GPIO expanders. One example is for the MCP23008 8 I/O port expander (mcp23008ioe.lua) and the other example is for the PCA9554 8-bit I/O expander (PCA9554ioe.lua). These examples can be used as the basis for creating drivers to interact with other I2C devices.

CAN bus

All OEM7 receivers support connection to the CAN bus. The receiver provides access through either the upper level application protocol (J1939 and NMEA2000) or the user CAN access feature. For information about using the upper level application protocol, see CAN Bus.

The receiver does support access to the upper level application protocol and user CAN access at the same time. If the upper level application protocol has been enabled using the CANCONFIG command, the user CAN access commands will be rejected.

The user CAN access feature supports three commands and two logs.