Hardware Information: PIC I/O card


External HD-15 connector pinout

Pin # Channel Assignment
011Analog Input 1 / Digital Input 1 / Frequency Input
021Analog Input 2 / Digital Input 2
031Analog Input 3 / Digital Input 3 (pseudo)
041Analog Input 4 / Digital Input 4 (pseudo)
051Analog Input 5 / Digital Input 5 (pseudo)
061Analog Input 6 / Digital Input 6 (pseudo)
071Analog Input 7 / Digital Input 7 (pseudo)
081Analog Input 8 / Digital Input 8 (pseudo)
091Variable Programming Voltage   (not currently implemented)
101Ground
111Digital Output 1 / PWM Output
121Digital Output 2
131Digital Output 3
141Digital Output 4
151Optional Output Pullup Voltage

Note: This card cannot be used to power the .


Event definitions

There are no events specific to this card.


Please also see generic events for non card-specific events.

I/O messages

I/O messages are normal Protocol FT_DATA messages sent to or received from the card. The header is a single byte which specifies which value is to be read or written. Any data required for a given header byte should be placed in the data portion of the FT_DATA message.

NOTE: Multi-byte data values for reads and writes of Data Messages should be in little endian format which is normal for x86 computers.

Read Data Messages

The header byte determines the value to be read as shown below. An FT_DATA message with no data bytes is used as a read request. The card will respond with an FT_DATA having the same header as the request and the requested data.


Header Description Returned Data
GET_CAP_VAL_1 (0x81) Get first capture value (period) Signal period from input on pin 1 in tenths of microseconds. The value is returned as a long value of four bytes. The minimum period is somewhere around 25 microseconds which corresponds to 40kHz
GET_DIGITAL_IN (0x82) Read digital inputs The eight digital inputs on pins 1 through 8 are returned in bits 0 and 1 respectively of a single byte. The inputs on pins3 through 8 are read as analog values and converted to a 0 or 1 based on whether the value is less than or greater than or equal to 2.00 volts.
GET_DIGITAL_OUT (0x83) Read digital outputs The four digital outputs on pins 11 through 14 are returned in bits 0 through 3 respectively of a single byte.
GET_ANALOG_IN1 (0x90) Read analog input 1 The voltage on pin 1 in floating point format (four bytes).
GET_ANALOG_IN2 (0x91) Read analog input 2 The voltage on pin 2 in floating point format (four bytes).
GET_ANALOG_IN3 (0x92) Read analog input 3 The voltage on pin 3 in floating point format (four bytes).
GET_ANALOG_IN4 (0x93) Read analog input 4 The voltage on pin 4 in floating point format (four bytes).
GET_ANALOG_IN5 (0x94) Read analog input 5 The voltage on pin 5 in floating point format (four bytes).
GET_ANALOG_IN6 (0x95) Read analog input 6 The voltage on pin 6 in floating point format (four bytes).
GET_ANALOG_IN7 (0x96) Read analog input 7 The voltage on pin 7 in floating point format (four bytes).
GET_ANALOG_IN8 (0x97) Read analog input 8 The voltage on pin 8 in floating point format (four bytes).

Write Data Messages

The header byte determines the value to be written as shown below. An FT_DATA message with one or more data bytes is used as a write request. If the write is successful, no response occurs.


Header Description Sent Data
SET_PWM_VAL_1 (0x02) Set the first PWM output value. The percentage of on time for a cycle of of output of the first PWM output in 0.01%. Valid values range from 0.00% to 100.00% (0 to 10000) The data field is two bytes long.
SET_DIGITAL_OUT (0x04) Set one or more digital outputs. Each set bit in the single data byte causes the corresponding digital output to be set. All reset bits in the single data byte are ignored.
CLR_DIGITAL_OUT (0x05) Clear one or more digital outputs. Each set bit in the single data byte causes the corresponding digital output to be reset. All reset bits in the single data byte are ignored.
TOG_DIGITAL_OUT (0x06) Toggle one or more digital outputs. Each set bit in the single data byte causes the corresponding digital output to be toggled. All reset bits in the single data byte are ignored.
CLR_DIGITAL_OUT (0x05) Clear one or more digital outputs. Each set bit in the single data byte causes the corresponding digital output to be reset. All reset bits in the single data byte are ignored.

Card-specific IOCTL definitions

