Other Parts Discussed in Thread: MSP430FR5972,
Tool/software: Code Composer Studio
CCS/MSP430FR5969: CCS/MSP430FR5972 + ADC
Unfortunately, it is difficult for me to switch from Atmel to MSP430FR5972 ...
I'm asking for help
I need to solve this problem:
1) The ADC should "repeat-sequence (repeated autoscan) conversion" A3->A12->A13->A14->A15->A3->A12..., bypassing the processor (no interrupts from ADC!!!).
2) Write values from each channel to separate memory locations (ADC12MEMxx). I need 12 bits ADC.
3) Internal Ref=1.2V, should be powered from an internal clock source, the processor clock speed = 8MHz, ADC clock above = ~30kHz(from dividers).
How to program the ADC to this mode of operation?
I'm write:
...
while(REFCTL0 & REFGENBUSY); // If ref generator busy, WAIT
REFCTL0 |= REFVSEL_0 | REFON; // REFVSEL = Reference voltage level select. Select internal ref = 1.2V
// REFON = Internal Reference ON
// Configure ADC12 === 200-ksps maximum conversion rate at maximum resolution of 12 bits
ADC12CTL0 = ADC12SHT0_2 | ADC12ON;
ADC12CTL0 &= ~ADC12ENC; // conversion stop for configuration ADC
ADC12CTL0 = ADC12MSC+ADC12SHT0_0+ADC12RES__12BIT; // Turn on ADC12
ADC12CTL1 = ADC12PDIV_0+ADC12DIV_0+ADC12SHP+ADC12SHS_0+ADC12CONSEQ_3; // repeated sequence
ADC12CTL3 = ADC12CSTARTADD_3; // Start from A3 to A15
ADC12MCTL3 = ADC12INCH_3+ADC12SHT0_0; // channel = A3
ADC12MCTL13 = ADC12INCH_13+ADC12SHT1_0; // channel = A13
ADC12MCTL14 = ADC12INCH_14+ADC12SHT1_0; // channel = A14
ADC12MCTL15 = ADC12INCH_15+ADC12SHT1_0+ADC12EOS; // channel = A15
ADC12CTL0 |= ADC12ENC; // Enable conversions
ADC12CTL0 |= ADC12SC; // Start convn - software trigger
while(!(REFCTL0 & REFGENRDY)); // Wait for reference generator to settle
ADC12IER0 &= ~ADC12IE0; // Disable ADC interrupt
ADC12CTL0 |= ADC12ENC | ADC12SC; // Sampling and conversion start
...
Is it correct ???
Additional qwestions:
4) ADC12CTL0 and ADC12CTL01 and ADC12CTL3 - Are used as setting (the same) for all ADC channels?
5) ADC12MCTLхх - Are used as individual settings for each separate ADC channel?