Doubt about ADCConversionGroup Structure
Posted: Mon Mar 12, 2012 11:04 am
Hi,
In Sample code ADCConversionGroup is defined as follow
Here first four fields are circular buffer enable/disable, number of channels to poll, call back function and error pointer.
In HW dependent part CR1 and CR2 are configured first.
Then Sampling time is set for Channel AN11 (56 cycles) and Temperature Sensor (144 cycles) in SMPR1 register.
SMPR2 register is defined as zero.
I am not able to understand values defined in last three registers ADC_SQR1, ADC_SQR2 and ADC_SQR3
Sapan
In Sample code ADCConversionGroup is defined as follow
Code: Select all
static const ADCConversionGroup adcgrpcfg = {
FALSE,
ADC_GRP1_NUM_CHANNELS,
adccb,
NULL,
/* HW dependent part.*/
0,
ADC_CR2_SWSTART,
ADC_SMPR1_SMP_AN11(ADC_SAMPLE_56) | ADC_SMPR1_SMP_SENSOR(ADC_SAMPLE_144),
0,
ADC_SQR1_NUM_CH(ADC_GRP1_NUM_CHANNELS),
0,
ADC_SQR3_SQ2_N(ADC_CHANNEL_IN11) | ADC_SQR3_SQ1_N(ADC_CHANNEL_SENSOR)
};Here first four fields are circular buffer enable/disable, number of channels to poll, call back function and error pointer.
In HW dependent part CR1 and CR2 are configured first.
Then Sampling time is set for Channel AN11 (56 cycles) and Temperature Sensor (144 cycles) in SMPR1 register.
SMPR2 register is defined as zero.
I am not able to understand values defined in last three registers ADC_SQR1, ADC_SQR2 and ADC_SQR3
Sapan