<a href=""><font color="#000000"><font size="2">Ninja</font></font> </a> kag
Posts: 85
Registered: ‎11-29-2015

ADC window / compare threshold interrupts greater than conversion rate

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?


Thank you,




Posts: 2,597
Registered: ‎08-25-2015

Re: ADC window / compare threshold interrupts greater than conversion rate



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.