LOW VOLTAGE Detect false interrupt

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

cross mob
AhtashamBaig
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Hi Everyone,

I am recently working on an Application with PSoC 6 it is safety critical and we need to monitor Low voltages for battery power, for this i am using LVD block as it monitors VDDD. The issue I am facing when i initialize my module after 3-4 seconds it generates false interrupt for Battery Below threshold but my supplied voltages are above threshold. I tried to wait for other interrupts but no further interrupts are generated. Inside my initialization I added manual trigger for once to check if it reads my voltage above threshold and it successful did also lowering my voltages it read correctly. But I am getting continuous ISR fires until I clear it but when I clear it again fire false interrupt for below voltage

My initialization procedure:

const cy_stc_sysint_t LVD_IRQ_cfg = {
.intrsrc=srss_interrupt_IRQn,
.intrPriority = LVD_IRQ_PRIORITY
};

void LVD_Init()

{

Cy_LVD_ClearInterruptMask();
// Select Trigger level for depletion voltage
Cy_LVD_SetThreshold(0xb);
// Select Interrupt level to be triggered
Cy_LVD_SetInterruptConfig( CY_LVD_INTR_FALLING );
// Enable the LVD Block
Cy_LVD_Enable();
// Minimum delay required
Cy_SysLib_DelayUs(20U);
// Clear any flse interrupt
Cy_LVD_ClearInterrupt();
/* Configure and enable the SAR interrupt. */
(void)Cy_SysInt_Init(&LVD_IRQ_cfg, LVDIRQHandler);
// LVD is initialized
isVCMPInitialized = TRUE;
// Enable the interrupt for LVD
Cy_LVD_SetInterruptMask();
NVIC_EnableIRQ(LVD_IRQ_cfg.intrSrc);

}

void LVDIRQHandler

{

// Variable used to create delay
cy_en_lvd_status_t VoltageStatus = 0;
uint32_t Interrupt_status = 0;
Interrupt_status = Cy_LVD_GetInterruptStatus();
VoltageStatus = Cy_LVD_GetStatus();
// Execute on EDGE interrupt
if (( Interrupt_status == LVD_INTERRUPT ) && ( VoltageStatus == CY_LVD_STATUS_BELOW ))
{
// Clear interrupt flag
Cy_LVD_ClearInterrupt();
Cy_SysLib_DelayUs(1100);
// Disable LVD
//Cy_LVD_Disable();
}

}

0 Likes
3 Replies
ScottKerstein
Employee
Employee
5 solutions authored 10 likes received 25 sign-ins

Hello,

The "PSoC 6 CY8C6xx8, CY8C6xxA Architecture Reference Manual (TRM)" can help here. 

https://www.infineon.com/dgdl/Infineon-PSoC_6_MCU_CY8C6xx8_CY8C6xxA_Architecture_Technical_Reference...

See Section 18.4.3 Low-Voltage-Detect (LVD) Section for 

When enabling the LVD circuit, it is possible to receive a false interrupt during the initial settling time.  Firmware can mask this by waiting for 8 µs after setting the HVLVD1_EN bit in the PWR_LVD_CTL register.  The recommended
firmware procedure to enable the LVD function is:

1. Ensure that the HVLVD1 bit in the SRSS_INTR_MASK register is 0 to prevent propagating a false interrupt.

2. Set the required trip-point in the HVLVD1_TRIPSEL field of the PWR_LVD_CTL register.

3. Configure the LVD edge (falling/rising/both) that triggers the interrupt by configuring HVLVD1_EDGE_SEL bits[1:0] of SRSS_INTR_CFG register. By default, the configuration disables the interrupt. Note: LVD logic may
falsely detect a falling edge during Deep Sleep entry.  This applies only when HVLVD1_EDGE_SEL is set to
FALLING(2) or BOTH(3). Firmware can workaround this condition by disabling falling edge detection before entering Deep Sleep, and re-enabling it after exiting Deep Sleep.

4. Enable the LVD by setting the HVLVD1_EN bit in the PWR_LVD_CTL register. This may cause a false LVD event.

5. Wait at least 8 µs for the circuit to stabilize.

6. Clear any false event by setting the HVLVD1 bit in the SRSS_INTR register. The bit will not clear if the LVD
condition is truly present.

7. Unmask the interrupt by setting the HVLVD1 bit in SRSS_INTR_MASK.

First of all thank you for your swift reply . I have already gone through the technical reference manual and using PDL API reference manual and using the provided example I have implemented in my code .I have verified all my registers LVD are getting set properly, but false interrupt is received after 3-4 seconds not in Us.

Also the same implementation I used with development Kit CY8CPROTO-062-4343W where i powered up my device by connecting VDDIO and GND to 3.3V but tried to lower the voltage but no proper interrupt was received 

Kindly check my implementation if issue with initialization or IRQ handler

Regards

0 Likes
ScottKerstein
Employee
Employee
5 solutions authored 10 likes received 25 sign-ins

I am going to move this thread to an internal MyCase support ticket.  From here we can collaborate more efficiently.

0 Likes