Analog to Digital Multiplex

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Analog to Digital Multiplex

542 Views
rayhall
Contributor V

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)

5326_5326.pngMultiplexTable.png

 

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.

Labels (1)
Tags (6)
0 Kudos
Reply
1 Reply

386 Views
RadekS
NXP Employee
NXP Employee

ATD module is simply.

You could configure sequence to measure:

  1. One result at one channel (MULT=x, [S8C..S1C]=1)
  2. Multiple results at one channel (MULT=0, [S8C..S1C]>1)
  3. One result at multiple channels (MULT=1, [S8C..S1C]>1)

If FIFO=0, results will be stored into ATDDR0 ... ATDDRn.

Examples:

  1. If you want measure AN2,AN3 and AN8 in one sequence, you can set:

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).

  1. If you want measure AN2,AN3 and AN8 in one sequence, you can use also wrap around feature:

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).

  1. Next option is measure every channel separately and drives sequence by user software:

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.