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.

[FAQ] TMS570LC4357: There are three instances of temperature sensors in this MCU, how to configure the pin multiplexing (pinmux) to select ADC pins for those temperature sensors?

Part Number: TMS570LC4357

1. How to enable those three temperature sensors?

2. Can the temperature sensor be used to measure the room temperature?

3. How to configure the pin multiplexing to select AD1IN[31] for the temperature sensor 1?

4. How to configure the pin multiplexing to select AD2IN[31] for the temperature sensor 2?

5. How to configure the pin multiplexing to select AD2IN[30] for the temperature sensor 3?

6. How to calculate the junction temperature from the three sensors' value?

  • There are three instances of temperature sensors in this microcontroller. The measured temperatures are analog signals. These analog signals are connected to the on-chip ADCs for conversion.

    1. How to enable those three temperature sensors?

    Before the temperature sensors can be used, they must be enabled. By default, they are disabled with PINMMR174[24] = 1. To enable the temperature sensors, PINMMR174[24] must be cleared to 0.

           pinMuxReg->PINMUX[174] &= (uint32)(0XFEFFFFFFU);

    2. Can the temperature sensor be used to measure the room temperature?

    No, they are not used for measuring the ambient temperature. We measure the die junction temperature sensors using those sensors. The maximum Junction temperature for this device is 150ºC or 423.15K.

    3. How to configure the pin multiplexing to select AD1IN[31] for the temperature sensor 1?

    The temperature sensors are connected to a on-chip analog-to-digital converter (ADC) through the I/O Multiplexing Module (IOMM).

    Temperature sensor 1's output is multiplexed with AD1IN[31].
    To connect AD1IN[31] to temperature sensor 1's output: PINMMR173(16) = 0 and PinMMR173(17) = 1

    pinMuxReg->PINMUX[173] = (pinMuxReg->PINMUX[173] & 0xFFFEFFFF) | 0x00020000;

    In order to use AD1IN[31] to measure the external input signal, the PINMMR174[24] must be cleared.

    4. How to configure the pin multiplexing to select AD2IN[31] for the temperature sensor 2?

    The temperature sensor 2's output is multiplexed with AD2IN[31]. AD2IN[31] is not exposed on terminals but internally it exists and is used for temperature sensor 2.

    To connect AD2IN[31] to temperature sensor 2's output: PINMMR173(24) =0 and PINMMR173(25) = 1

    pinMuxReg->PINMUX[173] = (pinMuxReg->PINMUX[173] & 0xFEFFFFFF) | 0x02000000;

    5. How to configure the pin multiplexing to select AD2IN[30] for the temperature sensor 3?

    The temperature sensor 3's output is multiplexed with AD2IN[30]. AD2IN[30] is not exposed on terminals but internally it exists and is used for temperature sensor 3.

    To connect AD2IN[30] to temperature sensor 3's output: PINMMR174(0) =0 and PINMMR174(1) = 1

    pinMuxReg->PINMUX[174] = (pinMuxReg->PINMUX[174] & 0xFFFFFFFE) | 0x00000002;

    6. How to calculate the junction temperature from the three sensors' value?

    Initialization:

    • ADC module initialization: suggest to setup the ADC with a minimum of 500ns discharge time and 1us sample time.
    • ADC module offset calibration
    • Read sensors' calibration data from OTP, and calculate the sensor's calibration slopes and the sensor's calibration offsets

    Measurement:

    • Read measured value from AD1IN[31], or AD2IN[31], or AD2IN[30]

    Calculation:

    • Scale the ADC sample value based on the actual ADC reference voltage
    • Converts the ADC sampled value to degree ºC using the calculated slope/offset

                Junction Temperature ( ºC) = ((ADC Sampled Value - sensor's calibration offset) * sensor calibration slope) - 273.15

    For demo code, please refer to the application note spna216: spna216.pdf