This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: ADCA resolution for Internal temperature sensor measurement

Part Number: TMS320F28377D

Hi,

we use the the ADCA in 16-bit differential mode. We would like to add a new feature and measure also the temperature of the internal temperature sensor on channel ADCIN13.

ADCA is assigned to CPU1 and three SOCs are configured. The original SOC1, SOC2 that need 16bit mode and we added the temperature measurement to SOC3

now i quote from the reference manual:

To sample the temperature sensor, the ADC must be in single-ended 12-bit mode. If the temperature sensor is sampled in 16-bit mode, the ADC will switch to 12-bit mode to perform the conversion. This could cause incorrect ADC results.

When we tested the code, the real behavior was different. The ADCA mode remains unchanged (which can be controlled in the ADCCTL2 register) and the measured values in all ADCAResult1/2/3 registers have 16bit resolution - even the temperature measurement from SOC3 (the lower 4 bits are changing constantly).

Even the conversion time for temperature measurement corresponds with the 29.5 cycles in16bit resolution mode. In order for our application to work, we need the 16bit resolution for all other measurements, except the temperature measurement

My question is following: Why does the ADC resolution stay in 16bit mode?  Can we rely on this behavior? Or is the ADC mode reconfigured for each conversion (SOC1/2/3)?

Thank you very much for your help!

Jan

  • Hello Jan,

    Can you provide the code for how you configure the ADC and the temperatures that you record from the sensor? When I run the adc_ex3_temp_sensor example on my board, I verified that the values did not exceed 12-bits. Have you tried testing this example to verify the problem is not coming from hardware?

    Best regards,

    Omer Amir

  • Hello Omer,

    the ADCA is configured as follows:

    ADC_setupConverter(ADCA_BASE, ADC_CLK_DIV_5_0,ADCRESOLUTION_16BIT, ADC_MODE_DIFFERENTIAL);

    ADC_setupSOC( ADCA_BASE, 1, ADC_TRIGGER_CPU1, 0x02, 150 );    //   original 16bit measurement
    ADC_setupSOC( ADCA_BASE, 2, ADC_TRIGGER_CPU2, 0x04, 150 );   //   original 16bit measurement

    ADC_setupSOC( ADCA_BASE, 3, ADC_TRIGGER_CPU2, 0x0D, 50 );    //    Internal Temperature Sensor.

    I am aware of the fact, that the ADC is configured as 16bit. I have just tried to add the temperature measurement to the current measurement set. And it works. Only later became aware of the notice in the manual, that the mode for temperature measurement will be forced to 12bit mode. It does not seem like it, so i am just wondering if i can rely on this behavior.

    Best regards

    Jan

  • Hello Jan,

    Your configuration looks fine, being in 16-bit mode should not affect the temperature results. Can you provide the temperatures that you recorded from the sensor? Are these temperatures correct according to the environment of the device? You should be able to use "ADC_getTemperatureC(uint16_t tempResult, float32_t vref)" to get the temperature in Celsius.

    Best regards,

    Omer Amir

  • Hi Omer,

    The customer would like to understand, why the ADCA Resolution is NOT switched to 12bit when reading the sensor temperature.

    They want to make sure, that the 16-bit measurement for SOC1 and SOC2 remains unaffected by the temperature measurement.

    They did a test and the 16-bit measurement are not affected but the behavior does not correspond to the information in the reference manual, which states "do not use it like this!".

    They accidentally found that this works and would like to make sure the behavior can be counted on.

    I am hoping for your response.

    Regards,

    Marvin

  • Hi Omer,

    the measured temperature looks fine - see the diagram below.

    Best regards

    Jan

  • Hello Jan,

    I will try to confirm that this behavior is as expected, but from a previous conversation I had with one of my colleagues it seems like this is expected. I will update you when I get a response.

    Best regards,

    Omer Amir

  • Hello Jan,

    I've discussed this with some of my colleagues and the way sampling the temperature sensor works is that the currently configured ADC resolution is overridden when sampling the temperature sensor. The actual configured mode of the ADC is never changed, but the hardware itself overrides it and forces the conversion of the temperature sensor to happen in 12-bit mode regardless of the what the register says. Any conversions on other channels will still happen in whatever mode the ADC was originally configured (there's no need to manually change the mode between the conversions since it never actually changes in the register).

    In short, the behavior you're seeing is as expected. The reference manual does not word this correctly, I will see what I can do to adjust this (I think it's trying to say that if your ADC is in 16-bit mode and you read the temperature sensor expecting the result to be a 16-bit resolution, your result will be "incorrect").

    Best regards,

    Omer Amir

  • Hello Omer,

    thank you very much for your help!

    Best regards

    Jan