LTC2400 SPI interface


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The ****IN command in PBP will handle the timing for you when the correct MODE is selected.

    The best I can do at the moment because I have not used the ADC you have is to have you look at the sample I linked you to and compare that to the data sheet of your ADC.

    But I have to ask... Why use the external when the 690 has an ADC built in?
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    May 2010
    Location
    SINGAPORE
    Posts
    14


    Did you find this post helpful? Yes | No

    Thumbs up thanks for your reply

    Quote Originally Posted by mackrackit View Post
    The ****IN command in PBP will handle the timing for you when the correct MODE is selected.

    The best I can do at the moment because I have not used the ADC you have is to have you look at the sample I linked you to and compare that to the data sheet of your ADC.

    But I have to ask... Why use the external when the 690 has an ADC built in?
    i have already tried the internal adc but for now my project is to read (4-20mA)0-5v from a pressure transduser(0-100bar) and then conver it into pressure units .so i need more accuracy and i want to use 24 bit adc.thanks for your support.
    IF YOU BORN POOR ITS NOT BECAUSE OF YOU BUT IF YOU DIE POOR ITS BECAUSE OF YOU.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I'm sure you have your reason but can you explain why you need 24bits?

    I mean, 100bar across 24bits gives you a resolution of 0.000006bar. Does a transducer capable of measuring 100bar really resolve to that kind of precision?

    If you already have your 4-20mA converted to 0-5V (and not 1-5V) you'd get ~0.1bar resolution with the built in 10bit ADC. You could do some oversampling to "emulate" a 12bit ADC giving you ~0.025bar resolution.

    Just some ideas.

    /Henrik.

  4. #4
    Join Date
    May 2010
    Location
    SINGAPORE
    Posts
    14


    Did you find this post helpful? Yes | No

    Thumbs up Thanks for your suggestions

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    I'm sure you have your reason but can you explain why you need 24bits?

    I mean, 100bar across 24bits gives you a resolution of 0.000006bar. Does a transducer capable of measuring 100bar really resolve to that kind of precision?

    If you already have your 4-20mA converted to 0-5V (and not 1-5V) you'd get ~0.1bar resolution with the built in 10bit ADC. You could do some oversampling to "emulate" a 12bit ADC giving you ~0.025bar resolution.

    Just some ideas.

    /Henrik.
    THANKS FOR YOUR SUGGESTION MR.HENRIK

    Actually as you said the 10 bit adc gives a 0.1 resolution on 0~100bar range which is as equal to a "primary master" and thats fine,but i want to use the 24bit adc because i want learn how to communicate a external adc through "spi" to the pic and particularly the 24bit adc is because thats the one i have in my hand to give a try.can you please explain me about the "oversampling to "emulate" a 12bit ADC to give a ~0.025bar resolution"
    THANKS A LOT FOR SPENDING YOUR VALUABLE TIME FOR ME.
    IF YOU BORN POOR ITS NOT BECAUSE OF YOU BUT IF YOU DIE POOR ITS BECAUSE OF YOU.

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I'd say learning qualifies as a (very) valid reason ;-) By all means try using the 24bit ADC but perhaps you should start with interfacing to something "easier" like a EEPROM to begin with so you learn the basics about how the SPI interface works. I haven't looked at the datasheet for your ADC though, perhaps it's pretty straight forward.

    As for the oversampling, all you really do is take a bunch of readings and then average them. If you take 16 readings with your 10bits ADC, add them all together and divide the result by 4 you'll get a value ranging from 0-4096.

    You can read a bit more about here. Note, you can not use that code with Oshonsoft, the theory behind it obviously applies to any language/compiler though.

    Good luck!
    /Henrik.

  6. #6
    Join Date
    May 2010
    Location
    SINGAPORE
    Posts
    14


    Did you find this post helpful? Yes | No

    Thumbs up thanks for your reply

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    I'd say learning qualifies as a (very) valid reason ;-) By all means try using the 24bit ADC but perhaps you should start with interfacing to something "easier" like a EEPROM to begin with so you learn the basics about how the SPI interface works. I haven't looked at the datasheet for your ADC though, perhaps it's pretty straight forward.

    As for the oversampling, all you really do is take a bunch of readings and then average them. If you take 16 readings with your 10bits ADC, add them all together and divide the result by 4 you'll get a value ranging from 0-4096.

    You can read a bit more about here. Note, you can not use that code with Oshonsoft, the theory behind it obviously applies to any language/compiler though.

    Good luck!
    /Henrik.
    hai Henrik,

    Thanks for your suggestions.is that the communication between the eeprom and pic is very easy?what i thought is am trying to make use of the spi communication only and
    no matter whether it is ADC or EEPROM (am i right).

    when i used the internal adc for example
    i injected 1.234v where the range is 0~5v and the related 10bit adc value is 252.7232 but the pic reads only 252 i took a bunch of readings and calculated the mean value (asume the value is same 252)
    then i multiplied the value by 10000 then the value is 2520000 again divide it with 2048 and the answer is 1230.46 where the pic read only 1230
    that means we get 1.230
    as you said (252*16)/4=1008 /819.2=1.230

    what is the difference between these two.

    thanks a lot for clarifying my doubts

    PUGAL
    IF YOU BORN POOR ITS NOT BECAUSE OF YOU BUT IF YOU DIE POOR ITS BECAUSE OF YOU.

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default

    Hi,
    It's because the reading you get from the ADC most likely won't be stable at 252 across several consecutive samples, it will probably "tip over" towards 253 a couple of times.
    Let's say you get the following values:
    252, 253, 252, 253, 253, 252, 252, 253, 251, 253, 252, 253, 253, 252, 252, 252

    The sum is 4039. Averaging them across 16 samples results in 252.4375 but you'll only "see" 252 which is ~0.29% off. Averaging them across 4 instead gives you 1009.75, you'll only "see" 1009 which is ~0.19% off.

    Had the result been 1040 instead, averaging them across 16 samples would give you the same result, ~0.29% off while the oversampling method would only be 0.009% off.

    Try it out and make sure you read thru the page I linked to, also look up the term oversampling. Here's a quote from Wikipedia:
    In practice, oversampling is implemented in order to achieve cheaper higher-resolution A/D and D/A conversion. For instance, to implement a 24-bit converter, it is sufficient to use a 20-bit converter that can run at 256 times the target sampling rate. Averaging a group of 256 consecutive 20-bit samples adds 4 bits to the resolution of the average, producing a single sample with 24-bit resolution.
    /Henrik.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts