-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUGFIX] Injected channel #371
Conversation
Hi, I added this code for using injected adc registers and not using the interrupt anymore. |
Your addition works great it's just that for some architectures the #define ADC_INJECTED_RANK_1 (LL_ADC_INJ_RANK_1) /*!< ADC group injected sequencer rank 1 */ here is the link For some architectures it is just from 1 to 3 but for others its done using these LL flags. stm32duino repo search. I am not even sure that these LL flags are consecutive. So it's safer to enforce using the |
My bad, first bug. |
What driver are you using with your nucleo board that has 3 shunts ? |
Here's a higher power one with 3 shunt sensing: https://www.aliexpress.com/item/4000126430773.html This one: https://www.st.com/resource/en/data_brief/x-nucleo-ihm07m1.pdf I also have a DRV8316 based board which has current sensing (3 shunt low side), I could send you one if you want :-) but it is in the shape of a Arduino MKR Shield so you'd need jumper wires to connect it to STM32s. |
Actually I already have: And even managed to order this one when it was finally in stock: I need to go through the docs and see if I can use all shunts on same ADC with the nucleo boards I have. |
Merging into the dev branch. |
There seems to be a bug in the code ( one pretty hard to find, believe me :D )
Basically when in the for loop the injected channels are read the current code does a completely reasonable assumption that
ADC_INJECTED_RANK_1=1
,ADC_INJECTED_RANK_2=2
, andADC_INJECTED_RANK_3=3
,However, at least in case of stm32g474 this is not the case :D
So here is the fix to avoid this assumption.