If packet is recognized and correct, module will respond with data reading
result.
If the packet is false/not recognized, module will respond with NACK (0xEE).
Example:
PC
: 0x58 0x02 0x16 0x01 0x8F
USB Smart I/O
: 0x58 0x02 0x16 0x88 0x08
means that the computer requests the value of Digital I/O and module replies
that the PIN value of that port is 0x88.
3.2.10.GET ADC
Is used to command the module to read ADC value of a certain channel.
Byte Count
Command
Parameter
Host Command
2
0x17
CHANNEL
Module
Response
3
0x17
MSB
LSB
1
0xEE
-
CHANNEL parameter is the ADC channels (0-7) that will be read.
MSB parameter is the most significant byte of ADC reading result.
LSB parameter is the
least significant byte of ADC reading result.
If packet is recognized and correct, module will respond with data reading
result.
If the packet is false/not recognized, module will respond with NACK (0xEE).
Example:
PC
: 0x58 0x02 0x17 0x03 0x8C
USB Smart I/O
: 0x58 0x03 0x17 0x03 0xFF 0x8C
means that the computer requests the value of ADC channel 3 and module
replies that the ADC value of that channel is 1023 (0x03FF).
3.2.11.SET BIT RATE
Is used to set the I
2
C bit rate.
Byte Count
Command
Parameter
Host Command
3
0x20
BITRATEH
BITRATEL
Module
Response
1
0xAA
-
0xEE
RATEH parameter BIT is the most significant byte of BITRATE.
RATEL parameter BIT is the least significant byte of BITRATE.
BITRATE parameter is the bit rate value
in kHz. The allowed BITRATE value are
around 30-400.
This setting will be saved on 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 0x03 0x20 0x00 0x64 0x21
USB Smart I/O
: 0x58 0x01 0xAA 0xFD
sets the bit rate for I
2
C to 100 (0x0064) kHz.
12