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

Ltc1298

ArchiverArchiver Posts: 46,084
edited 2004-05-27 13:20 in General Discussion
Has anyone encountered this before? While reading a
value from channels 0 and 1 of the ADC I see 2047 when
input voltage is 2.505 and a reading of 0000 when the
input is 2.506 0001 @ 2.507 and so on up to 2047 again
for 5.01. What gives, I am hoping someone here is
smarter than me (with out a doubt) and can tell me why
this could happen. I have tried 3 chips, same result.

This message was sent through Atlantic.Net Webmail.
Get a free self-installation kit and free activation when you
order business DSL. Visit
http://www.atlantic.net/htm_business/dedicated_dslisdn.html to learn more.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-05-01 05:35
    At 10:44 PM 4/30/2002, you wrote:
    >Has anyone encountered this before? While reading a
    >value from channels 0 and 1 of the ADC I see 2047 when
    >input voltage is 2.505 and a reading of 0000 when the
    >input is 2.506 0001 @ 2.507 and so on up to 2047 again
    >for 5.01. What gives, I am hoping someone here is
    >smarter than me (with out a doubt) and can tell me why
    >this could happen. I have tried 3 chips, same result.

    I seem to remember something about this particular
    ADC having a single or differential mode of operation.
    It sounds as though you are in a differential mode.

    http://www.linear.com/pdf/128698fs.pdf
    Reading the datasheet on page 9...

    "The LTC1298 has a two-channel input multiplexer and can
    convert either channel with respect to ground or the difference
    between the two."

    Look at page 12 under the Multiplexer (MUX) Address on how
    to set the LTC1298 Channel Selection.

    Beau Schwabe Mask Designer IV - ATL
    National Semiconductor Enterprise Networking Business Unit
    500 Pinnacle Court, Suite 525 Wired Communications Division
    Mail Stop GA1 Norcross, GA 30071
  • ArchiverArchiver Posts: 46,084
    edited 2002-05-01 06:56
    At 10:44 PM 4/30/02 -0400, Ronald Hess wrote:
    >Has anyone encountered this before? While reading a
    >value from channels 0 and 1 of the ADC I see 2047 when
    >input voltage is 2.505 and a reading of 0000 when the
    >input is 2.506 0001 @ 2.507 and so on up to 2047 again
    >for 5.01. What gives, I am hoping someone here is
    >smarter than me (with out a doubt) and can tell me why
    >this could happen. I have tried 3 chips, same result.

    You have a problem with reading the data from the LT1298 - you are losing
    the MSB somewhere. The '1298 is a 12 bit a/c convertor which gives counts
    from 0 thru 4095. You are seeing counts from 0-2047 and then repeating,
    therefore bit 11 is not being read.

    Sounds like a fairly simple problem to fix now that you know the cause.

    dwayne


    Dwayne Reid <dwayner@p...>
    Trinity Electronics Systems Ltd Edmonton, AB, CANADA
    (780) 489-3199 voice (780) 487-6397 fax

    Celebrating 18 years of Engineering Innovation (1984 - 2002)
    .-. .-. .-. .-. .-. .-. .-. .-. .-. .-
    `-' `-' `-' `-' `-' `-' `-' `-' `-'
    Do NOT send unsolicited commercial email to this email address.
    This message neither grants consent to receive unsolicited
    commercial email nor is intended to solicit commercial email.
  • ArchiverArchiver Posts: 46,084
    edited 2002-05-01 13:03
    --- In basicstamps@y..., Beau Schwabe <bschwabe@a...> wrote:
    > At 10:44 PM 4/30/2002, you wrote:
    > >Has anyone encountered this before? While reading a
    > >value from channels 0 and 1 of the ADC I see 2047 when
    > >input voltage is 2.505 and a reading of 0000 when the
    > >input is 2.506 0001 @ 2.507 and so on up to 2047 again
    > >for 5.01. What gives, I am hoping someone here is
    > >smarter than me (with out a doubt) and can tell me why
    > >this could happen. I have tried 3 chips, same result.
    >
    > I seem to remember something about this particular
    > ADC having a single or differential mode of operation.
    > It sounds as though you are in a differential mode.
    >
    > http://www.linear.com/pdf/128698fs.pdf
    > Reading the datasheet on page 9...
    >
    > "The LTC1298 has a two-channel input multiplexer and can
    > convert either channel with respect to ground or the difference
    > between the two."
    >
    > Look at page 12 under the Multiplexer (MUX) Address on how
    > to set the LTC1298 Channel Selection.
    >
    >

    > Beau Schwabe Mask Designer IV - ATL
    > National Semiconductor Enterprise Networking Business
    Unit
    > 500 Pinnacle Court, Suite 525 Wired Communications Division
    > Mail Stop GA1 Norcross, GA 30071
    >
    --

    Looked at the Datasheet, not much new there. I think I am doing this
    stuff right, I may be wrong! Here is a snippet of the code used to
    read the 1298:

    config var nib
    WorkVar var word
    AD var word

    startB var config.bit0
    sglDif var config.bit1
    ChanSel var config.bit2
    msbf var config.bit3
    .
    .
    .

    ChanSel = 0
    GOSUB ReadADC
    WorkVar = AD
    .
    .
    .

    ChanSel = 1
    GOSUB ReadADC
    WorkVar = AD
    .
    .
    .

    ReadADC:
    config = config | %1011
    LOW ChipSel
    PAUSE 40
    SHIFTOUT DIO_n,CLK,lsbfirst,[noparse][[/noparse]config\4]
    SHIFTIN DIO_n,CLK,msbpost,[noparse][[/noparse]AD\12]
    HIGH ChipSel
    RETURN
  • ArchiverArchiver Posts: 46,084
    edited 2002-05-01 13:25
    its possible your in differential mode, but your read-back command might not
    be correct or your read variables might be byte instead of word, or a
    combination of all or some of the above problems.

    norm




    >From: "rhess_1" <rhess@a...>
    >Reply-To: basicstamps@yahoogroups.com
    >To: basicstamps@yahoogroups.com
    >Subject: [noparse][[/noparse]basicstamps] Re: LTC1298
    >Date: Wed, 01 May 2002 12:03:30 -0000
    >
    >--- In basicstamps@y..., Beau Schwabe <bschwabe@a...> wrote:
    > > At 10:44 PM 4/30/2002, you wrote:
    > > >Has anyone encountered this before? While reading a
    > > >value from channels 0 and 1 of the ADC I see 2047 when
    > > >input voltage is 2.505 and a reading of 0000 when the
    > > >input is 2.506 0001 @ 2.507 and so on up to 2047 again
    > > >for 5.01. What gives, I am hoping someone here is
    > > >smarter than me (with out a doubt) and can tell me why
    > > >this could happen. I have tried 3 chips, same result.
    > >
    > > I seem to remember something about this particular
    > > ADC having a single or differential mode of operation.
    > > It sounds as though you are in a differential mode.
    > >
    > > http://www.linear.com/pdf/128698fs.pdf
    > > Reading the datasheet on page 9...
    > >
    > > "The LTC1298 has a two-channel input multiplexer and can
    > > convert either channel with respect to ground or the difference
    > > between the two."
    > >
    > > Look at page 12 under the Multiplexer (MUX) Address on how
    > > to set the LTC1298 Channel Selection.
    > >
    > >
    >
    > > Beau Schwabe Mask Designer IV - ATL
    > > National Semiconductor Enterprise Networking Business
    >Unit
    > > 500 Pinnacle Court, Suite 525 Wired Communications Division
    > > Mail Stop GA1 Norcross, GA 30071
    > >
    >--
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and
    >Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >




    _________________________________________________________________
    Chat with friends online, try MSN Messenger: http://messenger.msn.com
  • ArchiverArchiver Posts: 46,084
    edited 2002-05-01 13:29
    At 12:03 PM 5/1/02 +0000, you wrote:
    >--- In basicstamps@y..., Beau Schwabe <bschwabe@a...> wrote:
    > > At 10:44 PM 4/30/2002, you wrote:
    > > >Has anyone encountered this before? While reading a
    > > >value from channels 0 and 1 of the ADC I see 2047 when
    > > >input voltage is 2.505 and a reading of 0000 when the
    > > >input is 2.506 0001 @ 2.507 and so on up to 2047 again
    > > >for 5.01. What gives, I am hoping someone here is
    > > >smarter than me (with out a doubt) and can tell me why
    > > >this could happen. I have tried 3 chips, same result.
    > >
    > > I seem to remember something about this particular
    > > ADC having a single or differential mode of operation.
    > > It sounds as though you are in a differential mode.
    > >
    > > http://www.linear.com/pdf/128698fs.pdf
    > > Reading the datasheet on page 9...
    > >
    > > "The LTC1298 has a two-channel input multiplexer and can
    > > convert either channel with respect to ground or the difference
    > > between the two."
    > >
    > > Look at page 12 under the Multiplexer (MUX) Address on how
    > > to set the LTC1298 Channel Selection.
    > >
    > >
    >
    > > Beau Schwabe Mask Designer IV - ATL
    > > National Semiconductor Enterprise Networking Business
    >Unit
    > > 500 Pinnacle Court, Suite 525 Wired Communications Division
    > > Mail Stop GA1 Norcross, GA 30071
    > >
    >--
    >
    >Looked at the Datasheet, not much new there. I think I am doing this
    >stuff right, I may be wrong! Here is a snippet of the code used to
    >read the 1298:
    >
    >config var nib
    >WorkVar var word
    >AD var word
    >
    >startB var config.bit0
    >sglDif var config.bit1
    >ChanSel var config.bit2
    >msbf var config.bit3
    > .
    > .
    > .
    >
    >ChanSel = 0
    >GOSUB ReadADC
    >WorkVar = AD
    > .
    > .
    > .
    >
    >ChanSel = 1
    >GOSUB ReadADC
    >WorkVar = AD
    > .
    > .
    > .
    >
    >ReadADC:
    > config = config | %1011
    > LOW ChipSel
    > PAUSE 40
    > SHIFTOUT DIO_n,CLK,lsbfirst,[noparse][[/noparse]config\4]
    > SHIFTIN DIO_n,CLK,msbpost,[noparse][[/noparse]AD\12]
    > HIGH ChipSel
    > RETURN

    Unless something is getting inverted in your code with MSB,LSB I
    don't know what to tell you, except it doesn't look like 'lsbfirst'
    or 'msbpost' are initializing in your code. Try setting your
    'config' to all 1's or try to decipher some of my code I have below
    for an LTC1288.

    Code Starts Here (MEL Basic StampI compatable)

    Symbol PortA = 5 'RA0 through RA4
    Symbol TrisA = $85 'PortA Direction Control
    Symbol ADC_CLK = 0 'Pin 7 on LTC1288
    Symbol ADC_DataPin = 1 'Pin 5 on LTC1288
    Symbol ADC_Mode = 1 '0 = diff. ;1 = Single-ended input
    Symbol ADC_Data_Out_Bit = pin1 'OUTPUT bit data to pin
    Symbol ADC_Data_In_Bit = pin1 'INPUT bit data from pin
    Symbol Temp = w0 'Temporary variable
    Symbol ADC_Channel = bit0 'W0;Temporary BIT flag
    Symbol ADC_Shift_In = b2 'W1.LOWBYTE
    Symbol ADC_Data_In_WORD = w2 'B4 and B5
    Symbol ADC_1 = w3 'B6 and B7
    Symbol ADC_2 = w4 'B8 and B9

    Initialize:
    Poke TrisA,%11110011:Poke PortA,%00001100

    MainLoop:

    'Read ADC
    Poke TrisA,%11110011
    ADC_Channel = 0:gosub Read_ADC:ADC_1 = ADC_Data_In_WORD
    ADC_Channel = 1:gosub Read_ADC:ADC_2 = ADC_Data_In_WORD

    'Debug ADC_1 and ADC_2 for results
    goto MainLoop


    Read_ADC: output ADC_DataPin:low ADC_CLK:high ADC_DataPin
    Poke PortA,%00001000[noparse]:p[/noparse]ulsout ADC_CLK,1
    ADC_Data_Out_Bit = ADC_Mode [noparse]:p[/noparse]ulsout ADC_CLK,1
    ADC_Data_Out_Bit = ADC_Channel[noparse]:p[/noparse]ulsout ADC_CLK,1
    ADC_Data_Out_Bit = 1 [noparse]:p[/noparse]ulsout ADC_CLK,1
    input ADC_DataPin:ADC_Data_In_WORD = 0
    'for ADC_Shift_In = 1 to 13
    for ADC_Shift_In = 1 to 11 '<<- Use 11 instead of 13 to
    ' "prescale" or effectively
    ' "divide" the result by a
    ' factor of 4

    ADC_Data_In_WORD = ADC_Data_In_WORD * 2 + ADC_Data_In_Bit
    pulsout ADC_CLK,1[noparse]:next:[/noparse]Poke PortA,%00001100:return


    Beau Schwabe Mask Designer IV - ATL
    National Semiconductor Enterprise Networking Business Unit
    500 Pinnacle Court, Suite 525 Wired Communications Division
    Mail Stop GA1 Norcross, GA 30071
  • ArchiverArchiver Posts: 46,084
    edited 2002-05-01 21:41
    there are several things not correct in the setup and run program area.

    what you need is stamp application #4 from nuts & volts.
    it deals completely with the ltc1298
    email me directly so i get your direct email address and ill send it out as
    an attachment to you, or you can goto the nuts & volts web site and download
    it from there.

    normdoty@h...



    _________________________________________________________________
    Send and receive Hotmail on your mobile device: http://mobile.msn.com
  • ArchiverArchiver Posts: 46,084
    edited 2004-05-27 01:41
    I am trying to use a LTC1298 to read a 0-5v signal. I have a
    potentiometer setup for testing and all the LTC1298 will read is
    from about 2 to 2.5 volts (o to 2047). I am only using one channel
    but I get a readings on both. And if I connect the ground to VSS I
    get nothing. Any ideas?

    Thanks!
  • ArchiverArchiver Posts: 46,084
    edited 2004-05-27 13:20
    Sounds like the LTC is set up for differential Voltages? Got some code?

    There is a most excellent ap note on the parallax site. Look under
    downloads, applications. That is what I used.

    Original Message
    From: martintreat [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=TAHH367qk1XB9wnsyNRsyDsvPCmsrVXhbl7kgfwIBF8BhYhbyAE3BpprkxMjL9nBlPJN5JQ_hB7fAayIZ5WYF5CKRO_P]martin@p...[/url
    Sent: Wednesday, May 26, 2004 8:41 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] LTC1298


    I am trying to use a LTC1298 to read a 0-5v signal. I have a
    potentiometer setup for testing and all the LTC1298 will read is
    from about 2 to 2.5 volts (o to 2047). I am only using one channel
    but I get a readings on both. And if I connect the ground to VSS I
    get nothing. Any ideas?

    Thanks!




    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.

    Yahoo! Groups Links
Sign In or Register to comment.