LTC2400 SPI interface


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    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.

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


    Did you find this post helpful? Yes | No

    Talking Thankyou very much for your support

    Quote Originally Posted by HenrikOlsson View Post
    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:

    /Henrik.
    HAI HENRIK,
    thanks for your support.as you said i tried the oversampling method and it gave me a better result than the previous method i used.but i have a transduser which range from 0~60000 psi on 4~20 mA,i used a 250 ohm resistor and i got 1~5v difference.

    in this case do i need to use a external ADC more than 14bit resolution or can able to use the oversampling method on internal ADC by sampling 4096 times and divide by 64 to get a 16bit resolution.is it possible? or do we have any other ways to achive it.
    THANKS FOR YOUR KIND SUPPORT,
    PUGAL.
    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

    Hello,
    You still haven't said what kind of resolution you actually NEED, just that you wanted to use 24bits becaue that is what you had. I also asked you earlier if you had the 4-20mA signal converted to 0-5 or 1-5V. With 1-5V it means that you are basically "wasting" 20% of the ADC range.

    Now, with a 1-5V signal I'd configure the ADC to use the external Vref inputs instead of the VDD and VSS. That way, if you feed a stable 1V signal into Vref- and a stable 5V into Vref+ you'll use all the available resolution and you'll get 0 for 1V and 1023 for 5V. That way you get a basic resolution of 0.1bar as I outlined earlier and can increase that by oversampling.

    If you try the aproach of 1024 samples remember that you need to add them into a 32bit variable as the result may not fit in a 16bit variable.

    /Henrik.

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


    Did you find this post helpful? Yes | No

    Thumbs up hai brother

    Quote Originally Posted by HenrikOlsson View Post
    Hello,
    You still haven't said what kind of resolution you actually NEED, just that you wanted to use 24bits becaue that is what you had. I also asked you earlier if you had the 4-20mA signal converted to 0-5 or 1-5V. With 1-5V it means that you are basically "wasting" 20% of the ADC range.

    Now, with a 1-5V signal I'd configure the ADC to use the external Vref inputs instead of the VDD and VSS. That way, if you feed a stable 1V signal into Vref- and a stable 5V into Vref+ you'll use all the available resolution and you'll get 0 for 1V and 1023 for 5V. That way you get a basic resolution of 0.1bar as I outlined earlier and can increase that by oversampling.

    "If you try the aproach of 1024 samples remember that you need to add them into a 32bit variable as the result may not fit in a 16bit variable".

    /Henrik.
    hai HENRIK,

    THANKS FOR YOUR SUPPORT and sorry for delayed reply.am using "long variable" so the 32bit variable fits in it.how to feed 1v? is that any voltage regulator available for 1v.what about the -ve side.

    as you said i used the internal adc and the oversampling method and got stable reading,but for now when i seperately send the readings to the lcd and hyperterminal it works but when i used both it doesn't work .i dont know what is the problem can you help me please.

    THANKS AND REGARDS,
    PUGAL
    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

    how to feed 1v? is that any voltage regulator available for 1v.what about the -ve side.
    Well, anyway you like really. The simplest way is a voltage divider but then the stability and accuracy of you reading depends on the stability of the powersupply rail, which it does when you're using the Vdd/Vss for Vref anyway.

    The voltage supplied to Vref- is what will equal a returned value of 0 from the ADC, the voltage supplied to VRef+ is what will equal a returned value of 1023 from the ADC. So by feeding 1V to Vref- and 5V to Vref+ the ADC's 10 bits gets divided across 1-5V instead of 0-5V as is the case when you use Vss/Vdd as reference. (As long as you use 5V supply of course). Read up on the ADC section of the datasheet for details about the ADC.

    I can't help with your problem as I have absolutely no idea how you've coded it.

    /Henrik.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HenrikOlsson View Post
    Well, anyway you like really. The simplest way is a voltage divider but then the stability and accuracy of you reading depends on the stability of the powersupply rail, which it does when you're using the Vdd/Vss for Vref anyway.

    The voltage supplied to Vref- is what will equal a returned value of 0 from the ADC, the voltage supplied to VRef+ is what will equal a returned value of 1023 from the ADC. So by feeding 1V to Vref- and 5V to Vref+ the ADC's 10 bits gets divided across 1-5V instead of 0-5V as is the case when you use Vss/Vdd as reference. (As long as you use 5V supply of course). Read up on the ADC section of the datasheet for details about the ADC.

    I can't help with your problem as I have absolutely no idea how you've coded it.

    /Henrik.

    As you said i looked at the pins and i cant find any -vref.

    "The positive voltage reference can be either VDD or an external voltage source. The negative voltage reference is always connected to the ground reference" this is what i found on the datasheet.

    THANKS and REGARDS,
    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,
    If that what it says then that's how it is. I didn't check the datasheet and I've never personally used a PIC where only the +Vref is available. Now I know they exist as well, thank you!

    Then it gets trickier, one way is to use some analog circuitry to first subtracst 1V from the signal and then amplify it with a gain 1.25, that will give you 0-5V output. An easier way is probably to get a PIC which has it's -Vref available to the outside.

    There are IC's available specifically for converting current loops to voltage, here's a MAXIM app note showing one.

    But again, what kind of resolution do you really need? Do you have a datasheet for the transducer you're using?

    /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