Get Port; Set Bit - Philips PC-Link Manual

Table of Contents

Advertisement

If the packet is false/not recognized, module will respond with NACK (0xEE).
Example:
PC
USB Smart I/O
means that the computer requests for General Purpose I/O function and
module replies that all General Purpose I/O are digital inputs with active
internal pull-up resistors.

3.2.5. GET PORT

Is used to command the module to read the value of a certain port.
Host Command
Module Response
PORT parameter is the port code that will be accessed. 0 represents Analog
Input, 1 represents Digital I/O, and 2 represents General Purpose I/O.
BYTEVALUE parameter is the value of the port (register PORTx).
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
USB Smart I/O
means that the computer requests the value to Digital I/O and module replies
that the PORT value on that port is 0x88.

3.2.6. SET BIT

Is used to command the module to change the value of 1 pin on a certain port.
Host
Command
Module
Response
PORT parameter is the port code that will be accessed. 0 represents Analog
Input, 1 represents Digital I/O, and 2 represents General Purpose I/O.
BIT parameter are the bit numbers (0-7) that will be accessed.
BIT parameter VALUE are the values that will be sent to the bits. It is cleared
(0) to send low logic or set (1) to send high logic.
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
USB Smart I/O
will send a value of 1/high to Digital I/O bit 5.
: 0x58 0x02 0x11 0x02 0x93
: 0x58 0x04 0x11 0x00 0x00 0x1F 0x74
Byte Count
2
2
1
: 0x58 0x02 0x12 0x01 0x93
: 0x58 0x02 0x12 0x88 0x0C
Byte Count Command
4
0x13
0xAA
1
0xEE
: 0x58 0x04 0x13 0x01 0x05 0x01 0x8A
: 0x58 0x01 0xAA 0xFD
Command
0x12
0x12
0xEE
Parameter
PORT
10
Parameter
PORT
BYTEVALUE
-
BIT
BITVALUE
-
-

Advertisement

Table of Contents
loading

Table of Contents