Thanks for the information.
I naturally have learned all this since my previous post, but there still seem to be a problem which I am unable to resolve.
It's either something I do wrong, (misunderstand the RM0008) or a LibMaple bug.
My understanding (as stated in the RM) is that SQR3 takes care of the first 6 conversions, SQR2 is for conversions 7-12, and SQR1 is for conversions 13-17.
The adc.c function 'adc_set_sample_sequenceuses' use SQR1 and SQR2, while the first register should be SQR3, which is for sequences 1-6.
Now here is the problem I have: (which may relate to the above mentioned)
Within my code, I set the dual simultaneous adc sequence as follows: (just a short example. I use more channels and lots more functions)
set_dual_mode(ADC1,DADC_MODE_6); //6=Dual simult. only
ADC2->regs->SQR3=11; //This should set the first channel to be converted in ADC1
ADC1->regs->SQR3=12; //This should set the first to be converted in ADC2.
adc_set_reg_seqlen(ADC1, 1); //or a larger number
adc_set_reg_seqlen(ADC2, 1);
Reading back the registers:
SerialUSB.print(ADC1->regs->SQR3,BIN); //=10 bin (always)
SerialUSB.print("\t");
SerialUSB.println(ADC2->regs->SQR3,BIN); //=1011 bin (or any other number I set)
etc.
Looks like ADC1 with SQR3 (only) is never updated, regardless of what I do (I have tried different values, changed the order, etc.)
As can be seen, when I read back the SQR3 ADC1 and ADC2 registers, ADC2 always reads the correct channel with any number(s) I set in the sequence positions, while ADC1 SQR3 always reads 10 (binary), regardless of what I set (one channel or more).
If I use SQR2 (sequences 6-12) for dual, it looks OK, I get both ADC1 and ADC2 correct.
As I noted, this problem is only with ADC1 with SQR3.
Again, I may be doing something wrong, but to me this looks more like a bug.
samtal
And, as a sidenote, It would be nice if the sequence setting function 'adc_set_sample_sequence' (adc.h and adc.c) would have been modified to become more user friendly.
I may do it once I resolve the current issue and become more knowledgeable...