Die Temperature Sensor

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,

I'm trying to use the DTS on the XMC4400 via DAVE3. The code is generated but it seems that power for that peripheral is missing. so I tried to activate it with

SCU_GENERAL->DTSCON = 0; // reset is power off with "1" in LSB

but that setting is rejected by the register. Is there anything to be done in advace to the power on? I did not find that peripheral in the reset list as others !!

Best regards
Uwe
0 Likes
3 Replies
Not applicable
Hi Uwe,

This is my code and it works fine:

int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
uint32_t Temp = 0;


DAVE_Init(); // Initialization of DAVE Apps

TMPS001_Enable();


while(1)
{
TMPS001_StartMeasurement();

delay(150000); // 0.5msec delay

Temp = TMPS001_ReadTemp();

}
return 0;
}


Is your code the same as mine?
0 Likes
Not applicable
Hi Jackson,

I did not see the macro in the header file so far, I'm sorry.
But it is working now, since I replaced the delay-statement (where is it defined??) with this


while (TMPS001_GetStatus() != TMPS001_READY) {}


The temperature is about 42 degrees which seems to be OK.

Thanks very much for your help. Have a nice weekend !
Uwe
0 Likes
Not applicable
Hi Uwe,

The delay function is not defined in the code generated.
That's the my application code. Basically, just need to indicated there is a delay in between start measurement and read temperature.
Sorry for not stated it clearly.
0 Likes