Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ADC problem

Status
Not open for further replies.

zedman

New Member
I am trying to use ADC0831 A/D chip, I know this is simple, but i stuck with it. Datasheet says: Conversion Time is 32µs, so it can do ~30000 samples per second and I tought I can sample a 15kHz sine wave.
But it's not really works.

I created a basic config: Vref, V- is on GND, V+ tied to Vcc. So i have to get nearly 0xFF on the output.
But I only get 0x5A.

I've done a lot of timing change and I figured out that if I increase the clock high time than the amplitude increases too. To get full 255 bit resolution I have to do: clock UP / wait ~250 µs / clock DOWN. If i do i can get 0xFE. But it's far slower than I expected, and ds said.

What am i doing wrong?

I've seached in google, and found lot of examples using PIC / assembly, and they
are wait only a nop time @ 4MHz (iam running on 40 MHz so i waited at least 10 nops) between clock up/down.

I attached the timing diagram from the ds. (tset-up=250ns, tc=8 1/clock speed, max. clock speed is 400 kHz, so tc=~20-40µs)
It shows that if i running clock speed at 400.000Hz (clock high time: 2.5us) than the conversion time is 8 * (1/400.000)=20us.
But tc is from the falling edge of the first (dummy) clock pulse to the the falling edge of the 9th clock pulse. Maybe A/D conversion still running while I can shift out the incomplete result?

:? please lead me out from the trees...
 

Attachments

  • timing.gif
    timing.gif
    31.5 KB · Views: 430
I have not used the ADC0831 before so this is a shoot in the dark.

The datasheet places a limit of 60us max allowable HIGH time of the clock pulse and 1us as the min LOW time, so 250us in your case is way outisde its limit.

To trouble shoot your problem, I would setup the input using two equal value resistors to give me half the voltage. With a clock HIGH/LOW time of 50us I then confirm the chip works, and giving me correct reading of 0x7F or 0x80. I then increase the clock frequency higher to see if the problem comes back.
 

Attachments

  • time.png
    time.png
    14.3 KB · Views: 416
iam running on 40 MHz

What PIC are you using? It must be a PIC18 family device to get this high. You should be using the built-in ADC instead of the ADC0831!
 
Thanks,

I'll try it with the resistors you mentoined.
Can it be that I have impedance problem, I used a 100k potmeter?
Isn't it too large? PIC's ADC needs larger than 1k impedance to get it's
cap fully charged, ADC0831's ds mentions the same value.

I saw that the clock high time is max 60us, but with 60us I can't get the full amplitude.
 
Iam working with 18F452 @ 40MHz with PLL. (so at 10mips)
And switched to ADC0831 because (i tought :/ ) it's faster (32us -> ~30000 samples/sec, PIC can do only ~8000 samples/sec).
 
zedman said:
Thanks,

I'll try it with the resistors you mentoined.
Can it be that I have impedance problem, I used a 100k potmeter?
Isn't it too large? PIC's ADC needs larger than 1k impedance to get it's
cap fully charged, ADC0831's ds mentions the same value.

I saw that the clock high time is max 60us, but with 60us I can't get the full amplitude.

Make sure you use resistor values less than 2K in the test.

It sure looks like it is an impedance related problem. 100K is too large in any sense.
 
Status
Not open for further replies.

Latest threads

Back
Top