Shop OBEX P1 Docs P2 Docs Learn Events
Using the LTC1298 to measure voltage — Parallax Forums

Using the LTC1298 to measure voltage

SenochSenoch Posts: 6
edited 2009-04-03 05:52 in BASIC Stamp
I'm using a Basic Stamp 2 with a LTC 1298 A-to-D converter that I ordered from the Parallax site.
I unpacked it and·hooked it up as shown.··I used the sample code they provided me to try and just·to see·what the data looks like, but it isn't working.
I used a voltage source of 1.25 volts and·applied that to the input pin but nothing.

Is there a specific way that the input voltage needs to be delivered?
How do I know if the converter is working? ·How do·I know if it's damaged?

I'd appreciate any help, thanks.

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2009-03-24 21:29
    The LTC1298 with the sample code works pretty well.

    The input voltage can be a maximum of 4.096 volts if memory serves me, and it can withstand 5 volts if necessary.

    Are you sure you've got the circuit connected according to the sample docs? Negative for the a/d should be the negative for the stamp.

    If you're using different pins on your Stamp, the program will have to be adjusted.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • JDJD Posts: 570
    edited 2009-03-24 22:38
    Senoch,

    Did you set the ADC to use 1 or 2 channels? Have you verified which channle you are using? Do you get any values ( 0 to 4095 ) on the DEBUG or what do you see when you run the sample in the AppNote? Which Schematic did you use to connect the ADC to the BASIC Stamp?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • SenochSenoch Posts: 6
    edited 2009-03-26 19:30
    I'm almost positive that I've got things connected as shown in the diagram.
    A2Dcopy.jpg
    (This diagram)
    The only discrepancy is that I don't know whether my capacitor is Tantalum or not. It's the right capacitance though...

    I've attached the code I used, but it literally is the example code provided. Copy and paste
    I tried both channels, the code alternates between the two of them, both kept returning zero.
    I numbered the pins the same as shown in code and on diagram. The circuit I've built is the only thing on the board, I use a separate signal generator.
  • stamptrolstamptrol Posts: 1,731
    edited 2009-03-26 19:42
    Thats the same set up that I've used many times.

    Just for clarity, you're putting a steady DC voltage between pin 2 and ground (or pin 3 and ground), right?

    What do you need the signal generator for?

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • SenochSenoch Posts: 6
    edited 2009-03-26 20:00
    Sorry, I used the term 'signal generator' incorrectly.
    I'm using a simple voltage source to serve as my test input. (6205B Dual DC Power Supply by Hewlett Packard, if that matters.)
    It's at a constant 1.25 volts. To make sure it wasn't that particular voltage level I've tried 2 and 3 volts in separate instances.
  • Craig EidCraig Eid Posts: 106
    edited 2009-03-26 21:29
    Senoch,

    Have you confirmed that your wiring is correct?·Place a·probe on the·chip select (CS) line to ensure that it is being taken to a logic LOW.·If it is not taken low the ADC will not respond.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-03-27 03:09
    Craig beat me to it. I would just ground the chip select and leave it selected all the time, unless thee's a good reason to do otherwise.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • SenochSenoch Posts: 6
    edited 2009-03-30 19:45
    Craig and Carl,

    Thank you for your suggestions, I tried them both, however I'm still unable to get any measurements.
    When I took voltage measurements from the various pins manually I found that the CS is sometimes HIGH and sometimes LOW.· There is a voltage on the reference pin and·on the input pin.· There isn't anything coming or going from my clock pin or my data pins.· What does this mean?
    I'm new to circuitry and working with chips, is there some way to tell if the chip itself hasn't been fried somehow?

    Thanks in advance.
  • Craig EidCraig Eid Posts: 106
    edited 2009-03-30 23:19
    It sounds like you will need to do some additional troubleshooting. If the code is running properly on the Stamp you should see the CS pin changing state and you should also be seeing a clock signal. The good news is that your inability to write to the LTC1298 is consistent with your inability to send a clock signal.
    ·
    What tool are using to measure the signal levels? The best choice is an oscilloscope that will allow you to view the signals in real time - using a DVM limits the sample rate to a typical value of 10 samples/second and will impair your ability to take measurements. If you do not have an oscilloscope, connect an LED and a current limiting resistor to the clock pin at the STAMP and connect another LED and a current limiting resistor to the Din pin at the STAMP.
    ·
    Please run·the following tests and observations and report your findings.
    1. Measure the voltage level at the VRef pin - it should be 5 volts and stable - and determine where it's physically connected.
    2.· Measure the voltage level at the clock pin or observe with the LED. Note the voltage and determine if it changes.
    3 Measure the voltage level at the Din pin or observe with the LED. Note the voltage and determine if it changes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com

    Post Edited (Craig Eid) : 3/31/2009 12:08:54 AM GMT
  • denodeno Posts: 242
    edited 2009-03-31 11:04
    I have been using the LTC1298 for several years with great success.· Try this:

    Select channel 1, then apply your voltage to measure between channel 1 input and GROUND.

    OR

    Select channel 2, then apply your voltage to measure between channel 2 input and ground.

    In my application, I am measuring upwards of 15 volts with the LTC1298.· I do this by using a voltage divider resistive string of three 5K 1% resistors.· I take the voltage reading between the "bottom" resistor and ground and multiply by three to give me my battery voltage.· (12 volt system)

    Hope this helps....DenO

    Make sure your chip select is LOW
  • SenochSenoch Posts: 6
    edited 2009-04-02 19:27
    Craig Ed,

    I did as you suggested.· I tried reading a voltage straight out of the pin slot of the stamp even.
    Vref is definitely 5volts and is for sure connected.
    The Din seemed to fluctuate between 0 and 0.005
    The clock pin also fluctuated, but between 0 and 0.009

    DenO,
    I've tried both channels against ground, neither one returns a signal. I also made it so that the chip select is low at the start and stays that way throughout.

    I tried moving the wires to different stamp pins and changed the code to match, just to make sure it wasn't the stamp pins that were in error.· But had the same results as before.
    (This makes me suspect the code.)· If it isn't too much of an imposition, may I borrow someones working code for testing purposes?

    Post Edited (Senoch) : 4/2/2009 7:35:48 PM GMT
  • SenochSenoch Posts: 6
    edited 2009-04-02 20:20
    I hooked an oscilloscope to the clock pin and then to the data pin.

    The were regular/semi-regular pulses from both.· The clock pin had what looked like two overlapping spikes at about 5 mV.· The Data pin had a larger spike, one that looked like it was 10mV coupled to a 15mV spike.

    Upon contacting Parallax again I was directed to a book, Basic Analog to Digital v1.4, but wasn't sure which part he was trying to refer me to.· I will read through it in the meantime.

    Thank you for your help and if anyone has more ideas I'd love to hear them.
  • JDJD Posts: 570
    edited 2009-04-03 05:52
    Senoch,

    I noticed that the wiring might be correct; but what about the program that you are using. The code you posted is using different I/O pins than the wiring diagram.

    Try this code with your existing wiring, and you should get the results you are expecting. I confirmed·it was working with 4 series 10 KΩ resistors from Vin to GND, and the ADC was able to read the changes as it cycled.

    Let me know if this program works with your setup,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
Sign In or Register to comment.