Shop OBEX P1 Docs P2 Docs Learn Events
ltc1298 — Parallax Forums

ltc1298

globalglobal Posts: 6
edited 2006-10-18 22:05 in BASIC Stamp
Can anyone help me?? I'm new at this and I'm having some trouble testing out the ltc1298 ADC with the BS2.· I used the code provided by parallax and have no idea what its doing.·Im using a single 1 volt input and I'm trying to see what comes out.· I cant understand the program. please help

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-18 00:09
    1) Are you referring to the sample code in this application note: <http://www.parallax.com/dl/docs/prod/appkit/ltc1298.pdf>?

    2) What parts do you understand and what don't you understand? Try to refer to specific portions of the examples.

    3) If you're referring to some other example, please let us know which one it is.
  • globalglobal Posts: 6
    edited 2006-10-18 21:39
    Yes, that is the example I was using.· First of all, I dont have two inputs, I'm using a single input.· I using that code, with it modified to
    ·FOR oddSign = 0 TO 0·· ' Toggle between input channels.
    ··· GOSUB convert·· ' Get data from ADC.
    ··· DEBUG "channel ",DEC oddSign, ": ",DEC AD,CR·· ' Display data.
    ··· PAUSE 500····· ' Wait a half second.
    · NEXT········ ' Change channels.
    GOTO again····· ' Endless loop.

    Modifying the For oddSign = 0 to 0, reads my·one input.· I tested it with a 5 volt dc source and my display was 4095 which is correct.· So I know I"m using code i dont need to use for one input source but I got it working.· Now my problem is actually hooking it up to the rest of my project.· Briefly the project consists of a mic, preamp then a/d to BS2.· I'm just trying to create a noise/audio detector that will display the spl level on a computer.· I have a gain of 30 on my preamp so that I dont pass the 5 volt max for the a/d.· Now, my signal generates a +/- sinusoidal signal.· Since I only need to measure the max amplitude to calculate my dB level, will the a/d just read my negative parts of the signal as a zero? or do I have to maybe create halfwave rectifier so that I only input the positive side of the signal?· Also, I tried to connect my input of the a/d to the ouput of my pream without even connecting any input to the preamp, just powering everything up and it was reading 4095.· I didnt have an input yet and it was reading 5 volts.· Any ideas?

    Thank you!
    Emily
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-18 22:05
    The simplest and most reliable solution would be to use a halfwave rectifier and filter to smooth the waveform, then measuring that voltage. Look at Tracy Allen's website <www.emesys.com> for lots of information on using Stamps with sensors and ADCs. If you're reading 4095 in the absence of an input, something must be wrong. Check your circuit carefully. You need to be able to read the correct voltage first. Try a simple voltage divider to get 1/2 of the 5V and see if you can read that properly with the LTC1298. Do you have the mode set for single ended operation as discussed in the App Note? What Stamp are you using?
Sign In or Register to comment.