Set Function; Get Function - Philips PC-Link Manual

Table of Contents

Advertisement

3.2.3. SET FUNCTION

Is used to set the I/O function on the module.
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.
ANALOG parameter represents 8 bits in 1 port. Each bit is cleared (0) when
used as digital i/o or set (1) when used as analog input. When the bit is set (1),
then DIRECT and PULL-UP parameters for that bit will be ignored. This
parameter only applies for PORT 0.
DIRECT parameter represents 8 bits (or 5 bits on General Purpose I/O) in 1
port. Each bit is cleared (0) when used as input or set (1) when used as output.
PULL-UP parameter represents 8 bits (or 5 bits on General Purpose I/O) in 1
port. Each bit is cleared (0) to put the represented pin on three-state/low
condition, or set (1) to activate its internal pull up resistor.
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
USB Smart I/O
will use Digital I/O bit 4-7 as output lines with 0 values, while bit 0-3 as input
lines with active internal pull up resistors.

3.2.4. GET FUNCTION

Is used to read I/O function settings on the module.
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.
ANALOG parameter represents 8 bits in 1 port. Each bit is cleared (0) when
used as digital i/o or set (1) when used as analog input. When the bit is set (1),
then DIRECT and PULL-UP parameters for that bit must be ignored. This
parameter only applies for PORT 0.
DIRECT parameter represents 8 bits (or 5 bits on General Purpose I/O) in 1
port. Each bit is cleared (0) when used as input or set (1) when used as output.
PULL-UP parameter represents 8 bits (or 5 bits on General Purpose I/O) in 1
port. Each bit is cleared (0) if the represented pin is on three-state/low
condition, or set (1) if the internal pull up resistor on the pin is active.
If packet is recognized and correct, module will respond with EEPROM reading
data result.
Byte
Command
Count
5
0x10
0xAA
1
0xEE
: 0x58 0x05 0x10 0x01 0x00 0xF0 0x0F 0x93
: 0x58 0x01 0xAA 0xFD
Byte Count Command
2
0x11
4
0x11
1
0xEE
Parameter
PORT
ANALOG
Parameter
ANALOG
DIRECT
9
DIRECT
PULL-UP
-
-
PORT
PULL-UP
-

Advertisement

Table of Contents
loading

Table of Contents