ADM00310 Microchip Technology, ADM00310 Datasheet - Page 21

no-image

ADM00310

Manufacturer Part Number
ADM00310
Description
BOARD EVAL FOR MCP3903 AFE
Manufacturer
Microchip Technology
Series
-r
Datasheets

Specifications of ADM00310

Design Resources
MCP3903 Eval Brd BOM MCP3903 Eval Brd Schematic
Main Purpose
Interface, Analog Front End (AFE)
Embedded
Yes, MCU, 16-Bit
Utilized Ic / Part
MCP3903, PIC24F, PIC24H, dsPIC33, MCP2200
Primary Attributes
-
Secondary Attributes
-
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
2.3.1.21
Function:
int SimpleIOClass::ReadPortValue()
EXAMPLE 2-21:
2.3.1.22
Function:
int SimpleIOClass::SelectDevice(unsigned int uiDeviceNo)
EXAMPLE 2-22:
 2011 Microchip Technology Inc.
Summary:
Description:
Precondition:
Parameters:
Returns:
Remarks:
Summary:
Description:
Precondition:
Parameters:
Returns:
Remarks:
int iResult;
rv = SimpleIOClass::ReadPortValue()
if (rv != 0x8000)
{
}
else
iResult = SimpleIOClass::SelectDevice(1)
if (iResult == 0)
{
}
else
int rv;
lblStatusBar->Text = “Success”;
lblStatusBar->Text = “Invalid command ” +
lblStatusBar->Text = “Success”;
lblStatusBar->Text = “Error selecting device”;
ReadPortValue
SelectDevice
Reads the GPIO port as digital input.
Reads the GPIO port and returns the value of the port. This provides a method to read all pins
simultaneously, instead of one-by-one. In case of an error, the returned value will be 0x8000.
Must be previously configured as an input via a
VID and PID must be previously set via a call to
None.
Pins configured for output return the current state of the port. Pins configured as input read as zero.
Selects one of the active devices in the system.
The function is used to select one of the detected devices in the system as the “active device”.
At least one call to the
devices. Also, in order to know the actual number of devices in the system, call the
SimpleIOClass::IsConnected()
InitMCP2200(VID, PID)
uiDeviceNo
devices minus 1).
This function returns ‘
Call the
recent number of devices that are present in the system.
This function returns True if the transmission is successful and returns False if the transmission fails.
E_WRONG_DEVICE_ID (-1)
E_INACTIVE_DEVICE (-2)
SimpleIOClass::IsConnected()
- the ID of the device to be selected (can have a value between 0 and the number of
0
InitMCP2200()
’ in case of selection success, otherwise it will return:
.
for a device ID that is out of range
for an inactive device.
function. VID and PID must be previously set via a call to
is required in order to initiate a DLL search for the compatible
prior to the call of this function in order to have the most
SimpleIOClass::LastError;
ConfigureIO
InitMCP2200(VID, PID)
call.
.
MCP2200
DS22228B-page 21

Related parts for ADM00310