USB GPIO Modules

LEO CG 16 Channel USB GPIO Module User Manual [CG16B]

0 views November 9, 2026 aryakrishna 0

Introduction

SKUDescriptionOperating temperature
NLEUG016BLEO CG 16 Channel USB GPIO Module - CG16B-40 ℃ to 85 ℃

The Numato Lab LEO CG16B is a versatile and reliable USB-based GPIO interface designed for industrial automation, test systems, embedded applications, and system integration. The module combines 16 3.3V I/O channels with 8 multiplexed analog input channels and 2 PWM channels in a single compact platform, providing flexible digital and analog signal interfacing through USB.

The module enables seamless control and monitoring of digital signals over USB through a clean, human-readable command interface. This streamlined approach simplifies system integration, allowing developers, engineers, and system integrators to build reliable automation, control, and test solutions without the complexity of conventional communication protocols.

Designed with a flexible low-voltage I/O architecture, the LEO CG16B provides 16 I/O channels supports 3.3V. These channels can be configured for digital input or digital output operation according to application requirements. The multiplexed architecture provides flexibility for applications that require configurable digital interfacing.

In addition to the digital I/O functionality, the module provides 8 multiplexed ADC input channels. These analog channels share the corresponding 3.3V I/O pins, allowing the same physical connections to be used for either digital I/O or analog signal acquisition, depending on the application requirements.

To further enhance automation and system reliability, the LEO CG16B includes:

  • Smart Action Engine for rule-based, event-driven automation and standalone operation.
  • Advanced GPIO Timer Functionality for accurate and repeatable digital output control.
  • Integrated I/O Failsafe Engine to help maintain safe and predictable operation during defined fault conditions.
  • USB Command-Line Interface for simple and reliable host-based control.
  • Configurable 3.3V GPIO functionality for flexible digital input and output interfacing.
  • 8-Channel ADC Capability for monitoring variable voltage signals through the multiplexed GPIO channels.
  • 2 PWM Channels multiplexed with the configurable 3.3V GPIOs for flexible pulse-width modulation control.

With its combination of 16 configurable 3.3V digital I/O channels and 8 multiplexed analog input channels and 2 PWM channels, the LEO CG16B provides a flexible platform for applications requiring both digital control and analog signal monitoring.

Whether used in industrial automation, test and measurement, embedded systems, data acquisition, machine interfacing, or standalone automation, the LEO CG16B USB GPIO Module provides a reliable and user-friendly solution for configurable digital control and analog signal monitoring.

Board Features

  • 16 GPIOs – Supports 3.3V signals.
  • 8 Analog Inputs multiplexed with the GPIOs
  • 2 PWM channels multiplexed with the GPIOs
  • USB Connectivity for convenient host-based control
  • Human-Readable Command-Line Interface
  • Smart Action Engine for rule-based automation and standalone operation
  • Advanced GPIO Timer Functionality
  • Configurable I/O Failsafe Engine
  • DIN Rail Mount Compatibility
  • RGB Status Indicator
  • Device Reset and Factory Reset Switch

Applications

  • Industrial Automation and Control
  • Machine and Equipment Monitoring
  • Building and Facility Automation
  • Test and Measurement Automation
  • Data Acquisition and Signal Monitoring
  • Sensor and Actuator Interfacing
  • Power Management and Sequencing
  • Safety and Failsafe Systems
  • Standalone Edge Automation
  • Embedded System Integration
  • Laboratory and Development Systems
  • DIY and Hobby Applications

Technical Specifications

Parameter *Value
Unit
Basic Specifications
Maximum current drawn by digital circuitry300mA
Digital circuit power supply voltage (External)12/24V
Operating Temperature Range-40 to 85 ℃
GPIO Specifications
Number of GPIOs16
Maximum High Voltage on GPIOs3.3V
ADC/PWM Specifications
Number of Analog Inputs (Multiplexed)8
Analog Input Resolution12Bits
Number of PWM Channels (Multiplexed)2

* All parameters considered nominal. Numato Systems Pvt Ltd reserve the right to modify products without notice.

How to use the module

The following section describes how to use this module.

Components/Tools required

Along with the module, you may need the items in the list below for easy and fast installation.

  1. USB Type-C Cable
  2. 12V 1A DC power supply
  3. Medium-sized Philips screwdriver

Connection Details

connection details

DC Power Supply

DC Power SupplyThis board can be operated with a single DC power supply. Use a 12V 1A DC power supply on the DC jack on the board.

Connecting the power supply incorrectly can cause damage to the module and/or other devices

USB Interface

The LEO CG 16 Channel USB GPIO Module is designed for quick and intuitive operation. With its human-readable command set and standard USB CDC interface, the device can be used with widely available serial terminal applications, no specialised software required.

It is compatible with most common terminal tools, including:

  • Windows
    • Tera Term
    • PuTTY
  • Linux
    • GNU Screen
    • PuTTY
  • MAC OS X
    • Screen Command
    • CoolTerm

Note: The device is not limited to the above tools and can be used with any standard serial terminal software.

Getting started with the device involves just a few simple steps:

  1. Connect the Device: Plug the module into a USB port on your host system.
  2. Install Drivers (Windows Only): Driver is available on the product page.
  3. Open the COM Port: Open the COM Port assigned to the device using your preferred serial terminal software.
  4. Send Commands: Control, monitor and configure the device with simple human-readable commands, similar to using DOS or Bash terminal.
  5. Automate via scripts: Integrate with your application or scripts using language of choice such as C, python, Node.js, Perl, or others.
  6. Enable Standalone Automation: Configure Smart Actions and GPIO Timers to allow the device to operate independently without a host system.

Use a USB-A to USB-C/ USB-C to USB-C cable to connect to a PC. Please visit accessories to buy cables and accessories for this product.

GPIO/Analog inputs/PWM

The module has 16 General Purpose I/O (GPIO) pins that can be used for various custom applications. 8 GPIO pins can also function as analog-to-digital converter (ADC) inputs. All I/O pins support 3.3V TTL signals, and the ADC input range is 0 to 3.3V, with a resolution of 12 bits per sample. The module also provides 2 PWM outputs multiplexed with GPIOs, which can be used for applications requiring pulse-width modulation, such as LED brightness control and other suitable control applications.

It is recommended to use a series resistor with the GPIO/ADC pins when interfacing with other circuits to protect the inputs from stray voltages and spikes. In output mode, each GPIO can source up to 11mA. Therefore, no additional circuitry is needed to drive regular LEDs. A 470-ohm series resistor is recommended for current limiting when connecting an LED to a GPIO.

The analog inputs can measure voltages across the 0 to 3.3V range. A series resistor is recommended to protect the inputs from stray voltages and spikes. The table below summarizes the GPIO, ADC input, and PWM pin positions on the header.

GPIOADCPWM
IO0ADC0NA
IO1ADC1NA
IO2ADC2NA
IO3ADC3NA
IO4ADC4NA
IO5ADC5NA
IO6ADC6PWM0
IO7ADC7PWM1
IO8NANA
IO9NANA
IO10NANA
IO11NANA
IO12NANA
IO13NANA
IO14NANA
IO15NANA
GNDGNDGND
GNDGNDGND
VCCVCCVCC
VCCVCCVCC

LED Indication

The LEO CG 16 Channel USB GPIO Module provides visual feedback for reset operations through the onboard LED indicator:

  • On Power-On: Solid Red Turns ON, indicating the device is ready for use.
  • Device Reset: The Red LED briefly turns OFF and ON, indicating that the device is restarting.
  • Factory Reset: The Red LED blinks continuously while the factory reset process is in progress.

Multipurpose Switch

The LEO CG 16 Channel USB GPIO Module is equipped with a versatile multipurpose switch that enables a range of device management functions:

ActionLED IndicationFunction
Single ClickThe Red LED briefly turns OFF and ON, indicating that the device is restarting.Device Reset: Resets the device and reinitializes.
Press for 7-10 secondsThe Red LED blinks continuously while the factory reset process is in progress.Factory Reset: Device erases all the settings and restores to factory defaults.

Important: Use the Factory reset feature only to recover the Username/Password. A factory reset will erase all user settings, restoring the board to its default configuration. After resetting, access the board using the default credentials listed in the table.

Factory Reset

The LEO CG 16 Channel USB GPIO Module provides a factory reset feature to restore all settings to their original default values.

How to Perform a Factory Reset

You can initiate a factory reset using either of the following methods:

  • Using the Multipurpose Switch: Press and hold the RESET switch for 7 – 10 seconds.
  • Using Command Interface: Execute the factory reset command via the USB console.

Important Notes

  • This operation will reset all user-configured settings, including:
    • Username and Password
    • Device ID
    • Smart Actions and Timer configurations
    • All other user-configured parameters.
  • After reset, the device will revert to factory default credentials, as listed in the table below.

Factory Default Settings

The default configuration after a factory reset is provided in the table below.

User nameadmin
Passwordadmin1234
Device ID00000000
Smart Action Disabled
GPIO Power-OnDisabled
GPIO Notify FeatureDisabled
IO FailsafeDisabled

Smart Action Engine

The Smart Action Engine enables real-time, rule-based automation by directly mapping digital inputs to digital outputs. It allows the module to respond instantly to input conditions using configurable logic modes such as LOW, HIGH, or FOLLOW.

For Smart Action Engine functionality, GPIO 0–7 can be configured as digital inputs, while GPIO 8–15 can be configured as digital outputs. This feature transforms the device from a simple USB output interface into an intelligent control system, capable of operating independently without continuous host intervention.

GPIO Timer Engine

The Digital Output Timer Engine provides precise time-based control of digital output operations. It supports configurable modes such as Delayed ON, Delayed OFF, and Toggle, enabling automation of sequencing, scheduling, and timed switching tasks.

With persistent configuration, the timer functionality continues to operate even after power cycles, making it ideal for autonomous and repeatable control applications.

IO Failsafe Control

