How to determine the channel which has triggered HAL_ADC_LevelOutOfWindowCallback on adc?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-10 3:56 AM
Hello everyone
I am using an STM32F103RB. I would like to do some sound triangulation stuff. Therefore i have 3 microphones which are all connected to ADC1. I installed a watchdog. Everything works fine, and the callback is triggered for all 3 channels. Now i am not sure, how to determine, on which channel, the voltage was out of threshold.
Can anyone help me?
- Labels:
-
ADC
-
STM32Cube MCU Packages
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-10 5:55 AM
You have to read all the values and see which is out of range. If you enable the out of window interrupt, it should be the last value, or maybe one of the last few depending on your sample rate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-10 6:14 AM
Hey TDK
​
Thanks for your answer. Isn't there any bit which indicates the last converted rank or anything else? It seems to be weird to read again the values in the interrupt...​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-10 6:23 AM
I don't see anything like that. Take a look yourself.
If you're transferring to a circular DMA buffer, NDTR could help you figure out that info.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-10 8:25 AM
Well, then I see no other option than buying another nucleo containing 3 adc (i.e a STM32F4)...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-10 2:15 PM
... rather than writing some software?
Weird... but your mileage obviously differs...
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-12 5:16 AM
Okay, what I wanted to say was: In order to still achieve a good resolution of the trilateration, it is probably necessary to go this way, because the time needed to detect the sound levels is already at its limit and will of course grow with more software. Therefore i see no other option for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-12 9:20 AM
That of course makes sense. :)
JW
