I have a BL26500 single board computer. I start my program by intializaing peripherals like the AI, AO, DIO, and high-current DO. After I call anaOutVolts, anaInVolts no longer works. Do I have to reconfigure before every call?
anaInVolts
SYNTAX: float anaInVolts(int channel, int gaincode);
DESCRIPTION: Reads the state of a single-ended analog input channel
and uses the previously set calibration constants to
convert it to volts. This function is non-reentrant.
Note:
-----
If the gaincode for a given channel has changed from the
previous cycle then the following code accesses will occur.
1. The eeprom will be read to get the calibration constants
for the new gain value.
2. The DAC will be written to bias the ADC input circuit
for proper operation (The DAC access only applies for
the single-ended bipolar ADC operation).
PARAMETER1: ADC channel of 0 - 7, AIN00 - AIN07.
PARAMETER2: Gaincode of 0 to 7. The table below applies for Single-
Ended modes only:
Gaincode Macro SE-Unipolar SE-Bipolar
-------- ------ ----------- ----------
0 GAIN_X1 20V �10V
1 GAIN_X2 10V �5V
2 GAIN_X4 5V �2.5V
3 GAIN_X5 4V �2.0V
4 GAIN_X8 2.5V �1.25V
5 GAIN_X10 2V �1.00V
6 GAIN_X16 1.25V ----
7 GAIN_X20 1.00V ----
Note:
------
SE = Signal-Ended mode
RETURN VALUE: A voltage value corresponding to the voltage that’s on the
analog input channel, or a value of -4096 which indicates
a overflow or out of range condition.
SEE ALSO: brdInit, anaInConfig, anaIn, anaInmAmps, anaInDiff,
anaInCalib
anaOutVolts
SYNTAX: void anaOutVolts(int ch, float voltage);
DESCRIPTION: Sets the voltage of an analog output channel by using
the previously set calibration constants to calculate
the correct data values. This function is non-reentrant.
PARAMETER1: The DAC output channel (0 - 3).
PARAMETER2: The desired voltage on the output channel.
RETURN VALUE: None.
SEE ALSO: brdInit, anaOut, anaOutStrobe, anaOutConfig, anaOutCalib