- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
In my app, I was enable a rtc alarm interrupt with every second, and it was working. But when I want to disable this interrupt, it working in the end, but there was an unexpected interrupt happened.
diable interrupt method:
bk = Cy_RTC_WriteEnable(CY_RTC_WRITE_ENABLED);
BACKUP_ALM1_DATE=0;
Cy_RTC_WriteEnable(CY_RTC_WRITE_DISABLED);
Solved! Go to Solution.
- Labels:
-
PSoC 6 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Nanty ,
You need to clear any pending interrupts using Cy_RTC_ClearInterrupt(). Also, note that the RTC clock will be running in the background and therefore you might get the next interrupt within 1 S itself which is an expected behavior. If you want to get an interrupt again after 1 s of enabling the interrupt back , you might have to reinitialise the RTC block. A much simpler way to achieve this would be to use a Hardware Timer block instead of a RTC.
Please note that Cy_RTC_WriteEnable() is used to modify the RTC user registers and can't be used for your use case. Please check the description of the API from the PDL reference guide.
https://infineon.github.io/mtb-pdl-cat1/pdl_api_reference_manual/html/index.html
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Nanty ,
You can use Cy_RTC_SetInterruptMask() to prevent (mask) required events from triggering an interrupt . You can also use NVIC_DisableIRQ() to disable the entire RTC interrupts from triggering. Please let us know if this works for you.
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bragadeesh,
Cy_RTC_SetInterruptMask() and NVIC_DisableIRQ() can stop the interrupt, and no unexpected interrupt happened when stop. But when I resume the interrupt, the first time of the interrupt was not 1S between interrupt enable and happened. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Nanty ,
You need to clear any pending interrupts using Cy_RTC_ClearInterrupt(). Also, note that the RTC clock will be running in the background and therefore you might get the next interrupt within 1 S itself which is an expected behavior. If you want to get an interrupt again after 1 s of enabling the interrupt back , you might have to reinitialise the RTC block. A much simpler way to achieve this would be to use a Hardware Timer block instead of a RTC.
Please note that Cy_RTC_WriteEnable() is used to modify the RTC user registers and can't be used for your use case. Please check the description of the API from the PDL reference guide.
https://infineon.github.io/mtb-pdl-cat1/pdl_api_reference_manual/html/index.html
Bragadeesh