These values are used with the CMD_CARD_IOCTL command.
Please see the include files dev_iopic.h for numeric values of IOCTLS and data field bit assignments.

NOTES:
Multi-byte data values should be in little endian format which is normal for x86 computers. The four byte field that contains the IOCTL value, however, is in big endian format (network byte order)

At 0% and 100% the PWM output is constant. The PWM output may disabled by setting the mode parameter of the GDGIOSETPWM1 IOCTL to zero. The variable output voltage mode of the PWM output is not currently implemented.

The second parameter of the GDGIOSETCAP1 IOCTL, the number of triggers per cycle or revolution, allows the period measurement to encompass from 1 to 16 triggers. In the case of unevenly spaced multiple triggers per cycle, this allows all of the time periods of a cycle to be added together. It can also be used as a averaging mechanism if there is only one trigger per revolution. The periods are still added together so that the value read via GET_CAP_VAL_1 must be divided by the number of triggers per cycle to get the correct period.

To stop a periodic transmission that has been started with the GDGIOSETPERn IOCTL, use the same IOCTL but set the number of messages to transmit to zero. In this case the additional bytes (4 through 15) are not needed.

IOCTL name Function Data field length/purpose
GDGIOSETPWM1 Setup the first PWM output Seven data bytes
  • Bytes 1 thru 4: Frequency in 0.1Hz increments (range is from about 0.3Hz to 78.4kHz)
  • Bytes 5 and 6: Initial value in 0.01% increments
  • Byte 7: Mode
    0 -> off
    1 -> PWM output to digital output 1 (pin 1)
    2 -> PWM output to variable voltage (pin 9)
    3 -> PWM output to both of above
GDGIOSETCAP1 Setup the first frequency input Four data bytes
  • Byte 1: Rising/Falling edge trigger (0/1)
  • Byte 2: Triggers per cycle/revolution (1 to 16)
  • Bytes 3 and 4: Maximum time in milliseconds between triggers. If this time is exceeded, the frequency is set to zero. A maximum value of 65,535ms corresponds to about 0.015Hz if byte 2 is equal to 2.
GDGIOSETPER1 Setup the first periodic transmission Variable number of data bytes
  • Bytes 1 and 2: The number of milliseconds between each transmission.
  • Byte 3: The number of messages to transmit. Must be between 1 and 12.
  • Bytes 4 through 15: The ID (header) codes for the data to be periodically transmitted by the card.
GDGIOSETPER2 Setup the second periodic transmission Variable number of data bytes
  • Bytes 1 and 2: The number of milliseconds between each transmission.
  • Byte 3: The number of messages to transmit. Must be between 1 and 12.
  • Bytes 4 through 15: The ID (header) codes for the data to be periodically transmitted by the card.
GDGIOSETPER3 Setup the third periodic transmission Variable number of data bytes
  • Bytes 1 and 2: The number of milliseconds between each transmission.
  • Byte 3: The number of messages to transmit. Must be between 1 and 12.
  • Bytes 4 through 15: The ID (header) codes for the data to be periodically transmitted by the card.
GDGIOSETPER4 Setup the fourth periodic transmission Variable number of data bytes
  • Bytes 1 and 2: The number of milliseconds between each transmission.
  • Byte 3: The number of messages to transmit. Must be between 1 and 12.
  • Bytes 4 through 15: The ID (header) codes for the data to be periodically transmitted by the card.
GDGIOGETGAIN Get the gain of the specified analog channel Two data bytes
  • Byte 1: The analog channel number (0 through 7).
  • Byte 2: The channel's current gain value.
GDGIOSETGAIN Set the gain of the specified analog channel Two data bytes
  • Byte 1: The analog channel number (0 through 7).
  • Byte 2: The channel's new gain value. Must be 1, 2, 4, 5, 8, 10 or 16. The default value is 1.
GDGIOGETSTATE Get the scan state of the requested analog channel Two data bytes
  • Byte 1: The analog channel number (0 through 7).
  • Byte 2: The channel's current scan state, 0 = off (not scanning); 1 = on (scanning).
GDGIOSETSTATE Set the scan state of the requested analog channel Two data bytes
  • Byte 1: The analog channel number (0 through 7).
  • Byte 2: The channel's new scan state, 0 = off (not scanning); 1 = on (scanning). Defaults to off.