GtDio6xChannelGetPmuComparisonResult

Applies To

GX5296

Purpose

Returns the PMU input comparators states and comparison validity bit.

Syntax

GtDio6xChannelGetPmuComparisonResult (nHandle, nChannel, pdwComparisonResults, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Board handle is a session identifier returned by calling GtDio6xInitialize or GtDio6xSetupInitialization.
nChannel
SHORT
Used to specify the channel to Get. This parameter is 0-based and refers to any channel in the Domain.
This function does not support auxiliary channels.
pdwComparisonResults
PDWORD
Returned comparison result, the returned comparison result has the following structure:
Bit 0: Low level comparison result:

     Low limit: The actual input level was below the comparator low level as was set by GtDio6xChannelSetPmuComparatorsValues API.

     Bit high: The actual input level was equal or above the comparator low level as was set by GtDio6xChannelSetPmuComparatorsValues API.

Bit 1: High level comparison result:

     Bit low: The actual input level was below the comparator high level as was set by GtDio6xChannelSetPmuComparatorsValues API.

     Bit high: The actual input level was equal or above the comparator high level as was set by GtDio6xChannelSetPmuComparatorsValues API.

Bit 2: Comparison status,  returns the validity of the low and high comparators result (see comments for details):

     Bit low: Passed comparison.

     Bit high: Failed comparison.

pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Each channel’s PMU (parametric measurement unit) supports two high-speed window comparators. The PMU on-chip window comparator supports 2-bit “go / no-go” test with a low and high threshold settings. The comparators can be used for a high speed go / no-go” test of the I/O voltage at any time or when the specified channel is set to be in Forced Voltage mode the user  can either do a high speed go / no-go” test of the I/O voltage or current.

I/O Voltage comparison

The PMU comparator window compares the I/O voltage against an upper and lower voltage limits. The voltage thresholds are set using the GtDio6xChannelSetPmuComparatorsValues function call.

NOTE: The comparators source needs to be set to set to voltage comparison by calling GtDio6xChannelSetPmuComparatorsSource API.

Forced Current comparison

The PMU comparator window compares the output forced current level against an upper and lower current limits. The current thresholds are set using the GtDio6xChannelSetPmuComparatorsValues function call, and the values are in mA.

In order to get higher comparison accuracy the user may set the comparators ‘current range by calling GtDio6xChannelSetPmuForcedCurrent with the desired current range API.

NOTE: The comparators source needs to be set to current comparison by calling GtDio6xChannelSetPmuComparatorsSource API.

Validity bit description

The following table lists the comparators’ Validity bit description:

Condition
Comparison Validity
Level > High Comparator’s Threshold
1
Level < Low Comparator’s Threshold
Level < High Comparator’s Threshold and Level > Low Comparator’s Threshold
Invalid

 

Note: The PMU window comparator low and high outputs can be read back directly providing direct access to the actual comparator status at any time.

Note: Current comparison is available on any GX5296 board that was calibrated after June 11, 2012 and using GTDIO v4.1 (Build 60) or above.

Example

I/O Voltage comparison example:

This example demonstrates the comparison of channels 0 and 2 I/O voltage levels:

 

SHORT nStatus;

LONG alChannelList[2];

DWORD dwComparisonResult;

 

// Fill channel array

alChannelList[0] = 0;

alChannelList[1] = 2;

 

// Setup comparators source to voltage comparison

GtDio6xChannelSetPmuComparatorsSource(nHandle, 2, alChannelList, GTDIO6X_PMU_COMPARATORS_SOURCE_IO_VOLTAGE, &nStatus);

// Set channels 0 and 2 high and low comparator voltage level

GtDio6xChannelSetPmuComparatorsValues(nHandle, 2, alChannelList, 2.5, -1, &nStatus);

// Returns the Comparison result

GtDio6xChannelGetPmuComparisonResult(nHandle, 1 &dwComparisonResult, &nStatus);

Forced Voltage current comparison example:

This example demonstrates the comparison of channels 0 and 2 current low and high levels in forced voltage mode:

SHORT  nStatus;

DWORD  dwComparisonResult;

 

GtDio6xChannelSetMode(nHandle, 2, alChannelList, GTDIO6X_CHANNEL_MODE_PMU_FORCE_VOLTAGE, &nStatus) ;

// Set channels 0 and 2 forced voltage level

GtDio6xChannelSetPmuForcedVoltage (nHandle, 2, alChannelList, 1.5, GX529X_PMU_CURRENT_RANGE_N32MA_TO_P32MA, GTDIO6X_PMU_FV_SETUP_DEFAULT, 0, &nStatus);

 

// Set channels 0 and 2 high and low comparator current level (in mA)

GtDio6xChannelSetPmuComparatorsValues(nHandle, 2, alChannelList, 2.5, -1, &nStatus);

// Returns the Comparison result

GtDio6xChannelGetPmuComparisonResult(nHandle, 1, &dwComparisonResult, &nStatus);

 

See Also

GtDio6xChannelSetPmuComparatorsSource, GtDio6xChannelSetPmuComparatorsValues,  GtDio6xChannelGetPmuComparisonResult, GtDio6xChannelSetPmuForcedCurrent,  GtDio6xChannelSetPmuForcedVoltage, GtDio6xChannelSetPmuForcedCurrentCommutatingVoltage,  GtDio6xGetErrorString