Averaging, Statistics, And Outlier Detection Options; Internal Temperature Sensor Channels - Analog Devices ADuCM356 Reference Manual

Table of Contents

Advertisement

Reference Manual
ADC CIRCUIT
AVERAGING, STATISTICS, AND OUTLIER
DETECTION OPTIONS
Averaging Option
The ADuCM356 supports averaging of the sinc3 output. The num-
ber of samples to average is configured via ADCFILTERCON,
Bits[15:14].
Statistics Option
The ADuCM356 supports the calculation of the mean value for a
programmable sample size of the sinc3 output. This calculation is
controlled by the STATSCON register. The number of samples used
for statistics is configured via STATSCON, Bits[6:4].
Outlier Detection Options
The ADuCM356 provides outlier detection. Use the ADCMIN and
ADCMAX registers to trigger an interrupt if the ADCDAT result from
the ADC is outside the limits of the value in the ADCMIN and
ADCMAX registers.
The hysteresis values are also programmable. For more details,
see the
Minimum Value Check Register
ue Check Register
section, and the
INTERNAL TEMPERATURE SENSOR
CHANNELS
The ADuCM356 analog die contains two internal temperature sen-
sor channels.
Temperature Sensor 0
The temperature sensor outputs a voltage proportional to die tem-
perature. This voltage is linear relative to temperature. This internal
channel is measured via the ADC by selecting the temperature
sensor channels as the positive and negative inputs from the mux.
The die temperature is calculated by the following:
(TEMPSENSDAT0/(PGA Gain × K)) − 273.15
where K = 8.13.
For improved accuracy, configure the temperature sensor in chop
mode via TEMPCON0, Bits[3:1]. If chopping is selected, the user
must ensure an even number of ADC conversions take place on the
temperature sensor channel and that these results are averaged.
Dedicated calibration registers for the temperature sensor channel
are also available. When the ADC selects the temperature sensor
as the positive input, the calibration values in the ADCOFFSET-
TEMPSENS0 and ADCGAINTEMPSENS0 registers are automati-
cally used.
To enable the internal temperature sensor, set AFECON, Bit 12 = 1.
Select ADC input channels as follows:
analog.com
section, the
Maximum Val-
Delta Check Register
section.
(4)
ADCCON, Bits[12:8] = 01011 to select the ADC negative input
channel.
ADCCON, Bits[5:0] = 001011 to select the positive input channel.
To start an ADC conversion of the temperature sensor channel, set
AFECON, Bit 13 and AFECON, Bit 8 to 1. For optimal temperature
sensor results, enable chop mode of the temperature sensor with
the 6.25 kHz chopping frequency. Then, average an even number
of ADC temperature sensor results to eliminate any inaccuracies
due to the chopping clock.
The following code snippets demonstrate how to set up and use the
Temperature Sensor 0:
void InitAfeADC(void)
{
AfeAdcPwrUp(BITM_AFE_AFECON_AD►
CEN);
// power up the ADC
AfeAdcCfg(GNPGA_1_5,
0);
measure Temp. output
AfeAdcChan(MUXSELP_TEMP,MUX►
SELN_TEMPN);
// Select Temp sensor inputs
to the ADC
AfeAdcIntCfg(
BITM_AFE_ADCINTIEN_ADCRDYIEN| //
Select ADCReady and Temp sensor channels as
interrupt sources
BITM_AFE_ADCINTIEN_TEMPRDYIEN);
pADI_AFE->AFECON |=
BITM_AFE_AFECON_TEMPSEN►
SEN0;
sensor channel
pADI_AFE-> TEMPCON0 =
0x2;
Temp sensor chopping with 6.25kHz chop clock
pADI_AFE->REPEATADCCNV = 0x11;
NVIC_Enable►
IRQ(AFE_ADC_IRQn);
AFE_ADC interrupt source in NVIC
}
// ADC Interrupt handler
void AfeAdc_Int_Handler()
{
uiIntSta = AfeAdcIntSta();
if (uiIntSta & BITM_AFE_ADCINTSTA_ADCRDY)
{
}
if (uiIntSta & BITM_AFE_ADCINTSTA_TEMPR►
DY) // Check for Temp sensor flag
{
TEMP_RESULT= AfeAdcRd(TEMPSENSOR);
pADI_AFE->ADCINTSTA |=
BITM_AFE_ADCINTSTA_TEMPR►
DY;
// Clear interrupt flag
}
ADuCM356
// Configure ADC to
// Enable the ADC temp
// Turn on
// Enable
Rev. A | 57 of 312

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ADuCM356 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents