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

DaKo_463136
Level 5
Level 5
10 likes received 10 likes given 5 likes given

Hello,

I am succesfully using a button on P0.7 to generate a wake-up interrupt from stop mode. I have done this the same way as in AN86233.

Is there a way to add a functionality to generate a software reset of the PSoC when in active mode? I would like to reset the PSoC when in active mode and wake up the PSoC when in stop mode.

I tried to add the following line of code into the ISR, but nothing happens.

CY_ISR(WakeUp_Isr)

{

    // clears the interrupt on change flag

    Pin_SW1_ClearInterrupt();

    // TODO - reset doesn't happen

    CySoftwareReset();

}

Thank you,

David

0 Likes
1 Solution
Anonymous
Not applicable

When pushing the P0.7 button in stop mode, the chip by fact of the operation of stop mode will be resetting on a hardware level; Do you mean resetting the chip when waking up from a different power mode? Hibernate perhaps? Deepsleep? Sleep?

Hibernate and Stop power modes will both reset the chip on wakeup, but any other power mode will run the interrupt and do a software reset as you are expecting.

I doubt the interrupt for the button is even running, as the interrupt from stop mode should be jumping straight to application start location immediately without waiting for the interrupt to be handled by application code (I believe it is also cleared by the application start as well)

View solution in original post

3 Replies
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hello David,

CySoftwareReset();  is expected to force a software reset on the device. But not the psoc peripherals. If that's also not happening will you be able to share your project?

Best Regards,
VSRS

Anonymous
Not applicable

When pushing the P0.7 button in stop mode, the chip by fact of the operation of stop mode will be resetting on a hardware level; Do you mean resetting the chip when waking up from a different power mode? Hibernate perhaps? Deepsleep? Sleep?

Hibernate and Stop power modes will both reset the chip on wakeup, but any other power mode will run the interrupt and do a software reset as you are expecting.

I doubt the interrupt for the button is even running, as the interrupt from stop mode should be jumping straight to application start location immediately without waiting for the interrupt to be handled by application code (I believe it is also cleared by the application start as well)

Thank you both for your replies.

I was confused by the code in AN86233​ a little, but as you say, there is no ISR handler required to wake up from Stop mode. The handler is there for the other low power modes.

I properly added an interrupt handler for a button press, registered the interrupt source with the handler and it works great

David