-
Notifications
You must be signed in to change notification settings - Fork 594
B g431 b current sense fixes #210
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
Conversation
Did you try using
|
That's a good point. I feel I messed up with the original implementation, we called it inline current sense, but it really implements low side current sense. I'm confused why the wiki claims inline current sensing support for this board, it seems that placing the required resistors would require very advanced soldering... I tried using low side current sense, but it doesn't work. There are multiple problems with initialization and syncing, I will attempt a fix. |
Hey @sDessens, The docs are wrong you are right! So I've gone quickly through the code and can it be that the line:
has to be called before the timer init? I did not have any problems with this so far for f1, f4 and g4 low-side current sensing. They all work with the TRGO UPDATE setting
and repetition counter downsampling
that are done after the timer init. They are called when the timer is stopped and once they are called the timer is resumed. However, the bg431 code is the only one which for now uses the DMA so this might be the issue. |
84a4aba
to
370a209
Compare
I managed to fix the problem, it turns out there was a null-pointer and this caused unpredictable behavior. With this rebase, LowsideCurrentSense works but InlineCurrentSense does not work. |
Awesome, thanks! This was my fault, I've refactored the code but as I did not have the board I did not test it properly! |
I feel the community might be slightly confused that we switched from inline to lowside current sensing on this board. Would it be a good idea to display a warning when the user initializes inlineCurrentSense on this board. For example by displaying a debug message in _configureADCInline? |
I'll make sure to update the docs for the next release. All the library examples already use the low-side current sensing so that should make things a bit easier. I think adding the message in configure inline is a good idea, just to be make the transition a bit smoother for the people used to use inline cs. |
Merging, thanks again! |
Only tested on B-G431B with inline current sense.