Feb 28, 2018
05:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 28, 2018
05:59 AM
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:
What is wrong?
Thanks a lot for any advice.
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.
2 Replies
Feb 28, 2018
06:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 28, 2018
06:57 AM
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".
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".
Mar 21, 2018
01:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 21, 2018
01:58 AM
Hello,
no help with this issue ?
Kind regards
no help with this issue ?
Kind regards