Skip to content

Added dual-mode support for ADC. #59

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

Closed
jmdodd95682 opened this issue Mar 14, 2024 · 1 comment · Fixed by #65
Closed

Added dual-mode support for ADC. #59

jmdodd95682 opened this issue Mar 14, 2024 · 1 comment · Fixed by #65
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@jmdodd95682
Copy link
Contributor

After reading the 3500-page reference manual (nicely written but so much detail...so much...) for the STM32H7xx
I found how to enable the dual-mode.

I modified the begin() and start() routines and added a few new members to the AdvancedADC class to allow using dual-mode.
This gives the optimal synchronization between two sampled inputs. I'm seeing between 0 and 1us skew, which is pretty good for a 1M samp/sec configuration.

It does have some restrictions. You need to always use ADC1 and 2 (dual mode is only supported in HW for ADC 1 and 2). Also, you need to configure the AdvancedADC instance to explicitly selected dual mode. I tried to keep it as general purpose as possible.

I would be happy to share my code if you're interested. I can do a pull_request.

@jmdodd95682
Copy link
Contributor Author

Oh, also...I believe once we have dual-mode, it will be possible to double sample-rate. There is a delay field which can be programmed and you can enable "Interleaved Mode". If you tie the same input to two pins, enable dual-mode w/ interleaved and set the delay right, it should give you 2X the sample rate. 4M Samp/sec should be achievable. Have not tested this yet, but seems likely it will work.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Mar 14, 2024
@per1234 per1234 added the conclusion: resolved Issue was resolved label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
2 participants