Oct 21, 2020
07:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 21, 2020
07:34 PM
Hello,
I am using a counter to measure the on and off time of the led input given to a GPIO pin. There is a LED On ISR and LED Off ISR. I read the counter value at the start of each ISR and set a flag. This flag is polled in the infinite FOR loop in the main.
When my code runs, it sometimes enters LED On ISR twice consecutively and gives weird on time values. I have logic for resetting the counter in my ISR using the control register.
<OFF>260580
<ON>260782
<ON>1003
<OFF>260842
<ON>258372
<OFF>260700
What could be the reason?
Labels
1 Reply
Oct 26, 2020
10:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 26, 2020
10:59 AM
Hi AaJ_4705826,
Can you please attach your project here ? This will help us understand the issue more clearly and also, the reason for the interrupts to be generated twice.
Best Regards,
Aashita