- Support portal
- Evaluation Kits and partner products
u-blox Support
- Product documentation
Documentation
- About
- Sustainability
- Partners and Alliances
- Contact
About u-blox
- Investor relations
Investor relations
The section describes the AT commands used to configure the GPIO pins provided by u-blox cellular modules.
On u-blox cellular modules, GPIO pins can be opportunely configured as general purpose input or output. Moreover GPIO pins of u-blox cellular modules can be configured to provide custom functions via +UGPIOC AT command. The custom functions availability can vary depending on the u-blox cellular modules series and version: see Table 19 for an overview of the custom functions supported by u-blox cellular modules.
<gpio_mode> | Output | Input | Network status indication | External GNSS supply enable | External GNSS data ready | External GNSS RTC sharing | Jamming detection indication | SIM card detection | Headset detection | GSM Tx burst indication | Module status indication | Module operating mode indication | I2S digital audio interface | SPI serial interface | Clock output | UART (DSR, DTR, DCD and RI) interface | Wi-Fi enable | Ring indicator | Last gasp | External GNSS antenna / LNA control | Time pulse GNSS | Time pulse output | Time stamp of external interrupt | Fast power-off | LwM2M pulse | Hardware flow control (RTS, CTS) | Antenna dynamic tuning | External GNSS time pulse input | External GNSS time stamp of external interrupt | DTR mode for power saving control | 32.768 kHz output | Safe memory and power-off | UPSV control | Satellite / GNSS Rx indication | Satellite / GNSS Rx/Tx indication | Pad disabled |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 255 | |
LEXI-R10 / SARA-R10 | * | * | * | * | * | * | * | * | * | * |
The configuration of the GPIO pins (i.e. the setting of the parameters of the +UGPIOC AT command) is saved in the NVM and used at the next power-on.
For more details on the antenna dynamic tuning control feature, see the +UATUN AT command.
The number of available GPIO pins and their mapping can vary depending on the u-blox cellular modules series and version. The GPIOs mapping for different u-blox cellular modules is reported in the following tables.
See the corresponding module system integration manual for the functions supported by each GPIO.
<gpio_id> | Pin name | Pin number | Factory-programmed function | Remarks |
---|---|---|---|---|
14 | GPIO1 | 14 | Pin disabled | - |
15 | GPIO2 | 15 | Pin disabled | - |
16 | GPIO3 | 16 | Pin disabled | - |
17 | GPIO4 | 17 | Pin disabled | - |
18 | GPIO5 | 18 | Pin disabled | - |
29 | GPIO6 | 29 | Pin disabled | Only pin 29 can be configured for "SIM card detection" functionality |
23 | GPIO7 | 23 | Pin disabled | - |
24 | GPIO8 | 24 | Pin disabled | - |
25 | GPIO9 | 25 | Pin disabled | - |
26 | GPIO10 | 26 | Pin disabled | - |
SARA products don’t support GPIO7, GPIO8, GPIO9, GPIO10.
See the corresponding module system integration manual for the complete overview of all allowed configurations.
When a GPIO pin is configured to provide network status indication, its progress depends on the CS network registration state (see +CREG) and on the module transmission state:
No service: indicates no network coverage or not registered state
Registered home network 2G: indicates registered state on home network in 2G RAT
Registered home network 3G: indicates registered state on home network in 3G RAT
Registered home network 4G: indicates registered state on home network in 4G RAT
Registered home network NB-IoT: indicates registered state on home network in NB-IoT
Registered roaming 2G: indicates registered state with visitor 2G network (roaming in 2G RAT)
Registered roaming 3G: indicates registered state with visitor 3G network (roaming in 3G RAT)
Registered roaming 4G: indicates registered state with visitor 4G network (roaming in 4G RAT)
Registered roaming NB-IoT: indicates registered state with visitor NB-IoT network (roaming in NB-IoT)
Data transmission: indicates voice or data call active either in 2G, 3G or 4G RAT
Data transmission roaming: indicates voice or data call active either in 2G, 3G or 4G RAT with visitor network
The following figures report the allowed progresses for GPIO pin set as network indication: VH and VL values are provided in the corresponding module data sheet in the "Generic Digital Interfaces pins" section.
Continuous Output / Low
Cyclic Output / High for 100 ms, Output / Low for 2 s
Cyclic Output / High for 50 ms, Output / Low for 50 ms, Output / High for 50 ms, Output / Low for 2 s
Cyclic Output / High for 75 ms, Output / Low for 75 ms, Output / High for 75 ms, Output / Low for 75 ms, Output / High for 75 ms, Output / Low for 3 s
Cyclic Output / High for 100 ms, Output / Low for 30 s
Cyclic Output / High for 100 ms, Output / Low for 100 ms, Output / High for 100 ms, Output / Low for 2 s
Cyclic Output / High for 50 ms, Output / Low for 50 ms, Output / High for 50 ms, Output / Low for 100 ms
Cyclic Output / High for 150 ms, Output / Low for 150 ms, Output / High for 150 ms, Output / Low for 3 s
Cyclic Output / High for 100 ms, Output / Low for 100 ms, Output / High for 100 ms, Output / Low for 30 s
Continuous Output / High
Cyclic Output / High for 800 ms, Output / Low for 200 ms
Data transmission pattern is hooked up to +CSCON events, which return details of the current terminal’s radio connection status.
The UART interface lines (DSR, DTR, DCD and RI) can be set on GPIO pins. For more details, see the corresponding module system integration manual.
When a GPIO pin is configured to provide module status indication, its progress depends on the current module status (power-off mode, i.e. module switched off, or deep-sleep mode versus idle, active or connected mode, i.e. module switched on):
Output / High, when the module is switched on (any operating mode during module normal operation: idle, active or connected mode)
Output / Low, when the module is switched off (power-off mode)
When a GPIO pin is configured to provide module operating mode indication, its progress depends on the current module operating mode (the low power idle mode versus active or connected mode):
Output / High, when the module is in active or connected mode
Output / Low, when the module is in idle mode (that can be reached if the power saving is enabled by the +UPSV AT command)
+UGPIOC | ||||||
Modules | All products | |||||
Attributes | Syntax | PIN required | Settings saved | Can be aborted | Response time | Error reference |
partial | No | No |
Configures the GPIO pins as input, output, or to handle a custom function. When a GPIO pin is configured as an output pin (<gpio_mode>=0), it is possible to set the output value <gpio_out_val> which will be returned in the information text response to +UGPIOR read command (where supported). When a GPIO pin is configured as an input pin (<gpio_mode>=1), it is possible to set the input value <gpio_in_pull> which will be returned in the information text response to +UGPIOR read command (where supported). When the GPIO pin is configured as a SIM card detection (<gpio_mode>=7), it is possible to set the SIM polarity <gpio_sim_det_logic>; the parameter setting will be returned in the information text response to +UGPIOC read command.
The test command provides the list of the supported GPIOs, the supported functions and the status of all the GPIOs.
Not all the GPIO functions can be assigned to each GPIO pin. If the configuration is not allowed, an error result code will be returned (error result code 1502 - "+CME ERROR: Select GPIO mode error"). Where supported, the following custom functions cannot be simultaneously configured on 2 GPIOs:
Network status indication
External GNSS supply enable
External GNSS data ready
External GNSS RTC sharing
Jamming detection indication
SIM card detection
Headset detection
GSM Tx burst indication
Module status indication
Module operating mode indication
Ring indicator
Last gasp
External GNSS antenna / LNA control
Time pulse GNSS
Time pulse output
Time stamp of external interrupt
Fast power-off
External GNSS time pulse input
External GNSS time stamp of external interrupt
DTR mode for power saving control
32.768 kHz output
Safe memory and power-off
UPSV control
Primary UART DTR line on GPIO pin
Satellite / GNSS Rx indication
Satellite / GNSS Rx/Tx indication
For more details regarding the custom functions supported by the u-blox cellular modules and the factory-programmed settings, see GPIO functions and GPIO mapping.
Type | Syntax | Response | Example |
---|---|---|---|
Generic syntax | |||
Set | AT+UGPIOC=<gpio_id>,<gpio_mode>[,<param_val>] | OK | AT+UGPIOC=42,7,1 OK |
GPIO output mode | |||
Set | AT+UGPIOC=<gpio_id>,0[,<gpio_out_val>] | OK | AT+UGPIOC=42,0,1 OK |
GPIO input mode | |||
Set | AT+UGPIOC=<gpio_id>,1[,<gpio_in_pull>] | OK | AT+UGPIOC=42,1,1 OK |
SIM card detection mode | |||
Set | AT+UGPIOC=<gpio_id>,7[,<gpio_sim_det_logic>] | OK | AT+UGPIOC=42,7,1 OK |
Other GPIO modes | |||
Set | AT+UGPIOC=<gpio_id>,<gpio_mode> | OK | AT+UGPIOC=42,2 OK |
Read | AT+UGPIOC? | +UGPIOC: <gpio_id>,<gpio_mode> [<gpio_id>,<gpio_mode> [….]] OK | +UGPIOC: 20,255 21,3 23,255 24,255 42,7,1 OK |
Test | AT+UGPIOC=? | +UGPIOC: (list of supported <gpio_id>),(list of supported <gpio_mode>),(list of supported <gpio_out_val>\<gpio_in_pull>\<gpio_sim_det_logic>) [<gpio_id1>,<gpio_mode> … <gpio_idN>,<gpio_mode>] OK | +UGPIOC: (20,21,23,24,42),(0-5,7,9,255),(0-2) OK |
Parameter | Type | Description |
---|---|---|
<gpio_id> | Number | GPIO pin identifier: pin number See the GPIO mapping for the available GPIO pins, their mapping and factory-programmed values on different u-blox cellular modules series and product version. |
<gpio_mode> | Number | Mode identifier: configured function See the GPIO functions for custom functions supported by different u-blox cellular modules series and product version. Allowed values:
|
<gpio_out_val> | Number | GPIO output value (for output function <gpio_mode>=0 only):
|
<gpio_in_pull> | Number | GPIO input value (for input function <gpio_mode>=1 only):
|
<gpio_sim_det_logic> | Number | SIM detection polarity (for SIM detection function <gpio_mode>=7 only):
|
<gpio_in_pull> is supported with limitations.
The network status indication (<gpio_mode>=2) and ring indicator function (<gpio_mode>=18) can be set on every pin except GPIO3 and GPIO6.
The module status indication function (<gpio_mode>=10) can be set on GPIO2 and GPIO4 only.
The following features can be set on GPIO3 and GPIO6 only: fast power-off (<gpio_mode>=24), safe memory and power-off (<gpio_mode>=33), UPSV control (<gpio_mode>=34).
+UGPIOR | ||||||
Modules | All products | |||||
Attributes | Syntax | PIN required | Settings saved | Can be aborted | Response time | Error reference |
full | No | No | No |
Reads the current value of the specified GPIO pin, no matter whether it is configured as input or output (see the +UGPIOC AT command to define the GPIO function). The parameters range is shown in the information text response to the test command.
Type | Syntax | Response | Example |
---|---|---|---|
Set | AT+UGPIOR=<gpio_id> | +UGPIOR: <gpio_id>,<gpio_val> OK | AT+UGPIOR=20 +UGPIOR: 20,0 OK |
Test | AT+UGPIOR=? | +UGPIOR: (list of supported <gpio_id>s) OK | +UGPIOR: (20, 21) OK |
Parameter | Type | Description |
---|---|---|
<gpio_id> | Number | GPIO pin identifier: pin number See the GPIO mapping for the available GPIO pins, their mapping and factory-programmed values on different u-blox cellular modules series and version. |
<gpio_val> | Number | GPIO value. Allowed values are 0 and 1. |
The set command works only if the <gpio_mode> parameter of the +UGPIOC AT command is set to 0 or 1.
+UGPIOW | ||||||
Modules | All products | |||||
Attributes | Syntax | PIN required | Settings saved | Can be aborted | Response time | Error reference |
full | No | No | No |
Sets ("writes") the output of the specified GPIO pin, but only if it is configured in output function (see the +UGPIOC AT command to set the pin as output).
Type | Syntax | Response | Example |
---|---|---|---|
Set | AT+UGPIOW=<gpio_id>,<gpio_out_val> | OK | AT+UGPIOW=20,1 OK |
Test | AT+UGPIOW=? | +UGPIOW: (list of supported <gpio_id>s),(list of supported <gpio_out_val>s) OK | +UGPIOW: (20, 21),(0-1) OK |
Parameter | Type | Description |
---|---|---|
<gpio_id> | Number | GPIO pin identifier: pin number See the GPIO mapping for the available GPIO pins, their mapping and factory-programmed values on different u-blox cellular modules series and version. |
<gpio_out_val> | Number | GPIO value. Allowed values are 0 and 1. |
The set command works only if the <gpio_mode> parameter of the +UGPIOC AT command is set to 0.