1 2 Previous Next 28 Replies Latest reply on May 7, 2015 3:35 PM by userc_41483

Hello,

I was wanting to set up an ADC to continue to read for about 48 MS. My ADC is running at 8Mhz, how many times would i need to read my adc? How long does it take for my adc to run?

A little bit too few information: What kind of ADC? DelsSig, ADCInc) How many bits? what are the exact settings? As far as I remember there was a formula to calculate the conversion time for an ADC in the datasheet. Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

Bob

Thanks, I added my project so everyone can see my settings better

A single conversion will take 160µs at 6.25ksps when clocking with 8MHz, so within 48ms you may get 300 ADC readings.

Bob

Thanks, That example helped me understand how to use the formula bettr.

You are always welcome!

Bob

If you only need one reading ever 48 mS consider setting a timer

for 48 mS and issuing an interrupt at the end of the period to take

a reading. That way you don't eat up a lot of MIPS doing nothing but

reading an A/D and ignoring its results for the 48 mS period.

In fact only start the A/D at the end of the 48 mS period and take a

Regards, Dana.

Does anyone know how I'd be able to figure out the conversion to get it as a voltage?

Your reference is set to Vdd/2 +/- Vdd/2.

Your converter is set to 8 bits, unsigned.

So Vx = ( AtoDcount value * 5V ) / 256

Regards, Dana.

I may be wrong, but I'm under the assumption that the ADC has an interrupt. I am running this ADC fro 48ms which I do about 6 times. Is it possible to run something that happens every 2ms to interrupt the ADC? Like if I were to poll the status of a button.

ADCINC_1INT.asm this file has a place where user code can be entered

to be part of the ADC interrupt handler.

You could do an ISR on the button and simply call the stop / restart on the

Regards, Dana.

I need to do similar things for a couple others as well but only in certain conditions. I was planning on having a couple timers I would Start and Stop with interupts. Would placing my timer's ISR jumps higher in the vector table, like in the following link, interrupt the adc since it has Higher priority?

http://www.cypress.com/?docID=47681

Thanks,

From the ap note -

Thanks!

Also I forgot to ask, what is the AtoDcount value in...

Vx = ( AtoDcount value * 5V ) / 256

PulseWidth?

What pulsewidth ? Are you trying to make a V to PW converter ?

Or trying to control LED brightness with V ?

Regards, Dana.

1 2 Previous Next