LPAC and HIB_IO_1 configuration with XMC4400

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

cross mob
User12439
Level 1
Level 1
5 replies posted Welcome! First question asked
Hi,

we are using the LPAC module of the XMC4400 to monitor two voltages. Input pins are VBAT and HIB_IO_1.
The VBAT monitoring works like expected, but the result of HIB_IO_1 monitoring is always that the voltage level
is above the upper threshold level independant from the supplied voltage at HIB_IO_1. I assume there must be an
configuration error. Here are my source code snippets:


/*

the value of LPACCONF at this point is
0x70000071
LPACTH0 = 0x00003F2C ,
LPACTH1 = 0x3F2A0000

*/


while((SCU_GENERAL->MIRRSTS) & SCU_GENERAL_MIRRSTS_LPACSET_Msk)
{
/* Wait until LPACSET register in hibernate domain is ready to accept a write */
}
SCU_HIBERNATE->LPACSET = 0;

XMC_SCU_HIB_LPAC_ClearStatus(XMC_SCU_HIB_LPAC_INPUT_HIB_IO_1 | (XMC_SCU_HIB_LPAC_INPUT_HIB_IO_1<< 16)); // set not ready and below low limit
XMC_SCU_HIB_LPAC_SetInput(XMC_SCU_HIB_LPAC_INPUT_HIB_IO_1);
while((SCU_GENERAL->MIRRSTS) & SCU_GENERAL_MIRRSTS_LPACSET_Msk)
{
/* Wait until LPACSET register in hibernate domain is ready to accept a write */
}
SCU_HIBERNATE->LPACSET = SCU_HIBERNATE_LPACSET_AHIBIO1VAL_Msk;

XMC_SCU_HIB_LPAC_TriggerCompare(XMC_SCU_HIB_LPAC_INPUT_HIB_IO_1);



After ten seconds following code checks the result:

/* is voltage compare completed ? */
if ( SVSSrcGetStatus(XMC_SCU_HIB_LPAC_INPUT_HIB_IO_1) == 1U )
{
if (SCU_HIBERNATE->LPACST & SCU_HIBERNATE_LPACST_AHIBIO1VAL_Msk)
{ /* above low limit is OK */
if ( LimitViolatCntVBATT > 0 )
{
LimitViolatCntVBATT--;
}
}
else
{/* under low limit is an error */
LimitViolatCntVBATT++;
while( SCU_GENERAL->MIRRSTS & SCU_GENERAL_MIRRSTS_LPACSET_Msk )
{} //wait if busy
SCU_HIBERNATE->LPACSET |= CMPENHIB1 << 16; // activate low limit compare
}
XMC_SCU_HIB_LPAC_ClearStatus(XMC_SCU_HIB_LPAC_INPUT_HIB_IO_1);
}


What is wrong?
Thanks a lot for any advice.
0 Likes
2 Replies
User12439
Level 1
Level 1
5 replies posted Welcome! First question asked
Hi,

sorry for my mistake.

Please replace "...is above the upper threshold level independant from the supplied voltage" with
"...is above the lower threshold level independant from the supplied voltage".
0 Likes
User12439
Level 1
Level 1
5 replies posted Welcome! First question asked
Hello,

no help with this issue ?

Kind regards
0 Likes