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.

tms570lc4357 onboard CPU temperature sensor 2 issue?

Other Parts Discussed in Thread: HALCOGEN

Hi Guys,
I am trying to read all the CPU temperature sensors (Temp1: ADC1[31], Temp2: ADC2[31], Temp3: ADC2[30])
Temp1 and Temp3 works well, but I got no value neither id from the AD2 in the case of Temp2.

pinmux settings seems to be ok:

pinMuxReg->PINMUX[174] &= 0XFEFFFFFFU;
PINMUX_TEMP1_ENABLE(ON);
PINMUX_TEMP2_ENABLE(ON);
PINMUX_TEMP3_ENABLE(ON);

AD2 channel select also seems to be ok. (0xCxxxxxxx)

The MCU silicon is revb: TMS5704357BZWTQQ1 YFB-66AR5FW.

Do you have any idea on this?

Regards, Szilárd

  • Hi Szilard,

    I need to consult on this one. I haven't done much w. temp sensor.

    -Anthony
  • Hi Anthony,

    I couldn't sleep so I also checked on my LaunchPad. It has a slightly different part number:

    TMP5704357BZWTQQ1 YFB-55ARJ0W and it seems to work.

    I am going to double check the sofware on the TMS5704357BZWTQQ1 YFB-66AR5FW again (I know - this should be good, not the TMP one) .

    A diagram on the temperature sensors circuit also would be valuable.
    Regards: Szilárd

  • Hi Anthony and Charles!

    There is a little development. The issue is not TMP/TMS related.
    Both of TMP5704357B and TMS5704357B have same behaviour.

    As I experienced ADC2 not willing to convert more than 16 channels (incl. temperature sensors).
    It was misleading first, because on the TMS I had enabled 15 (+2 temperature channel) so ADC2[31] "didn't fit", while on TMP there was only 1 (+2 temperature) enabled.

    I haven't got a clue about if it is hardware or software related problem, but least reproducible.
    I still using HALCoGen 04.04.00, but checked the changelog of higher versions.

    Any idea?
    Regards, Szilárd

  • Here is code that I used to read any of the three temperature sensors:

    short thermistor_read(char thermistor) {
    	unsigned int value=0, stat=0, pinmux_restore=0;
    	volatile uint32 delay;
    	adcBASE_t *adcreg;
    
    	if (thermistor <= 2U) {
    		/* Select the ADC */
    		adcreg = (thermistor==1||thermistor==2)?adcREG2:adcREG1;
    
    		/* Enable Temperature Sensors in Pin Muxing */
    
    		/* Enable Pin Muxing */
    		pinMuxReg->KICKER0 = 0x83E70B13U;
    		pinMuxReg->KICKER1 = 0x95A4F1E0U;
    
    		/* Enable Temp Sensor */
    	    pinMuxReg->PINMUX[174] &= 0xFEFFFFFF;
    
    		/* Connect Sensor 0 - Temperature sensor 1's output is multiplexed with AD1IN[31] */
    		if(thermistor==0)	{
    			pinmux_restore = pinMuxReg->PINMUX[173];
    			pinMuxReg->PINMUX[173] = (pinMuxReg->PINMUX[173]&0xfffeffff)|0x00020000;
    		}
    
    		/* Connect Sensor 1 - Temperature sensor 2's output is multiplexed with AD2IN[31] */
    		if(thermistor==1)	{
    			pinmux_restore = pinMuxReg->PINMUX[173];
    			pinMuxReg->PINMUX[173] = (pinMuxReg->PINMUX[173]&0xfeffffff)|0x02000000;
    		}
    
    		/* Connect Sensor 2 - Temperature sensor 3's output is multiplexed with AD2IN[30] */
    		if(thermistor==2)	{
    			pinmux_restore = pinMuxReg->PINMUX[174];
    			pinMuxReg->PINMUX[174] = (pinMuxReg->PINMUX[174]&0xfffffffe)|0x00000002;
    		}
    
    		/* Disable Pin Muxing */
    		pinMuxReg->KICKER0 = 0x00000000U;
    		pinMuxReg->KICKER1 = 0x00000000U;
    
    
    		/* delay for the connection to stabilize */
    		//for(delay = 0xFFU; delay > 0U; delay--) {} Use the ADC discharge time as the delay
    
    		/* Start Converting, Choose Channel */
    		if (thermistor==0||thermistor==1) adcreg->GxSEL[1U] = 0x80000000;
    		else adcreg->GxSEL[1U] = 0x40000000;
    
    		/* Poll End of Conversion */
    		stat=(adcreg->G1SR)&1;
    		while(!stat) stat = (adcreg->G1SR)&1;
    		value=adcreg->GxBUF[1U].BUF0;
    
    		/* Enable Pin Muxing */
    		pinMuxReg->KICKER0 = 0x83E70B13U;
    		pinMuxReg->KICKER1 = 0x95A4F1E0U;
    
    		/* Disable Temperature Sensor */
    		pinMuxReg->PINMUX[174] |= 0x01000000;
    
    		/* Restore Sensor 0 Pin Muxing */
    		if(thermistor==0)	pinMuxReg->PINMUX[173] = pinmux_restore;
    
    		/* Restore Sensor 1 Pin Muxing */
    		if(thermistor==1)	pinMuxReg->PINMUX[173] = pinmux_restore;
    
    		/* Restore Sensor 2 Pin Muxing */
    		if(thermistor==2)	pinMuxReg->PINMUX[174] = pinmux_restore;
    
    		/* Disable Pin Muxing */
    		pinMuxReg->KICKER0 = 0x00000000U;
    		pinMuxReg->KICKER1 = 0x00000000U;
    
    	} else
    		value = -1U;
    
    	return value;
    
    } // thermistor_read
    
    

  • So reading the temp sensors on ADC2 works, it is just that reading more than 16 channels on ADC2 is not working? Is the problem related to a specific location in the MibADC buffer, or is it always 16 channels regardless of which group and how you configure the three buffers?
  • Hi Bob!
    Am I right, that this function is also usable for reading value of ADC1[30] with input data thermistor = -1 ?? :))
    I think, I am tired enough.. :)
    thank you for your help!
    Regards, Szilárd
  • Hi Bob,
    Yes, reading the temp sensors ADC1/2 work. But if I try to enable more than 16 channel (I just tried on ADC2 yet) I got only the first 16 channel value. Accidentally Ihave to read 15 + 2 temperature value and because of it, the last value (ADC2[31] = temp2) was missing. As I see your thermistor_read() function enables only the needed (one) channel depends on thermistor value. I am going to continue tomorrow.
    Thank You,
    Best regards, Szilárd

  • Anthony, Bob, and Charles,
    I am sorry Guys. This was my fault, please accept my apologies.

    The problem was that I didn't change the memory boundary settings regarded to the number of used channel.
    HALCoGen default ADx memory boundary settings are (16 (eventgroup) 16 (group1) 32 (group2) word).
    Because of it I got no more than 16 values in the case of group1. After modifying the boundary everything works
    well.

    Regards, Szilárd