I am trying to understand how the ADC works when you select multiplex. It is the ATDCTL5 CD, CC, CB, CA settings that confuse me. The datasheet does not help.
This is the table for selecting the channels (I think)
If I want to the ADC conversion on channels AN2,AN3 and AN8. How do I select them. Looks like you can only select one analog channel.
Ray.
ATD module is simply.
You could configure sequence to measure:
If FIFO=0, results will be stored into ATDDR0 ... ATDDRn.
Examples:
MULT=1
sequence lenght [S8C..S1C]=7
start from AN2 [CD..CA]=2
When sequence ended, you can read AN2 result in ATDDR0, AN3 result in ATDDR1 and AN8 result in ATDDR6. This sequence could run in Continuous Conversion Sequence Mode (SCAN=1).
MULT=1
sequence lenght [S8C..S1C]=5
start from AN8 [CD..CA]=8
wrap around AN8 [WRAP3..WRAP0]=8
When sequence ended, you can read AN8 result in ATDDR0, AN2 result in ATDDR3 and AN3 result in ATDDR4. This will offer shorter conversion time of sequence (measured just 5 channels). This sequence could run in Continuous Conversion Sequence Mode (SCAN=1).
MULT=x,
[S8C..S1C]=1
ASCIE=1
SCAN=0
In interrupt routine (end of conversion) we start new conversion (write into ATDCTL5) with new channel AN2-AN3-AN8-AN2-AN3-… [CD..CA]=x
When sequence ended (in interrupt routine), you can read every result in ATDDR0 register.