will send start condition
,
0xD0 (I
2
C device write address that will be accessed),
0x01, 0x02, 0x03, and stop condition
.
3.2.18.I2C GET PACKET
Is used to command the module to read 1 data packet via I
2
C line.
Byte Count
Command
Parameter
Host Command
3
0x27
ADDR
COUNT
Module
Response
2 – 33
0x27
1 – 32 byte
1
0xEE
-
ADDR parameter is the I
2
C device address that will be accessed.
COUNT parameter is the amount of data that will be read.
This command will only perform the reading process. To choose the data
address that will be read (for example, accessing EEPROM), data address can
be determined previously using the I2CSENDPACKET.
Module will send start condition, I
2
C device read address (ADDR|0x01), read
data as many as COUNT, and send stop condition
.
If packet is recognized and correct, module will respond with data reading
results (maximum of 32 bytes).
If the packet is false/not recognized, module will respond with NACK (0xEE).
Example:
PC
: 0x58 0x03 0x27 0xD0 0x01 0xAD
USB Smart I/O
: 0x58 0x02 0x27 0x03 0x7C
means that the computer commands the module to read 1 byte of I
2
C device
with 0xD1 address. Module replies that the reading results via I
2
C is 0x03.
3.2.19.SET BAUD RATE
Is used to set UART baud rate.
Byte Count
Command
Parameter
Host Command
2
0x30
BAUDRATE
Module Response
1
0xAA
-
0xEE
BAUDRATE parameter is the baud rate value code.
Code 1 = baud rate 9600 bps
Code 2 = baud rate 19200 bps
Code 3 = baud rate 38400 bps
Code 4 = baud rate 57600 bps
This setting will be saved in EEPROM so it will not be erased when module is
powered off.
If packet is recognized and correct, module will respond with ACK (0xAA).
If the packet is false/not recognized, module will respond with NACK (0xEE).
Example:
PC
: 0x58 0x02 0x30 0x03 0x73
USB Smart I/O
: 0x58 0x01 0xAA 0xFD
will set baud rate to 38400 bps
.
15