Shop OBEX P1 Docs P2 Docs Learn Events
The MAX186ACPP+ Is now done the problem is fixed (Re-Named) — Parallax Forums

The MAX186ACPP+ Is now done the problem is fixed (Re-Named)

sam_sam_samsam_sam_sam Posts: 2,286
edited 2010-01-11 23:44 in General Discussion
Thanks To Any One that has a Demo Code that they are will to share this is for a BS2 only

Or is there ADC chip that Parallax sells that would be the same that there is a Demo code for it

Here is the Data Sheet····· http://datasheets.maxim-ic.com/en/ds/MAX186-MAX188.pdf

I used the MCP3202 Demo.bs2·for most of the code

Thank Mike Green for your help

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

·
·
·
·
Sam

Post Edited (sam_sam_sam) : 1/11/2010 11:44:01 PM GMT

Comments

  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-10-29 23:28
    I Just got some free sample Is there any one that can help get started with this chip

    To learn how to use them

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-30 02:32
    Compare the MAX186-MAX188 to either the MCP3208 or the ADC0838. There's demo code for the ADC083x series for the BS2. Look at the StampWorks Manual and the Basic Analog and Digital tutorial for examples. Compare the datasheets. They're all SPI devices, so you'd use SHIFTIN / SHIFTOUT with them. There seem to be some small differences in the control information passed to the ADC, but it's all in the datasheets.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-10-30 23:28
    Mike Green

    Thanks for the Info I will give this a try

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-01-03 23:29
    Here is an upDate to this Demo Code for the MAX186 ADC Chip

    The Voltage Range on this chip 0 to 4.0 volts

    ALL of·The Inputs need to have at least a 10k ohm resister tie to·( AGND· pin 13 ·) for it to work right

    If you do not want the voltage reading to jump around then put a .1uf on the input pins·to ( AGND· pin 13 ·)

    The line of code that say

    Cnts2Mv········ CON···· $0139···················· ' x 1.22 (To Millivolts)·· This for the MCP3208

    need to be change to

    Cnts2Mv········ CON···· $00FE···················· ' x·245 (To get ·Millivolts)··This for the MAX186

    ············ ·' ADC Definitions

    ············· ' x's··· Denote channel# [noparse][[/noparse]%1XXX1101]
    ············· ' channel_0······ CON···· %10001101
    ············· ' channel_1······ CON···· %11001101
    ············· ' channel_2······ CON···· %10011101
    ············· ' channel_3······ CON···· %11011101
    ············· ' channel_4······ CON···· %10101101
    ············· ' channel_5······ CON···· %11101101
    ············· ' channel_6······ CON···· %10111101
    ············· ' channel_7······ CON···· %11111101

    ············ ·'·This ·Select CH0, Single-Ended [noparse][[/noparse]%1---1X01]


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 1/12/2010 11:25:49 PM GMT
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-01-11 00:03
    Is there any One ·that can help with a math problem

    Here is the Problem the Volt·Meter reads 1.225 The Max186 reads 1.335 with the Basic Stamp

    How do I adj the reading that the MAX is giving the Basic Stamp Code wise

    I·have·ADJ this value·to··· Cnts2Mv·· CON···· $00F6·· ' x··245··· Which fix the problem·

    The problem was me the way that I was doing the HEX·#··as a decimal # not as a HEX #




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 1/11/2010 11:41:00 PM GMT
  • kwinnkwinn Posts: 8,697
    edited 2010-01-11 03:03
    Sam, there are 2 things you may need to correct for.

    One is an offset, which means the reading is always off by a specific amount. That is it always reads high by the same amount ( 0.11V if that is the problem in this case). The fix for that is to subtract the offset from the reading.

    Another is a gain or reference difference, which produces a reading that is always off by a certain percantage. That is if it is off by 0.01V at 1V it will be off by 0.02V at 2V. If that is the case you need to multiply the reading by a correction factor ( 1.225 / 1.335 or 0.9176 if that is the problem in this case).

    It is possible to have to correct for both an offset and a gain or reference difference. To do the calibration correctly you should take readings at the low end ( 0V ), mid range, and upper end.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2010-01-11 23:44
    Here·are the Demo that read the same as the Volt Meter

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them smile.gif

    ·
    ·
    ·
    ·
    Sam
Sign In or Register to comment.