The IO Failsafe Control feature ensures safe and predictable system behaviour by monitoring a designated digital input. Only GPIO 0 can be configured as the failsafe input. When GPIO 0 reaches the specified trigger condition, the module automatically drives the digital outputs to a predefined state.

This is essential for implementing safety mechanisms such as emergency shutdowns, fault handling, and enforcing defined system states based on input-triggered conditions.

 

Driver Installation

Installing Numato Lab CDC Driver - Windows Desktop and Server Editions

The driver package for Numato Lab’s products can be downloaded from the product page at http://numato.com. To install the driver, unzip the contents of the downloaded driver package to a folder. Attach USB cable to the PC and when asked by Windows device installation wizard, point to the folder where driver files are present. When driver installation is complete, the module should appear in Windows Device Manager as a serial port. The picture below shows a 1 Channel USB Relay Module visible in Windows Device Manager. For other devices (USB GPIO and USB Relay modules), the name will be different but how the device is displayed and used is exactly same.

Note down the name of the serial port (COM1, COM2, etc..). This information is required to control the module from the PC.

You may notice that the driver package does not come with a .sys or .exe file as most driver packages do and are expected to be that way. The driver binary necessary in this case is shipped with all copies of Windows Desktop/Server editions and gets installed automatically while Windows is installed for the first time. The .inf and .cat files present in the driver package downloaded from http://numato.com merely associate this pre-existing driver with the attached Numato Lab device.

The following video demonstrates how to install the driver on Windows 10.

Installing on Windows Embedded Editions

Windows Embedded editions do not install the infrastructure necessary for the USB CDC by default in favor of a smaller footprint. This will cause the driver to install to fail unless the necessary files are manually installed prior to installing the driver. Please follow the steps below to install the prerequisites and drivers correctly. These steps are tested on Windows 7 Embedded Edition.

  1. Locate winemb-inf-mdmcpq.cab on Win 7 Embedded DVD/ISO image
  2. Copy winemb-inf-mdmcpq.cab to a folder Ex: C:Temp
  3. Run command DISM.exe /online /Add-Package /PackagePath:C:Temp
  4. Wait for Windows to restart (Restart machine manually if DISM does not restart the machine automatically)
  5. After reboot is complete, plug the device to a USB port and install driver normally (Driver is available for download at the product page)

Installing on Linux

To use any device that uses the USB CDC protocol with Linux, the USB CDC driver needs to be compiled into the kernel. Fortunately, most Linux distributions (Ubuntu, Redhat, Debian, etc..) have this driver pre-installed. The chances of you requiring to rebuild the kernel to include the USB CDC driver is very slim. When connected to a Linux machine, this product should appear as a serial port under /dev directory. Usually, the name of the device will be ttyACMx or similar. The name may be different depending on the Linux distribution you have. The image below shows the result of ls /dev command on a Linux Mint system with a USB GPIO/Relay device attached.

Device Listing on Linux

In this particular case, the device shows up as ttyACM0 (highlighted in orange color) but it could be ttyACM1 or ttyACM2, etc… depending on the specific system and other connected devices. Once the device is visible under /dev directory, it can be treated just like any other serial device. Commands can be sent to the device using any mechanism that is valid for regular serial ports such as screen command or Serial Terminal Emulation applications. If there is more than one device connected to the same host computer, each device will be displayed as separate serial devices with unique names. These separate serial devices can be used to control individual devices attached.

Installing on Mac OSX

