Shop OBEX P1 Docs P2 Docs Learn Events
MCP3208 ADC Problem — Parallax Forums

MCP3208 ADC Problem

Tony CunninghamTony Cunningham Posts: 43
edited 2010-04-13 23:13 in Propeller 1
I seem to be having a problem with the MCP3208 giving me a consistent reading. I'm using the MCP3208_fast.spin object to read it.
I'm using the gyro-accel unit from gadget gangster: http://gadgetgangster.com/find-a-project/56.html?projectnum=213
Hopefully the images are good.

It seems very sensitive when I touch the pcb in some place, giving weird numbers.
On the screen shot, GY is giving the correct 1559 and any time I tilt one way or the other, it reads accordingly. The others are not responding to any tilt and are reading all the same numbers.
I read the MCP3208 pdf file, but I'm not hooking this up right or something.

I also uploaded my code, so if anybody can see something amiss there.

Everything is running on 3.3 volt.

On the ADC, I have:

pin 16 and 15 = +3.3 volt
pin 14 and 9 =ground
pin 13 = pin 6 on propeller
pin 12 and 11 =pin 5 on propeller
pin 10 =pin 4 on propeller

I have a 1uf cap on Vdd and ground.

The outputs from the IMU are going directly into the channels of the ADC.
If I'm missing something in my description let me know.

Thanks,

Tony

PS- I have to work during the day, so I can't respond immediately.

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-04-13 05:27
    I think you are going to have problems with this on the breadboard. Your analog ground is connected directly to the digital ground which then goes via a length of wire to the actual ground, asking for trouble. At the very least run a separate analog ground back. If you tie Vref to Vdd rather than using a clean and stable voltage reference then it should really be via an RC filter (100R->10uf+0.1uf).

    Have you read the appnote AN688?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • TubularTubular Posts: 4,740
    edited 2010-04-13 06:07
    I have a similar pin setup to yours and don't have any complaints. But your cap is 104 ie 100nF which is on the small side. I use a 104 ceramic in parallel with 106 (10uF) tantalum.

    This probably isn't your problem, but just in case:- the MCP3208 doesn't run as fast at 3v, as it does at 5v (50 kHz max at 3v). If you're overclocking the Prop is might pay to check the freq
  • Tony CunninghamTony Cunningham Posts: 43
    edited 2010-04-13 13:36
    Hi Peter,

    What is app688? Is that in the MCP3208 Doc. I'll run a separate analog and digital ground.

    Tubular, I'll add a 106 tantalum in parallel and change it to five volts and see what happens.

    Thanks guys!
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-04-13 15:06
    Microchip have an application note (appnote) for using this chip, the does and don'ts if you like. The document name is AN688 and here is the direct link
    ww1.microchip.com/downloads/en/AppNotes/00688b.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Tony CunninghamTony Cunningham Posts: 43
    edited 2010-04-13 22:49
    Thanks Peter, I didn't have this appnote.
    Well, since I have your attention, I do have a question. What is the Reference Voltage pin used for? That has really been bugging me.
  • Jim FouchJim Fouch Posts: 395
    edited 2010-04-13 23:10
    The Reference voltage need to be set to whatever you consider your highest voltage you want to read. It's limited 5V I think.

    For example if you're reading a voltage from 0-3.3V then you would ti it to 3.3V. But if your reading 0-5V, then tie it to 5V. If you don't have this connected to anything, then it's floating would would explain your problem with an unstable reading.

    If you want to raed voltages higher than 5V, then use a voltage divider to scale down your input and set your reference to 5V. For example if you want to read a 0-10V reading, then putting the input voltage through a voltage devider to cut your highest voltage of 10V down to 5V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jim Fouch

    FOUCH SOFTWARE
  • Tony CunninghamTony Cunningham Posts: 43
    edited 2010-04-13 23:13
    Thanks Jim, that makes since. Now I know why voltage references are always tied to the Vdd on most circuits.
Sign In or Register to comment.