Delay after ADC conversion complete.

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

I have seen some posts where it shows a delay after the CH0IF flag is set (signalling conversion complete) and before reading CH0RES.

I can't seem to find anything about this is the datasheet but I could also have missed it.

At the moment I have 1ms which is huge, maybe it only needs a few nops?? Any pointer in any of the datasheet please?

If it matters the ADC is running at 125KHz.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Setting CH0IF flag by cpu is AFTER updating CH0RES. So there is no need for such a delay before reading the result.

Ozhan KD
Knowledge is POWER

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

That's what I thought but I have seen post(s) (I'll need to find it/them now) with a delay before reading CH0RES.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Quote:

(I'll need to find it/them now)

https://www.avrfreaks.net/index.p...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Yep that was one I also found last night. It was one of several ADC code snippets I had tucked away and must have been the one I tried first and "worked".

So it looks like the only delays I need to be concerend with are the ones mentioned by Ozhan in one of my other ADC thread. https://www.avrfreaks.net/index.p...

Just doing bits and pieces until the board arrives late February, then the stress begins.....or it may just work very well. :roll:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Thanks to the posts in this notice.
That solved my AD problem yesterday.

Reading the ADCA.CH1RES immediately after ADCA_INTFLAGS is set gives from time to time the old value.
A small us delay before reading the result solved the problem.

This my be a fault in the device or missing information in the manual.