-
Notifications
You must be signed in to change notification settings - Fork 990
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ADC Libraries #5
Comments
From @palmerr23 on May 6, 2017 7:3 Frederic, I've tested a number of ADC modes - polling, interrupt, DMA. Example files are in https://github.com/palmerr23/Black-F407VET6-cube/tree/master/examples Currently debugging Dual Mode Interleaved (edit: now working). |
Proposed to move on the new repo Arduino_Core_STM32 as this one is deprecated. (same code). |
From @palmerr23 on May 24, 2017 8:36 Frederic, Fine by me. I'm shifting across to the new core also. |
Fix #5 Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Q: instead of adding stuff to the arduino-compatible analogRead have you considered using a different ADC API altogether? Leave analogRead for compatibility purposes but make something better available for advanced uses. The main benefit I see is that a new API allows set-up/tear-down to be separated from the actual reading function. For example, https://github.com/rogerclarkmelbourne/Arduino_STM32/tree/master/STM32F1/libraries/STM32ADC looks pretty darn nice to me and should not be a ton of work to port to LL (if that has all the functionality necessary). |
Yes, this is what I would like. |
Ok, I got a very minimal first version working on STM32L0 doing just single conversions (plus Vcc and Temp). See https://github.com/tve/goobies/tree/master/libraries/STM32ADC/src A simple test sketch I'm using to print ADC value for one channel, Vcc, and temperature:
Output looks something like:
|
@fpistm I would need to do the same in PlatformIO, using your official STM32 Core Arduino and an STM32F407VGT6 (STM32F4 Discovery board). Is there a way to circumvent the obstacle? Moreover, in trying to use the adc in regular conversion interrupt mode, I've also tried with an "unconventional" way trying circumvent the obstacle:
/CIRCUMVENT PART*****/ 5)Created the HAL_ADC_ConvCpltCallback() and ADC_IRQHandler() functions and correctly managed them ....and......it doesn't work when using Arduino framework in PlatformIO but it works when using HAL framework in PlatformIO Please, any suggestion is very very welcome! |
Hi, I hope I am not off topic here. That could help you with the speed topic. Hope it helps. |
Just to prove it works |
Thanks, anyway, I guess there is an issue when using different ADCx. |
Sorry I didn't get you. It's just a proof of concept. |
Hi @fpistm, Is there any interest in this ? Would you accept a PR ? |
All PR are welcome. |
From @palmerr23 on April 26, 2017 5:23
Frederic,
I've been testing the advanced ADC\DAC modes (beyond single conversion, polling) using the templates from STM32Cube_FW_F4_V1.15.0\Projects\STM324x9I_EVAL\Examples\ADC\ and \DAC\
When using these other analog routines, HAL_ADC_MspInit() etc need to be customised for each configuration.
Now I'm trying out the dual-interleaved mode, it has become clear that the code in analog.c is just an initial test.
As HAL_ADC_MspInit() needs to be customised for each configuration, I'm looking at hiding the MSP_Init functions in analog.c at the system level and moving the code up to a library. The Init functions can then be customised for each mode.
When I tried this, other functions break - like dac_stop() and pwm_stop(). I think I'll be able to leave them in analog.c
Give me a few days and I'll have something workable.
Single-Polling and Single-interrupt are working already, using pretty much standard code from the Cube libraries, next up is dual-interleaved
Richard
Copied from original issue: fpistm/Arduino_Core_STM32F4#11
The text was updated successfully, but these errors were encountered: