Shop OBEX P1 Docs P2 Docs Learn Events
A/D converter question — Parallax Forums

A/D converter question

bennettdanbennettdan Posts: 614
edited 2007-06-06 15:25 in General Discussion
Hello,
··· I have come across a few of these A/D chips they are Texas Instruments ADS7841 they have a 4 wire serial interface and 12bit convertions with 4 channels. http://focus.ti.com/lit/ds/symlink/ads7841.pdf
What I want to know is can I use the example circuit for the LTC1298 that uses a resistor and only three pins to connect it to an SX or BS2 chip or can I modify the code example to just use the 4 pins? http://www.parallax.com/dl/docs/prod/appkit/ltc1298.pdf
·

Comments

  • Tracy AllenTracy Allen Posts: 6,656
    edited 2007-06-06 00:31
    The LTC1298 circuit and code will not be a good way into working with the ADS7841. In approaching a new chip you sometimes have to read between the lines on the data sheet. But it looks like you will need to use 4 Stamp pins for CS\, CLK, SDI and SDO. The converter is capable of receiving a new command byte on its input at the same time as it sends out data from the previous command, so the three wire approach does not work. That is a feature of the chip.

    The program code would look something like this (no guarantee!)

    LOW cs   ' chip select
       SHIFTOUT adinpin, adclk, MSBFIRST, [noparse][[/noparse]$94]  ' convert on channel 0, single ended, 12 bits
       SHIFTIN adoutpin, adclk, MSBPRE, [noparse][[/noparse]result\13] ' need 13 bits, first will be low.
    HIGH cs
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 6/6/2007 12:50:09 AM GMT
  • bennettdanbennettdan Posts: 614
    edited 2007-06-06 01:32
    Tracy,
    Thanks for the reply, I am rather new to the muti-channel A/D converters where did you come up with the [noparse][[/noparse]$94] this is the config bits correct? How did you determain that? thanks
  • bennettdanbennettdan Posts: 614
    edited 2007-06-06 02:04
    Tracy,
    I just read the datasheet a few times and I think I understand what you are doing.
    The [noparse][[/noparse]$94] is hex for 10010100 which means the MSB =1, A2=0, A1=0, A0=1, Mode=1 (12 Bits), SGL/Dif=1, PD1=0, PD2=0 (power down between convertions)
    Am I correct on this?
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2007-06-06 07:37
    That's right. The values of A2 to A0 select the input channel in kind of a funny way, not just 1,2,3,4. But it does not seem too complicated. A little experimental verification should straighten it all out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • bennettdanbennettdan Posts: 614
    edited 2007-06-06 15:25
    These chips seem to fit what I want to do and their only 5 dollars each which is great.
    Thanks for the help.

    Post Edited (bennettdan) : 6/6/2007 3:31:58 PM GMT
Sign In or Register to comment.