Mac OSX is usually shipped with USB CDC driver pre-installed. When connected to a Mac computer, this product should appear as a serial port under /dev directory. Usually, the name of the device will be tty.usbserialportx or similar. The name may be different depending on the Mac OSX version you have. The image below shows the result of ls /dev/*usb* command on a Mac OSX Yosemite system with a USB GPIO/Relay device attached.Listing USB GPIO Devices on Mac OSX

In this particular case, the device shows up as tty.usbmodem141141 (highlighted on orange color) but it could be any name starting tty.usbmodem  or even a completely different name depending on the exact version of operating system and other connected devices. Once the device is visible under /dev directory, it can be treated just like any other serial device. Commands can be sent to the device using any mechanism that is valid for regular serial ports such as screen command or Serial Terminal Emulation applications. If there is more than one device connected to the same host computer, each device will be displayed as separate serial devices with unique names. These separate serial devices can be used to control individual devices attached.

Installing CDC Devices On Android

Most Android versions have a built-in driver that supports external USB Devices. Due to the presence of a built-in driver any external USB device including Numato Lab’s USB GPIO/Relay products connected to Android-based gadget will be enumerated by Android OS. Such enumerated devices can be listed/viewed by using apps such as USB Device Info. The image below shows info about a Numato Lab USB device printed by the USB Device Info app. All Numato Lab’s USB GPIO and USB Relay modules will be displayed the same way.

Numato Lab USB Device Listed In Android

Devices detected by Android can be controlled by using an off the shelf Serial Terminal App such as USB Serial Terminal Lite.

Supported Error Codes

The LEO CG 16 Channel USB GPIO Module returns error codes to indicate invalid commands or incorrect parameter usage.

These codes help in quickly identifying and resolving issues during operation.

Error CodeError NameDescription
-3Invalid CommandThe device does not recognise the entered command
-2Invalid Argument One or more parameters are incorrect
-51Invalid Output Timer Limit Timer delay is outside the allowed range
-41Invalid Smart Engine ModeThe IO is already set to a different smart engine mode
-42Invalid Output ValueThe output value is outside the allowed range in the smart action engine

Notes:

  • Error codes are returned immediately upon command validation failure
  • Ensure all commands and parameters follow the defined format and limits
  • Refer to individual command sections for valid parameter ranges

Sending Commands

One of the most powerful features of this module is the simple easy to use command set it supports. This command set hides the complex USB protocol and gives a very simple interface to access the features of the module. The following sections give details of the command set and how to use the command set.

The sections below talks in detail about how to send commands to the device using different tools on different operating systems. Most sections here will use GPIO commands to explain and demonstrate the process of sending commands. The process of sending other commands such as id get/set, adc read are exactly the same, in fact in most cases simply replacing the existing command in the example code with the new one should work right away.

The command set

This product support a very simple command set that is designed to be less cryptic and easy to use manually (using serial terminal emulation programs) or through a program written in many supported languages.

List of currently supported commands.

No.Command
ParametersExample Description
1verNoneverReturns firmware Version
2idget/set xxxxxxxxid get, id set 12345678Reads/Sets id of the module
3usr get/set xxxxxxxx usr get, usr set admin Reads/Sets User name
4pass get/set xxxxxxxx pass get, pass set admin Reads/Sets Password
5usr authget/on/offusr auth get, usr auth on, usr auth offReturns User Auth status, Enable/Disable Authentication
6smartget/-i/-o/disable/
[input] [mode] [target_output] [value]
smart get 000, smart -i 000, smart -o 000, smart disable, smart 000 L 000 1Read configured data, clear configured input, disable entire smart action feature, configure smart feature
7gpioset/clear/read/status [gpio number]/status/writeall/iomask/iodir [value]/notify/poweron [iodir value] [gpio value]/iodir/iomask/write [gpo_group] [gpo_map]gpio set 000, gpio clear 000, gpio read 000, gpio status 000, gpio status, gpio status, gpio writeall ff, gpio iodir 00, gpio iodir A 0000, gpio iodir, gpio iomask, gpio notify on, gpio notify off, gpio notify get, gpio poweron 00 ff, gpio write A 00ff, Control and monitor the GPIOs
8adcread [adc number]adc read 000Read Analog to Digital Converter input value
9pwmstatus, freq xxx y, duty xxx y, disable, status/on/off xxxpwm status, pwm freq 000 1000, pwm duty 001 50, pwm disable, pwm status 000, pwm on 001, pwm off 001Control and monitor the PWMs.
10fsget input_number/reset/disable/
[input] [mode] [gpo_group] [gpo_map]
fs get 000, fs reset, fs disable, fs 000 L A 0012Read status of IO failsafe, Manual Reset Failsafe, Disable Failsafe, Configure Failsafe
11infononeinfoDisplay information about the module including Smart Action, Power-on status, and IO Failsafe
12rebootnonepower resetPower reset does a soft-reset.
13factresetfact resetPerform device factory reset

The table below has more detailed information about available commands.

Device Command Set

No. Command Example Description
1ver ver This command returns the current firmware version of the device.
Command Format
ver

Response Format
xxxx
xxxx – Firmware version string

Description
Returns the firmware version currently running on the device.

Example
ver Returns firmware version

Notes
The version format may vary depending on the firmware release.
2idid get
id set xxxxxxxx
This command is used to read and configure the device ID.
Command Format
id get
id set x
x – New device ID (exactly 8 characters)

Description
id get returns the current device ID.
id set x updates the device ID to the specified value.

Example
id get Returns the current device ID
id set DEV12345 Sets the device ID to "DEV12345"

Notes
The device ID must be exactly 8 characters in length.
Changing the device ID may affect identification in connected systems or applications.n a new ID to the module. “x” stands for alphanumeric characters including symbols. The new ID must be exactly 8 characters in length.
3usr
usr get
usr set xxxxxxxx
This command is used to read and configure the device username.
Command Format
usr get
usr set x
x – New username (1 to 8 characters)

Description
usr get returns the current username configured on the device.
usr set x updates the username to the specified value.

Example
usr get Returns the current username
usr set admin Sets the username to "admin"

Notes
Username length must be between 9 and 31 characters.
Changing the username affects authentication over the USB interface. It supports alphanumeric and symbols( !, @, ^, (, ))
4passpass get
pass set xxxxxxxxx
This command is used to read and configure the device password.
Command Format
pass get
pass set x
x – New password (9 to 31 characters, alphanumeric and symbols supported are !, @, ^, (, ))

Description
pass get returns the current password configured on the device.
pass set x updates the device password to the specified value.

Example
pass get Returns the current password
pass set admin1234 Sets the password to "admin1234"

Notes
Password length must be between 9 and 31 characters.
Use a strong password to ensure secure access to the device.
Changing the password affects authentication over the USB interface.
5usr authusr auth get

This command returns the current USB authentication status.
Command Format
usr auth get

Response Format
USR Authentication Disabled – Authentication is DISABLED
USR Authentication Enabled– Authentication is ENABLED

Description
Returns whether USB authentication is currently enabled or disabled.

Example
usr auth get Returns USR Authentication Enabled if authentication is enabled, otherwise USR Authentication Disabled

Notes
Ensure authentication is enabled for secure operation.
When disabled, commands can be executed without credentials.
usr auth onThis command enables USB authentication for the device.
Command Format
usr auth on

Description
Enables authentication over the USB interface.
Once enabled, valid credentials are required to execute commands.

Example
usr auth on Enables USB authentication

Notes
Ensure valid username and password are configured before enabling authentication.
If credentials are unknown, use factory reset to restore default access.
usr auth offThis command disables USB authentication for the device.
Command Format
usr auth off

Description
Disables authentication over the USB interface.
Once disabled, commands can be executed without requiring a username or password.

Example
usr auth off Disables USB authentication

Notes
Disabling authentication reduces access security.
It is recommended to use this feature only in trusted environments.
6infoinfoThis command displays module information, including Smart Action status, Power-on configuration, and IO Failsafe status.
Command Format
info

Description
Returns a summary of key module configurations in a single response.
Helps in quickly verifying system setup and operational status.

Example
info Returns module configuration summary

Notes
The response format may vary based on firmware version.
Use individual commands for detailed configuration of each feature.
7rebootrebootThis command performs a soft reset of the device.
Command Format
reboot

Description
Restarts the device without altering any stored configuration.
All settings, including Smart Action, Timer, Failsafe, and credentials, remain unchanged.

Example
reboot Performs a device soft reset

Notes
The device will briefly disconnect and restart after execution.
Use this command to recover from temporary issues or apply configuration changes.
8fact resetfact resetThis command performs a factory reset of the device.
Command Format
fact reset

Description
Restores the device to factory default settings.
All configurations, including Smart Action, Timer, Failsafe, credentials, and other user-defined parameters, will be erased.

Example
fact reset Performs a device factory reset

Notes
The device will briefly disconnect, the LED will blink during the reset process, and the device will restart upon completion.
Use this command to recover the device or reset all configurations.
This action cannot be undone.

GPIO/ADC/PWM Command Set

No. Command Example Description
1gpiogpio status xxxThis command returns the current status of a specific GPIO channel.
Command Format
gpio status xxx
xxx – GPIO number (Range: 000 to 015, numbering starts from 0)

Response Format
0 or 1

1 – GPIO is High
0 – GPIO is Low

Description
Returns the current state of the selected GPIO channel.

Example
gpio status 000 Returns status of GPIO 0

Notes
Ensure the GPIO number is within the valid range (000–015).
The response reflects the real-time state of the GPIO at the moment of execution.
2gpio status A This command reads the current status of all GPOs in group A in a single operation.
Command Format
gpio status A

Response Format
A:XXXX
XXXX – Current GPIO state (hexadecimal value)

Description
The returned value represents the state of all gpios in the selected group.
Each bit corresponds to one gpio channel.
0 – GPIO low
1 – GPIO high

Example
A:0000 – All GPIOs are low
A:00FF – All GPIOs are high

Group Representation
A – Group A (first 16 GPIOs)
Each bit represents one GPIO channel

Value Range
0000 to 00FF (8-bit)
3gpio statusThis command reads the current status of all GPIOs in a single operation.
Command Format
gpio status

Response Format
A:XXXX
XXXX – Current GPIO state (hexadecimal value)

Description
The returned value represents the state of all gpios in the selected group.
Each bit corresponds to one gpio channel.
0 – GPIO low
1 – GPIO high

Example
A:0000 – All GPIOs are low
A:00FF – All GPIOs are high

Group Representation
A – Group A (first 16 GPOs)
Each bit represents one GPIO channel

Value Range
0000 to 00FF (8-bit)
4gpio set xxxThis command sets a specific GPIO channel HIGH.
Command Format
gpio set xxx
xxx – GPIO number (Range: 000 to 015, numbering starts from 0)

Description
Set to HIGH the selected GPIO channel.

Example
gpio set 000 GPIO 0 set to HIGH

Notes
Ensure the GPIO number is within the valid range (000–015).
The command immediately updates the GPIO state.
5gpio
write A xxxx
This command sets the output state of GPIOs in Group A in a single operation.

Command Format
gpio write A xxxx

A – Group identifier (Group A represents the first 8 GPIO channels).
xxxx – 8-bit hexadecimal value (Range: 0000 to 00FF). Do not prepend `0x` to the value.

Description
Sets the output state of all 8 GPIO channels in Group A simultaneously based on the specified hexadecimal value.

- **0** – Sets the corresponding GPIO output to LOW.
- **1** – Sets the corresponding GPIO output to HIGH.

Examples
gpio write A 0000

Sets all GPIO outputs in Group A to LOW.

gpio write A 00FF

Sets all GPIO outputs in Group A to HIGH.

Notes
Each bit in the hexadecimal value corresponds to a GPIO channel in Group A. Ensure the corresponding GPIO channels are configured as outputs before executing this command.
6gpio clear xxxThis command clears a specific GPIO channel LOW.
Command Format
gpio clear xxx
xxx – GPIO number (Range: 000 to 015, numbering starts from 0)

Description
Clear to LOW the selected GPIO channel.

Example
gpio clear 000 GPIO 0 clear to LOW

Notes
Ensure the GPIO number is within the valid range (000–015).
The command immediately updates the GPOO state.
7gpio set allThis command sets HIGH all GPIO channels.
Command Format
gpio set all

Description
Turns ON all GPIOs in a single operation, regardless of their current state.

Example
gpio set all Sets High all GPIOS.

Notes
This command immediately sets all GPIO outputs to High.
It overrides any previously set GPIO states.
If a GPIO is mapped to GPIO timer, manual control will be restricted
8gpio clear allThis command clears to Low all GPIO channels.
Command Format
gpio clear all

Description
Clears to Low all GPIOs in a single operation, regardless of their current state.

Example
gpio clear all Clears to Low all GPIOs

Notes
This command immediately sets all GPIO outputs to Low.
It overrides any previously set GPIO states.
If a GPIO is mapped to GPIO timer, manual control will be restricted
9gpio pwron A xxxx XXXXThis command sets the poweron value to GPIOs in group A.
Command Format
gpio pwron A xxxx XXXX

xxxx – GPIO direction [0 – output, 1 – input]
XXXX –poweron value [0 – Clear GPIO, 1- Set GPIO]
Description
Sets the GPIO status on power-on according to the hexadecimal value and IO direction mentioned.
gpio poweron 000f 005d
Example
‘000f’ ‘005d’ – 0000 0000 0000 1111 0000 0000 0101 1101

GPIOs 0 to 3 – input
GPIOs 4 to 15 – output
Set GPIOs 0,2,3,4&6, Clear GPIOs 1,5,7 - 15
10gpio pwron getThis command returns the power-on output state configured for all GPIO channels.

Command Format
gpio pwron get

Response Format
Poweron Value : xxxx

xxxx – 8-bit hexadecimal value (Range: 0000 to 00FF).

Description
Returns the power-on value configured for the GPIO channels, indicating the output state each GPIO assumes when the module is powered on.

Example
gpio pwron get
Returns Poweron Value: 00F3

Indicates that GPIO 0, 1, and 4-7 are configured HIGH, while the remaining GPIOs are configured LOW on power-on.

Notes
Each bit in the hexadecimal value corresponds to a GPIO channel:

- **1** – GPIO is configured HIGH on power-on.
- **0** – GPIO is configured LOW on power-on.
11gpio pwron disableThis command disables the GPIO power-on feature.

Command Format
gpio pwron disable

Description
Disables the power-on feature configured for the GPIO channels. Once disabled, the GPIOs will no longer be set to their configured power-on values when the module is powered on.

Example
gpio pwron disable
Disables the power-on feature for all GPIO channels.

Notes
Disabling this feature does not erase the previously configured power-on values.
12gpio read xxxThis command returns the current status of a specific GPIO channel.

Command Format
gpio read xxx

xxx – GPIO number (Range: 000 to 015, numbering starts from 0)

Response Format
0 or 1
1 – GPIO is High
0 – GPIO is Low

Description
Returns the current state of the selected GPIO channel.

Example
gpio read 000 Returns status of GPIO 0.

Notes
Ensure the GPIO number is within the valid range (000–015).
The response reflects the real-time state of the GPIO at the moment of execution.
13gpio iodirThis command returns the I/O direction status of the GPIO channels.

Command Format
gpio iodir

Response Format
IO Direction : xxxx
xxxx – I/O direction value (Range: 0000 to FFFF)

Description
Returns the I/O direction configuration of the GPIO channels, indicating whether each GPIO is configured as an input or output.

Example
gpio iodir

Returns IO Direction: 00F3

Indicates that GPIO 0, 1, and 4–7 are configured as inputs, while the remaining GPIOs are configured as outputs.

Notes
The returned value represents the I/O direction configuration of all GPIO channels. Each bit corresponds to a GPIO channel, indicating its configured direction.
14gpio iodir AThis command returns the I/O direction status of GPIOs in Group A.

Command Format
gpio iodir A

Response Format
IO Direction : xxxx
xxxx – I/O direction value (Range: 0000 to FFFF)

Description
Returns the I/O direction configuration of the 8 GPIO channels in Group A, indicating whether each GPIO is configured as an input or output.

Example
gpio iodir A

Returns IO Direction: 00A3

Indicates that GPIO 0, 1, 5, and 7 are configured as inputs, while GPIO 2, 3, 4, 6 and 8-15 are configured as outputs.

Notes
The returned value represents the I/O direction configuration of all 16 GPIO channels in Group A. Each bit corresponds to a GPIO channel and indicates its configured direction.
15gpio
iodir A xxxx
This command sets the I/O direction of all GPIO channels in a single operation.

Command Format
gpio iodir xx

xx – 8-bit hexadecimal value (Range: 0000 to FFFF). Do not prepend `0x` to the value.

Description
Configures the direction of all GPIO channels simultaneously based on the specified hexadecimal value.

- **0** – Configures the corresponding GPIO as an output.
- **1** – Configures the corresponding GPIO as an input.

Example
gpio iodir A 0000

Sets all GPIO channels as outputs.

gpio iodir A ffff

Sets all GPIO channels as inputs.

Notes
- The GPIO direction must be configured using the `gpio iodir A xxxx` command before using the `gpio read` and `gpio set all` commands.
- The direction configured using the `iodir` command may be modified by subsequent `set`, `clear`, or `read` commands. This applies only to the GPIO channels accessed through these commands.
16gpio iomaskThis command returns the I/O direction status of all GPIO channels.

Command Format
gpio iomask

Response Format
IO Direction : xxxx

xxxx – I/O direction value (Range: 0000 to FFFF)

Description
Returns the I/O direction configuration of all GPIO channels, indicating whether each GPIO is configured as an input or output.

Example
gpio iodir

Returns IO Direction: 00F3

Indicates that GPIO 0, 1, and 4–7 are configured as inputs, while the remaining GPIOs are configured as outputs.

Notes
Each bit in the hexadecimal value represents the direction of a corresponding GPIO channel:

- **0** – GPIO configured as output.
- **1** – GPIO configured as input.

The response reflects the current I/O direction configuration of the GPIO channels.
17gpio iomask AThis command returns the I/O mask status of GPIOs in Group A.

Command Format
gpio iomask A

Response Format
IO Mask : xxxx

xxxx – I/O mask value (Range: 0000 to FFFF)

Description
Returns the I/O mask configuration of the 16 GPIO channels in Group A, indicating which GPIOs are enabled (unmasked) or disabled (masked).

Example
gpio iomask A

Returns IO Mask: 00AA

Indicates that the GPIOs corresponding to the set bits (1) are unmasked (enabled), while the GPIOs corresponding to the cleared bits (0) are masked (disabled).

Notes
Each bit in the hexadecimal value corresponds to a GPIO channel in Group A:

- **1** – GPIO is unmasked (enabled).
- **0** – GPIO is masked (disabled).
18gpio
iomask A xxxx
This command sets the mask/unmask status of all GPIO channels in a single operation.

Command Format
gpio iomask xxxx

xxxx – 16-bit hexadecimal value (Range: 0000 to FFFF). Do not prepend `0x` to the value.

Description
Configures the mask/unmask status of all GPIO channels simultaneously based on the specified hexadecimal value.

- **0** – Masks (disables) the corresponding GPIO.
- **1** – Unmasks (enables) the corresponding GPIO.

Examples
gpio iomask 0000
Masks all GPIO channels.

gpio iomask FFFF
Unmasks all GPIO channels.

Notes
Each bit in the hexadecimal value corresponds to a GPIO channel. A set bit (1) enables the corresponding GPIO, while a cleared bit (0) disables it.
19gpio notify onThis command enables digital input (GPIO) change notifications. When enabled, the device monitors input state changes and sends a notification to the host whenever a change is detected.
Command Format
gpio notify on

Notification Format
A:XXXX/YYYY
XXXX – Current input state
YYYY – Previous input state

Description
A notification is sent only when a change is detected in any input bit.
The value represents the state of all inputs in the group using hexadecimal format.

Example
A:00FE/00FF
Previous state: 00FF
Current state: 00FE
This indicates that GPIO 0 changed from HIGH (1) to LOW (0), triggering the notification.

Group Representation
A – Group A (first 16 digital inputs)
Each bit represents one input channel
0 – GPIO LOW
1 – GPIO HIGH

Value Range
0000 to FFFF (16-bit)
20gpio notify offThis command disables the GPIO change notification feature.
Command Format
gpio notify off

Response Format
Gpio Notify Disabled

Description
Disables automatic notifications for digital input state changes. Once disabled, the device will no longer send updates to the host when input states change.

Example
gpio notify off Disables GPIO change notifications
21gpio notify getThis command returns whether the GPIO change notification feature is enabled or disabled.
Command Format
gpio notify get

Response Format
Gpio Notify Enabled or Gpio Notify Disabled

Description
Returns the current status of the gpio change notification feature.

Example
gpio notify get
Returns Gpio Notify Enabled or Gpio Notify Disabled
22adcadc read xxxThis command reads the analog value from a specific ADC input channel.

Command Format
adc read xxx

xxx – ADC input channel number (Range: 000 to 007)

Response Format
0 to 1023

Description
Reads the analog voltage present at the selected ADC input and returns its corresponding digital value in the range of 0 to 1023.

Examples
adc read 000

Reads the analog value from ADC input 0.

adc read 004

Reads the analog value from ADC input 4.

Notes
Ensure the ADC input channel number is within the valid range (000–007).

The returned value represents the analog input voltage converted into a 12-bit digital value.
23pwmpwm statusThis command returns the current status of all PWM channels in a single operation.

Command Format
pwm status

Response Format
A:XXXX

A – Group identifier (Group A represents the first 16 PWM channels).

XXXX – Current PWM channel state (16-bit hexadecimal value, Range: 0000 to FFFF).

Description
Returns the current output state of all PWM channels in Group A. Each bit in the hexadecimal value corresponds to one PWM channel.

- **0** – PWM channel output is LOW.
- **1** – PWM channel output is HIGH.

Examples
A:0000

Indicates that all PWM channels are LOW.

A:FFFF

Indicates that all PWM channels are HIGH.

Notes
Each bit in the 16-bit hexadecimal value represents the output state of a corresponding PWM channel in Group A.
24pwm status xxxThis command returns the current status of a specific PWM channel.

Command Format
pwm status xxx

xxx – PWM channel number (Range: 000 to 015, numbering starts from 0).

Response Format
0 or 1

- **1** – PWM channel is HIGH.
- **0** – PWM channel is LOW.

Description
Returns the current output state of the selected PWM channel.

Example
pwm status 000

Returns the status of PWM channel 0.

Notes
- Ensure the PWM channel number is within the valid range (000–001).
- The response reflects the real-time output state of the PWM channel at the moment of execution.
25pwm freq xxx yThis command sets the operating frequency of a specific PWM channel.

Command Format
pwm freq xxx y

Parameters

- **xxx** – PWM channel number (000 or 001).
- **y** – Desired PWM frequency in Hz.
- **PWM 000:** 1 Hz to 5 MHz.
- **PWM 001:** 1000 Hz to 5 MHz.

Description
Sets the operating frequency of the selected PWM channel. The specified frequency must be within the supported range for that channel.

Examples
pwm freq 000 1000

Sets the frequency of PWM channel 000 to 1 kHz.

pwm freq 001 5000000

Sets the frequency of PWM channel 001 to 5 MHz.

Notes
- Ensure the PWM channel number is either 000 or 001.
- Specify the frequency in Hz and ensure it is within the supported range for the selected channel.
26pwm duty xxx yThis command sets the duty cycle of a specific PWM channel.

Command Format
pwm duty xxx y

Parameters

- **xxx** – PWM channel number (000 or 001).
- **y** – Desired duty cycle (Range: 0 to 100%).

Description
Sets the duty cycle of the selected PWM channel. The duty cycle determines the percentage of time the PWM signal remains HIGH during one complete cycle.

Examples
pwm duty 000 50

Sets the duty cycle of PWM channel 000 to 50%.

pwm duty 001 75

Sets the duty cycle of PWM channel 001 to 75%.

Notes
- Ensure the PWM channel number is either 000 or 001.
- Specify the duty cycle as a percentage between 0 and 100.
27pwm on xxxThis command enables the PWM output of a specific channel.

Command Format
pwm on xxx

Parameters

- **xxx** – PWM channel number (000 or 001).

Description
Enables the PWM output on the selected channel using the previously configured frequency and duty cycle.

Example
pwm on 000

Enables the PWM output on channel 000.

Notes
- Ensure the PWM channel number is either 000 or 001.
- Configure the desired frequency and duty cycle before enabling the PWM output.
28pwm off xxxThis command disables the PWM output of a specific channel.

Command Format
pwm off xxx

Parameters

- **xxx** – PWM channel number (000 or 001).

Description
Disables the PWM output on the selected channel.

Example
pwm off 000

Disables the PWM output on channel 000.

Notes
Ensure the PWM channel number is either 000 or 001.
29pwm disableThis command disables PWM functionality on all available PWM channels.

Command Format
pwm disable

Description
Disables the PWM output on all available PWM channels, stopping their PWM signal generation.

Example
pwm disable

Disables all PWM channels.

Notes
This command disables PWM functionality on all available channels, regardless of their individual configuration.

Additional Information

Using GPIO's with switches

It is possible to read the position of a switch that is connected to a GPIO. A SPST or SPDT switch is recommended to use with GPIO’s. Push switches do maintain the contacts closed only for a very short time so using them is digitaltoanalog-8ethernetrelaydiscouraged. The fundamental idea of using a switch with GPIO is to have the switch cause a voltage level change at the GPIO pin when pressed. Usually this is achieved by using an external pull-up resistor along with the switch. The pull up resistor is connected between the GPIO and VDD and the switch is connected between the GPIO and ground. When the switch is not pressed, the pull-up resistor will cause the GPIO to stay at VDD voltage level. When the switch is pressed, the GPIO is short circuited to ground and stays at zero voltage. This change in voltage and thus the position of the switch can be read using “gpio read” command. Please see the recommended connection diagram below

FAQ

Q. I need a customized version of this product, can Numato do the customization for me?
A. Yes, we can definitely do customization but there may be minimum order requirements depending on the level of customization required. Please write to sales@numato.com for a quote.

Q. Where can I buy this product?
A. All Numato products can be ordered directly from our web store http://www.numato.com. We accept major credit cards and Paypal and ship to almost all countries with a few exceptions. We do have distributors in many countries where you can place your order. Please find the current list of distributors here.

Suggest Edit