Voltage monitoring

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

cross mob
User8683
Level 4
Level 4
First like received
Hello,

In looking through the reference manual, I couldn't find enough information on the Power Management system regarding the VDESR flag outputs.

I have tried the following for checking the voltage:

https://www.infineonforums.com/threads/2441-XMC1000-TIP-of-the-day-Monitor-the-supply-voltage

as well as the following code:


SCU_GENERAL->PASSWD = 0x000000C0UL;
WR_REG( SCU_ANALOG->ANAVDEL, 0xFFFF, 0, 0x0012 ); // enable voltage detector with 4.4V threshold
SCU_GENERAL->PASSWD = 0x000000C3UL;
voltageLevelFlag = (uint8_t)RD_REG( SCU_POWER->VDESR, SCU_POWER_VDESR_VDDPPW_Msk, SCU_POWER_VDESR_VDDPPW_Pos);


to try to determine whether the power supply is providing 3.3 or 5 volts. Unfortunately, I always get 0 as the voltageLevelFlag which unfortunately does not tell me if the problem is that the power monitoring was not set up properly or there is some other problem. Based on my readings, I would expect that operating with 3.3 volts would give an output of 2 and operating with 5 volts would give an output of 0.

Are any steps missing because the need to set the password was not in the manual? So it is not entirely clear if other steps may be required.

Thanks,

Jason
0 Likes
1 Reply
User8683
Level 4
Level 4
First like received
Since no support was offered for this issue, I had to resolve it myself. Good chips but miserable customer support...

The issue is that even with the detection delay time set to 0x03 or no delay in ANAVDEL, there is still a delay in the flag being set so the configuration in the ANAVDEL register needs to be set some time in advance of when the value is required. Also, keep in mind that the bit flag in VDESR is set to 1 when the value is below the set threshold.
0 Likes