Sam D10/D20 ADC freerunning mode

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

Good evening!

 

When my ADC is in freerunning mode, and I change the channel, the first conversion produces a ridiculous value.

All conversions afterwards are correct. What I do on the following sequence, before I change the channel:

 

1. Disable ADC

2. Setting to single shot mode

3. Flushing the ADC

3. Changing the channel

4. Setting to freerunning mode

5. Enabling the ADC

 

But I get the problem above. What is wrong in my train of thoughts?

At present I use the much slower single shot mode, working perfectly.

But my postprocessing of datas (gain- and offset correction, averaging) costs a lot of time in this mode.

 

Best regards,

 

Uwe

 

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

In reading the SAMD51 datasheet (chip I am working with), it was not clear to me what was meant when it said that after a flush, if a transaction was pending, it would be resumed.  In light of your description it sort of sounds like it resumed the last single shot and then proceeded.

 

If you are not too time sensitive, SWRST the ADC, reconfigure it, and run.

I have not encountered this as I am using a single channel...

jeff

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

Thanks Jcandle for your answer!

 

The same sentence with resuming a transaction is also mentioned in the D10 manual.

But it is difficult to imagine, that new settings for a new channel can be ignored. I tried

out the sequence without flushing the adc with same results.I will use a software reset,

perhaps it will be the solution. Maybe, the only way will be INPUTOFFSET and INPUTSCAN,

which only makes sense, if the pins, which must be scanned, are neighbours. If not, time is

wasted for scanning signals, which needn't be scanned.

Kind regards,

 

Uwe

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

Some more details would help.

One way is using inputscan (if the pins are neighbours).

If the pins are not neighbours you should use a timer to generate a measurement event. After each conversion complete you can change the channel in the interrupt handler.

 

Flo1991

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

Also, depending on your timing needs, just disposing of the initial sample is an option.

 

I have not thought through the SAMD hardware, but is it just a settling time of the sampling capacitor?

Other architecture ADCs I have worked with have a minimum time to switch between two significantly different voltages or references.

jeff

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

Hello Jcandle!

 

No, it has nothing to do with the sampling capacitor, as I have increased the sampling time

drastically, and the results were absolutely the same. I have the feeling, the wrong conversion

result is between the last conversion and the new voltage.

 

Uwe

Last Edited: Mon. Apr 16, 2018 - 10:50 PM