//all 16 bits will be updated.
ePut (lngHandle, LJ_ioPUT_ANALOG_
ENABLE_PORT, 0, 65287, 16);
ng channel of 2,
/a value of b00111 (=d7), and 5 bits will be updated.
will need to initialize the flexible I/O to a known pin
tion. One way to do this is with the following pseudocode:
IMERS_ENABLED, 0, 0);
NTER_PIN_OFFSET, 0, 0);
Handle, LJ_ioPUT_CONFIG, LJ_chTIMER_CLOCK_BASE, LJ_tc24MHZ, 0);
Handle, LJ_ioPUT_CONFIG, LJ_chTIMER_CLOCK_DIVISOR, 0, 0);
Put (lngHandle, LJ_ioPUT_COUNTER_ENABLE, 0, 0, 0);
0, 0, 16);
is disables all timers and counters, sets the timer/counter pin offset to 0, sets the timer clock
is using the following IOType created exactly for this
urpose, which does the same thing as the 8 function calls above:
here are two IOTypes used to write or read general U3 configuration parameters:
J_chPRODUCTID
write and read the local
/Read the local ID.
hLOCALID, &dblValue, 0);
e IOTypes to retrieve a command/response analog input reading are:
//Configure FIO2-FIO4 as analog, and FIO5-FIO6 as digital, without
//configuring any other bits. That means a starti
/
ePut (lngHandle, LJ_ioPUT_ANALOG_ENABLE_PORT, 2, 7, 5);
Because of the pin configuration interaction between digital I/O, analog inputs, and
timers/counters, many software applications
configura
ePut (lngHandle, LJ_ioPUT_CONFIG, LJ_chNUMBER_T
ePut (lngHandle, LJ_ioPUT_CONFIG, LJ_chTIMER_COU
ePut (lng
ePut (lng
e
ePut (lngHandle, LJ_ioPUT_COUNTER_ENABLE, 1, 0, 0);
Put (lngHandle, LJ_ioPUT_DAC_ENABLE, 1, 0, 0);
e
ePut (lngHandle, LJ_ioPUT_ANALOG_ENABLE_PORT,
Th
base to 24 MHz (no divisor), sets the timer clock divisor to 0, disables DAC1, and sets all
flexible I/O to digital. A simpler option
p
ePut (lngHandle, LJ_ioPIN_CONFIGURATION_RESET, 0, 0, 0);
T
LJ_ioPUT_CONFIG
LJ_ioGET_CONFIG
The following constants are then used in the channel parameter of the config function call to
pecify what is being written or read:
s
LJ_chLOCALID
LJ_chHARDWARE_VERSION
LJ_chSERIAL_NUMBER
LJ_chFIRMWARE_VERSION
LJ_chBOOTLOADER_VERSION
L
LJ_chLED_STATE
Following is example pseudocode to ID:
//Set the local ID to 4.
ePut (lngHandle, LJ_ioPUT_CONFIG, LJ_chLOCALID, 4, 0);
/
eGet (lngHandle, LJ_ioGET_CONFIG, LJ_c
4.3.3 Analog Inputs
Th
63