-
Notifications
You must be signed in to change notification settings - Fork 973
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
Blackpill F303 vs BluepillF103CB: ADC speed performance #1034
Comments
analogRead is for Ardunio API compatibility and is really not optimized and does a complete init, single ended measure then deinit. As this is a duplicated issue, I close it. |
Hello Frederic, Now, I'll try to explain better myself: I know that the Arduino API is not intended for performances, and also know that it does perform init, calibration, measure, deinit, for each call, and that this will never be even remotely comparable to what one can obtain using HAL directly and/or LL_HAL (I did that for the STM32F303, I've been also successful in using the ADC in DMA mode, gotting almost all the full 5Msamples/s promised in its datasheet, very very impressive!) , nevertheless:
I was simply asking why STM32F303 got such a massive fall in terms of speed compared to STM32F103 and if it was possible or not to try to optimize it to match the STM32F103 performances, that's all :-) Consider that using your latest core version, the STM32F303 performances are almost 30-40% slower than the ones of a modest Arduino Nano (ATMEGA328P mcu @16mhz cpu clock) while, using this same core version on a STM32F103, the latter is 10-20% faster than Arduino Nano. P.S. Regarding a mine eventual contribution on the core, it's sure it's on my intention, however I'm still trying to have a good, complete "overview" and general understanding on how you core is constructed and still fighting with all the STM HAL intricacies, hence I'm not still confident I can be a good contributor for this repo, sorry! :-) |
No worries ;) I will not change this as it is a generic API common for all series. |
@fpistm |
In that case, this is related to HAL and could not help on this as I'm (like you) a user of those API. |
Hello, experimenting with both MCUs, I've noticed that, using your core, F303CC adc speed performance Is about 50% slower than that achievable on F103CB, even manipulating all the possibile settings for F303CB (such as ADC clock division, sampling time).
Looking at the hardware specs, It should be exactly the opposite, considering that F303 has an ADC capable of 5Msample/s, while F103 has a 1Msample/s adc...
Tests have been performed on the same sketch: the sketch simply does N conversions in a for loop and measures the time required to complete It.
Looking at both the analogRead() implementations in your core, It seems that for the F303 there are much more code instructions than for the F103 hence, probably, the bad F303 performances are due to code overhead.
The text was updated successfully, but these errors were encountered: