Get Bit; Set Byte; Get Byte - Philips PC-Link Manual

Table of Contents

Advertisement

3.2.7. GET BIT

Is used to command the module to read 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 the value of the bit (register PINx), cleared (0)
for low logic or set (1) for high logic.
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 of bit 2 on Analog Input and
module replies that the logic on that bit is low.

3.2.8. SET BYTE

Is used to command the module to change 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 the value of the byte that will be sent to the port.
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 0x55 to Analog Input.

3.2.9. GET BYTE

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 PINx).
Byte Count
Command
3
0x14
2
0x14
1
0xEE
: 0x58 0x03 0x14 0x00 0x02 0x8F
: 0x58 0x02 0x14 0x00 0x92
Byte Count
Command
3
0x15
0xAA
1
0xEE
: 0x58 0x03 0x15 0x00 0x55 0x3B
: 0x58 0x01 0xAA 0xFD
Byte Count
2
2
1
11
Parameter
PORT
BITVALUE
-
Parameter
PORT
-
-
Command
Parameter
0x16
0x16
BYTEVALUE
0xEE
BIT
BYTEVALUE
PORT
-

Advertisement

Table of Contents
loading

Table of Contents