-
Notifications
You must be signed in to change notification settings - Fork 67
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
Support for ADCs #20
Comments
I don't think anyone else is working on this, so feel free to contribute! I don't know enough to help out though. |
I'm also interested in using (and therefore implementing) this. |
So I've been looking into this and had wonder how to solve the following issue: Side note: I'm new to Rust in general and this crate in particular so maybe I'm just not getting it. Feel free to say so directly and enlighten me ;) |
@strom-und-spiele I've only been experimenting, and have nothing definitive to share yet. You are right that the chip capabilities vary, so we need a configurable implementation. I do think a shared implementation for all stm32f3xx adc configs is the way to go. After all, the C HAL provided by ST is also configurable across all STM32F3xx chips (stm32f3xx_hal_adc.c). Configuration is not a part of the embedded_hal::adc Traits, but we can learn from other configurable features in this crate (and/or other embedded crates). However, I think the first step is implementing the traits for a hard-coded configuration, and generalizing from that. I would be happy to discuss this further. I'm on freenode/#rust-embedded if you want to reach me. My nickname on freenode is MvdS. |
@strom-und-spiele I have taken a look at the SAR ADC on the f3discovery board, you can see my very simple readout here: https://gist.github.com/moshevds/e39e2897058b4f00ab35477986c7d980 If you want to experiment with implementing the OneShot trait, it could serve as a starting point. There are 3 things that don't work as I intended them:
|
gist on adc, dma and dac: |
https://github.com/strom-und-spiele/stm32f3xx-hal/pull/1 |
Feel free to open a PR, which is only working for the 303, for now. We can Btw. @strom-und-spiele your link is not working anymore. |
I'll look into it and open a PR with whatever I manage to finish by the end of the day. Thanks for stating it clearly that partial work is acceptable. |
According to the reference manual, STM32F303xB/C/D/E, STM32F303x6/8, STM32F328x8, Coming to think of it, it also seems to be an apropriate take to implement it "as written" and assume it works until someone who has the hardware prooves otherwise. I can also relate to the demand of quality, i.e. actually running your code on hardware. Is there a best practice to this? And if not, what are your personal opinions? |
That's good to hear. I'm fine if this PR only addressing the stm32f303 for now. I'm not aware of any best practices, but if differences does only come down to choosing the right pins, I would go and add them, even if this means that we develop in the blind, as we do not have the hardware. We can always improve from this point onwards, if someone comes along with the right hardware and points out the issue. |
Hi,
I want to use the analog-to-digital converters on STM32F3. Since I need to implement this anyway, I think this HAL crate is the best place to add support.
My primary goal is using the ΣΔ ADCs on STM32F373, but I think implementing SAR and other STM32F3 chips may be reasonable because of a large amount of overlap. I would also love to hear any other thoughts about this.
Greetings,
Môshe van der Sterre
The text was updated successfully, but these errors were encountered: