Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

NXTY_Tatebayasi
Level 3
Level 3
10 questions asked 10 likes given 10 replies posted

Hi, Community

We have designed a system consisting of a hardware switch, UART, and capsense that transitions from a low-power mode(Sleep mode) to an active state(= wake UP )triggered by the hardware switch.

The design allows no other interrupts while transitioning to wakeup.

However, turning hardware switches on and off in the wake up status will cause unintended interrupts.

We were concerned about data remaining in the interrupt registers of the hardware switch.

We would like to know the state of direct interruptions allowed.

Could you please tell me how to check the status of NVIC registers?

 

NXTY_Tatebayasi_1-1672906666689.png

Our development environment is shown below.

・Device: PSoC4000S(CY8CKIT-145-40xx) 

・IDE: PSoC Creator 4.4 

・Debugger:MiniProg4

 

Best Regards,

Chihiro Tatebayashi

0 Likes
1 Solution
LinglingG_46
Moderator
Moderator
Moderator
10 questions asked 5 questions asked 250 sign-ins

 No, we don't have this function. But before you disable the interrupt, please call the API "  isr_GPIO_ClearPending();  " to clear the pending interrupt.

In addition, I don't think we're going to have an unintended interrupt when the hardware switch on and off. Unless there is mechanical button jitter.

 

 

 

View solution in original post

4 Replies
LinglingG_46
Moderator
Moderator
Moderator
10 questions asked 5 questions asked 250 sign-ins


1:As my understanding,what you said the hardware swithces means GPIO interrupt. You want to use the GPIO interrupt to wake up the Chip from sleep mode.
2:NVIC mean "nested vectored interrut Controller", I am a bit confused about the NVIC register. Do you mean that you want to clear the GPIO interrupt mask bit? If so, you can check the register "GPIO_PRTX_INTR", for example "GPIO_PRT0_INTR" to clear the interrupt mask.
Before the operation, you can clear pending interrupt at first.Just like the code snippet.
CY_ISR(GPIOIsrHandler)
{
/* Clear pending Interrupt */
isr_GPIO_ClearPending();

/* Clear pin Interrupt */
Pin_Sw_ClearInterrupt();

}
3: More about the GPIO interrupt,you can check the test project in attachment.
4: Could you explain in details what happened in the active status what you said "unintended interrupts"?

NXTY_Tatebayasi
Level 3
Level 3
10 questions asked 10 likes given 10 replies posted

Hi, @LinglingG_46 

Thank you for your reply. I would like to answer the questions you have posed to me.

1:

>As my understanding,what you said the hardware swithces means GPIO interrupt.

  Yes.

>You want to use the GPIO interrupt to wake up the Chip from sleep mode.

  Yes.

2:

>Do you mean that you want to clear the GPIO interrupt mask bit? 

   It is not so.  We would like to know how to check if there are any interrupts pending while interrupts are disabled.
For example, is there a function that says "isr_GPIO_InterruptFlagRead();"?

 

4: The following diagram illustrates our problem.

The first waveform shows the GPIO input, the switch being pressed down.

The second waveform is the UART transmit waveform. This is just an output to indicate the state of Active or Sleep mode.

In our design, we "disable" the GPIO interrupt setting when the program state is active and toggle its interrupt setting to "enable" when the program is in sleep.

We can confirm that wave 3 (also 2 )is experiencing unintended interrupts because of this.

The third waveform is a toggle for each interrupt detected. This is a test feature to verify that the interrupt was generated by the voltage output. This output is not used in the product program.

And the fourth waveform shows the ideal interrupt. This waveform is an image. It is not the waveform actually observed.

It is assumed that the unintended interrupt occurred immediately after the GPIO interrupt was set to "allow".
Considering that the pending hardware push down during the interrupt inhibit was affecting the situation, I tried calling the API for clearing pending [isr_GPIO_ClearPending();] , but the situation did not change.

Therefore, we are interested in other possible causes or countermeasures.

NXTY_Tatebayasi_0-1673595147035.pngBest Regards,

Chihiro Tatebayashi 

0 Likes
LinglingG_46
Moderator
Moderator
Moderator
10 questions asked 5 questions asked 250 sign-ins

 No, we don't have this function. But before you disable the interrupt, please call the API "  isr_GPIO_ClearPending();  " to clear the pending interrupt.

In addition, I don't think we're going to have an unintended interrupt when the hardware switch on and off. Unless there is mechanical button jitter.

 

 

 

Hi, @LinglingG_46 

Thank you for your help!

 

Best Regards,

Chihiro Tatebayashi

0 Likes