
SARA-R4/N4 series - AT Commands Manual
UBX-17003787 - R09
23 I
2
C
Page 243 of 307
23 I
2
C
23.1 Introduction
The I
2
C AT commands support communication with more than one connected device via one of the controllers,
but require opening and closing a logical channel for each connected device. Only one logical channel at a time
can be opened.
The availability and hardware description of the I
2
C interfaces are out of the scope of this document and
are described in a separate document. Refer to the corresponding module System Integration Manual.
The procedure for communicating with two different devices is:
• Open the logical channel for device1 (with
)
• Read/write to/from device1 (with
)
• Close the logical channel for device1 (with
• Open the logical channel for device2 (with
)
• Read/write to/from device2 (with
• Close the logical channel for device2 (with
)
Once the controller has been configured, it is possible to start I
2
C communication (read/write) with I
2
C slave
peripherals.
The I
2
C controllers available on the u-blox cellular modules module work only in Master Mode so they can
be connected to slave devices only.
In case of a controller/device malfunction, the command's response is only "ERROR".
23.2 I
2
C open logical cUI2CO
+UI2CO
SARA-R410M-02B SARA-R410M-52B SARA-R412M
Modules
SARA-N4
Syntax
PIN required
Settings saved Can be aborted
Response time Error reference
Attributes
full
No
No
No
-
23.2.1 Description
Changes the hardware and logical configuration of the selected I
2
C controller.
It is only possible to configure the I
2
C controller in Master Mode.
This command selects:
• The controller available in the u-blox cellular module
• The bus mode type
• The bit rate
• The address size (7-10 bit address)
• The slave device address
Once the selected controller has been configured, a logical channel between it and the selected slave device is
set up and there is no need to further specify it. All the following I
2
C write, read and close commands refer to
the currently opened logical channel. It is not possible to use the I
2
C write, read and open commands for writing
or reading to/from a different slave device without first closing the I
2
C logical channel.
23.2.2 Syntax
Type
Syntax
Response
Example
Set
AT+UI2CO=<I2C_controller_
number>,<bus_mode>,<bit_rate>,
<device_address>,<address_width>
OK
AT+UI2CO=1,0,0,0x42,0
OK
Test
AT+UI2CO=?
+UI2CO: (list of supported <I2C_
controller_number>s),(list of
+UI2CO: (1),(0-1),(0-1),(0x000-0
x3FF),(0-1)