Post Go back to editing

Not able to read above 1.3 V in LTC2497

Product Number: LTC2497

Hi,

I am using LTC2497 ADC converter fot my project but i am not be able to read Channel Voltage above 1.33V as i have set some pin mention in below configuration.

REF+ : 3.3 V

REF- : GND

VCC : 3.3 V

LTC2497 to CHO track in beetween not any register or capacitor placed.

I want to read Voltage variation from 0 to 3.3 V it is possible? If yes then How?  I need to change in Hardware or Software?

Thanks & Regards,

Fenil

Top Replies

    •  Analog Employees 
    •  Super User 
    May 29, 2023 +1 verified

    Hi  ,

    The allowable differential voltage that the ADC can read is 0.5*REF as shown in the table on page 3 of the datasheet. The voltage range that the ADC can read with a Vref = 3.3V is from -1…

Parents
  • Hi  ,

    The allowable differential voltage that the ADC can read is 0.5*REF as shown in the table on page 3 of the datasheet. The voltage range that the ADC can read with a Vref = 3.3V is from -1.65V to +1.65V.

    Could you share what is the output code when you have a differential input voltage of 1.33V? 

    Note that the Data Output Code of the LTC2497 is in 2's complement. To convert the output code into voltage you may refer to this Q&A below.

    (+) Q1. How to convert output data code in 2's complement form to voltage? - Documents - Precision ADCs - EngineerZone (analog.com)

    Regards,

    JC

  • Hi Thanks for the reply,

    Please check below code of my application,

    #include <stdio.h>
    #include "freertos/FreeRTOS.h"
    #include "freertos/task.h"
    #include "driver/i2c.h"
    #include <string.h>
    #define I2C_PORT I2C_NUM_0
    #define I2C_ADDR 0x14
    float vref = 3.3; // need to change as per set refrence
    esp_err_t i2c_master_init()
    {
    i2c_config_t i2c_config = {
    .mode = I2C_MODE_MASTER,
    .sda_io_num = GPIO_NUM_1,
    .scl_io_num = GPIO_NUM_2,
    .sda_pullup_en = GPIO_PULLUP_ENABLE,
    .scl_pullup_en = GPIO_PULLUP_ENABLE,
    .master.clk_speed = 100000,
    };
    i2c_param_config(I2C_PORT, &i2c_config);
    return i2c_driver_install(I2C_PORT, I2C_MODE_MASTER, 0, 0, 0);
    }

    void app_main()
    {
    vTaskDelay(1000 / portTICK_PERIOD_MS);
    esp_err_t err = i2c_master_init();
    if (err != ESP_OK)
    {
    printf("Error init I2C\n");
    return;
    }
    uint8_t reg = 0xB8;
    uint8_t buffer[3];
    while (1)
    {
    err = i2c_master_write_read_device(I2C_PORT, I2C_ADDR, &reg, 1, buffer, sizeof(buffer), 1000 / portTICK_PERIOD_MS);
    if (err != ESP_OK)
    {
    printf("Error %x occurred during the I2C transfer\n", err);
    continue;
    }
    // Extract the voltage data from the buffer

    int32_t adc_value = (((((buffer[0] & 0x3F)) << 16)) + ((buffer[1] << 8)) + (((buffer[2] & 0xE0))) + buffer[3]);
    // Calculate the voltage in volts
    memset(buffer, 0, sizeof(buffer));
    printf("adc value : %ld\n", adc_value);
    float voltage = (float)(adc_value * vref) / 8388608.0;
    adc_value = 0;
    // Print the voltage
    printf("Voltage: %.2f V\n", voltage);
    vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
    }
    Now i understand you answer so i can get maximum channel voltage is 0.5*Vref but now i face one more issue when i connect my channel 1 with GND i can get maximum voltage 1.65 but need here 0 V can you please suggest solution?
  • INPUT OUTPUT
    GND 1.65
    0.33 0.36
    0.5 0.51
    0.99 1.01
    1.3 1.32
    GND 1.65


    I have attached one Table  as per table i am getting output in my screen i have start testing first connect to GND i get 1.65 then vary voltage and get almost same output then in last i connect channel with GND and got same as first output 1.65 V

  • Hi  ,

    Looks like there is an error in the calculation from voltage to code. You may have missed that when MSB is 1, you need to subtract 2^N from the code. It may be a case where the ground is not exactly 0V and a small negative voltage is read by the ADC resulting to full scale when you used your equation. Refer to the image below.

    The equation you used works well when the differential input voltage is a positive voltage. In 2's complement, when the MSB is 0 you can directly multiply the decimal code to the LSB.

    Regards,

    JC

  • Hi i have made change according your suggestion but still output is not changed,

    Change:

    // Extract the voltage data from the buffer
    int32_t adc_value = ((((buffer[0] & 0x3F) << 16) | (buffer[1] << 8) | buffer[2]) << 8) >> 8; // Fix the bitwise operation

    memset(buffer, 0, sizeof(buffer));

    printf("ADC value: %ld\n", adc_value);

    // Check if MSB is 1 and subtract 2^23 from the code
    if (adc_value & (1 << 23))
    {
    adc_value -= (1 << 24);
    }

    // Calculate the voltage in volts
    float voltage = (float)(adc_value * vref) / 8388608.0;
    // Print the voltage
    printf("Voltage: %.2f V\n", voltage);
    Still i am getting when i connected my MCU GND with ADC channel i got 1.65
  • Hi  ,

    Could you share what is the output code of the ADC value in this section?

    Regards,

    JC

Reply Children
No Data