- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
08-09-2017 07:34 PM - last edited on 08-21-2017 03:25 AM by Siliconlabs
I am using the Blue Gecko's, EFR32BG1, ADC Window Compare function to determine the joy stick direction and how long it has been asserted in that direction. The adc's conversion rate is set to 500 conversions per second. I have verified this conversion rate by having the ADC increment a counter after every conversion via an interrupt call due to ADC0_IF_SINGLE.
If I push the joy stick in a direction for a short period of time, such as a pulse, the ADC interrupt routine is entered an additional 15,000 to 17,000 times compared to the conversion rate of 500. I have verified via an oscilloscope that the pulse is approximately 150mS which should result in the interrupt handler being called 500 * 150ms/1000 = 75 times.
If I add code to prevent the interrupt handler from exiting and enabling global interrupts until the SINGLECMP is cleared, the interrupt routine is not left until the joy stick is no longer being asserted. My assumption is that once the data has been read, the valid comparison would be de-asserted until the next conversion has been completed and compared which appears not to be occurring. Instead, the window compare is asserted until a valid comparison has been completed and not within the window. With the comparison still valid, it appears to re-enter the interrupt handler and thus the counter is being incremented an additional 15,000 to 17,000 times.
How can I read the number of continuous conversion within the Window Threshold?
08-10-2017 01:25 AM
I moved your post into the 32-bit MCU board where you can find better support for the EFR32 peripherals. Questions posted in the Bluetooth board are typically related to the Bluetooth stack.