XMEGA ADC, Scan and Free-running

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 The chip is ATxmega64A3U, it'll be another 2 weeks before I get my hands on the chip itself, but I already have a couple of burning questions about the ADC which I hope you guys can help me answer.

 

1.  I have 6 input pins in PORTA that I want to read using ADCA using a single Channel. I'd like to let the ADC free run and use SCAN function to automatically step through each input pin and do the conversion sequentially, the results will then be DMA'ed to a buffer. This is how I think the Free-run + Scan operation works (correct me if I'm wrong) : The mux selects the first input pin, do the conversion, then put the result in the result register, the process will then re-trigger itself and the mux selects the next input pin, do conversion, put result in register and so on.

 

My experience with the ATmega ADC was, when I switch one input pin to another with the ADC mux I have to wait for some tens of microsecond to let the new selected signal 'settle in' before starting the conversion, if I don't insert this wait-state the conversion result (of constant DC signals) will vary wildly with subsequent readings. Now my question is, does XMega ADC automatically insert some wait period after selecting a new input pin with the Free-Running mode? The data sheet and all other documentation discussing about xmega ADC have no mention on this, so I'm guessing there is no wait period. Anybody had any experience using such a setup with XMega ADC? Are the conversion results fairly stable with constant DC inputs?

 

2.  The second question is : can you select input pins on PORTB to be used with ADC-A? And vice versa, can you use the input pins on PORTA to be used with ADC-B? The datasheet states that you can specify in the MUXCTRL register to use PIN0 through PIN15 with , which I guess the pins that span PORTA and PORTB.

 

Regards,

Henry

Last Edited: Thu. Nov 22, 2018 - 04:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1. Sampling time is equal to 1 ADC clock, see Figure 28-18. ADC timing for free running mode.

Should be OK provided your ADC clock is low enough.

I never used SCAN feature, but I used to use SWEEP because I use 4 channels at most and it works fine at least with ADCclk <= 100kHz

 

2. Yes, you can use PORTB a positive input to ADCA. No, you can not use PORTA as an input to ADCB, see datasheet, tables 32-1, 32-2 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks mccrtray, that clears things up. I understood the tables wrongly when I first looked at it, I thought ADC0, ADC1, and so on corresponds to the physical pins.