[an error occurred while processing this directive]
|
Using the Multiple Sample and Convert (MSC) Bit
To configure the converter to perform successive conversions automatically
and as quickly as possible, a multiple sample and convert function is available.
When MSC = 1, CONSEQx > 0, and the sample timer is used, the first rising
edge of the SHI signal triggers the first conversion. Successive conversions
are triggered automatically as soon as the prior conversion is completed.
Additional rising edges on SHI are ignored until the sequence is completed in
the single-sequence mode or until the ENC bit is toggled in
repeat-single-channel, or repeated-sequence modes. The function of the ENC
bit is unchanged when using the MSC bit.
Получилась такая функция инициализации вызывает процесс измерения.
Данные изменяються и я их принимаю.
#define F_CPU 5836800ul
#define Period F_CPU % 100/* ADC12 Settings: */
P6SEL = 0xFF; // Port P6 used by ADC module
ADC12CTL0 &=~ ENC; // Disable conversion before changing
for(i=0; i<8; i++) ADC12MCTL[i] = i;
ADC12MCTL[7] |= EOS;ADC12CTL1=SHS_1 | SHP | CONSEQ_3 | ADC12SSEL_3;
ADC12CTL0=SHT0_8 | REF2_5V | REFON | ADC12ON | MSC;TACCR0 = Period-1;// Init TACCR0 w/ sample prd=CCR0+1
TACCTL1 = OUTMOD_4;
TACTL = TACLR + MC_1 + TASSEL_2;
ADC12IE = 0x0080;
То есть работает в режиме CONSEQ_3- A sequence of channels is converted repeatedly. И данные поступают намного чаще, чем 100раз в секунду, то есть преобразования следуют одно за одним.
В режиме CONSEQ_1 -sequence of channels is converted once
не работает :-(
Режим при котором таймер А формирует время Sample/Convert - работает.
Равномерность выборки обеспечена, но данные с каналов разнесены на период выборки.
В принципе этого незаметно, но хочется совершенства :-)