Applies To
GC5050, GX5050, GX5150
Purpose
Sets the group Low level, High level and Threshold voltages.
Syntax
DioLevelShifterSetVoltage (nHandle, nGroup, dLowVoltage, dHighVoltage, dThresholdVoltage, pnStatus)
Parameters
Name |
Type |
Comments |
nHandle |
SHORT |
Board handle. |
nGroup |
SHORT |
Group number can be as follows: 0 Group A, I/O pins 1 through 16. 1 Group B, I/O pins 17 through 32. |
dLowVoltage |
DOUBLE |
Low Voltage setting. See Comments for details. |
dHighVoltage |
DOUBLE |
High voltage setting. See Comments for details. |
dTresholdVoltage |
DOUBLE |
Threshold voltage setting. See Comments for details. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Comments
Voltage settings are limited by the voltage range setting as follows:
Level Shifter revision āCā:
Voltage range set to 0 (0 to 11):
Low Voltage: 0 to 8 volts and dLowVoltage must be < dHighVoltage.
High Voltage: 2.5 to 10.6 volts and dHighVoltage must be > dLowVoltage.
Threshold Voltage: -0.5 to 9.5 volts.
Voltage range set to 1 (-3 to 8):
Low Voltage: -3 to 5 volts and dHighVoltage must be > dLowVoltage.
High Voltage: 0 to 8 volts and dHighVoltage must be > dLowVoltage.
Threshold Voltage: - 3 to 6.5 volts
Level Shifter revision āDā and above (single voltage range):
Low Voltage: -3 to 8 volts and dLowVoltage must be < dHighVoltage.
High Voltage: 3 to 8 volts and dHighVoltage must be > dLowVoltage.
Threshold Voltage: -3 to 8 volts.
Groups operate independently from each other, that is, the setting of one group does not affect the other. Threshold voltages apply only to input signals. They are used to determine whether the signal on any pin in the specified group is higher or lower than the threshold voltage. The level shifter support frequencies up to 50MHz for both input and output signals.
Note: If any of the voltages is out of the out of the current range setting, the function returns with error.
Example
The following example sets the Level Shifter voltages as follow:
Group = B
Low voltage level = 1.2
High voltage level = 6.8
Threshold voltage = 3.2
SHORT nStatus;
DioLevelShifterSetVoltage (nHandle, 1, 1.2, 6.8, 3.2, &nStatus);
See Also
DioLevelShifterGetVoltage, DioGetErrorString