how to pull down ADC pin?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-18 11:08 AM
hi,
i am facing problem with ADC, when nothing is connected on ADC pin it still shows count. i thought may be the pin is in float condition. i pulled it down but still its showing counts. cant find the problem.
- Labels:
-
ADC
-
GPIO-EXTI
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-18 12:29 PM
Which STM32? Which package? Which pin? Which ADC?
What is the GPIO register setting for this pin?
What are the range values reported by the ADC?
Is the ADC data read directly as injected channel or through DMA on normal channel?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-18 12:34 PM
thanks for the response.
i am using stm32f107, ADC1 and channel 1 which is mapped on pin PA0. i am using ADC in interrupt mode, i am using HAL_ADC_GET_VALUE( ) function to get the value. after converting values in volts its is 1.65 volts approx. that's the voltage when the pin is in floating condition. i am using stmcubemx for the configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-18 12:35 PM
thanks for the response.
i am using stm32f107, ADC1 and channel 1 which is mapped on pin PA0. i am using ADC in interrupt mode, i am using HAL_ADC_GET_VALUE( ) function to get the value. after converting values in volts its is 1.65 volts approx. that's the voltage when the pin is in floating condition. i am using stmcubemx for the configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-19 05:32 AM
Are you using the internal pull-down built into the GPIO structure or an external one?
It might not be possible to use the internal pull when the pin is set to Analog. Looking in my (admittedly old) stm32f107 reference manual, the input options are Analog, input-floating, input-pull-up and input-pull-down.
I don't see an analog-pull-down option.
Now it *might* be that some of the ST software doesn't make that restriction obvious, but it's there in the reference manual and I consider that definitive.
What happens if you hang an external pull-down resistor in the pin? And what about if you measure the voltage on the pin with a voltmeter?
Hope this helps,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-03 10:22 PM
Hi @Danish​ , iam also facing the same issue as @CJami​ , Analog pins by default giving me 1.65 V i have measured voltage on pins using multimeter iam getting 0V , when iam connecting 3.3V to analog pins iam getting 3.3V but when iam connecting GND the value is still 1.65V .
Iam using STM32MP1 series, configured pin is ANA0 and ANA1 iam using polling method.
can you please help me regarding this issue?
Regards
Akshay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-04 12:21 AM
Sorry I don't know the stm32mp1, and never mastered the stm32h7.
When you connect the pins to ground, how strongly are they connected to ground?
The reason I say this is because if you connect a multimeter, it will show 0V because a multimeter typically has 10 MegOhms between its probes, and that's enough to discharge any voltage on the timescale of a multimeter-measurement. But that's way too high a resistance over the very-fast acquisition-time of a stm32 ADC input.
So that raises a second question - what is the acquisition-time you're using for these measurements? And the ADC clock?
And the third question: Is this on an ST-built demonstration board, or something you or a colleague designed? Because if it's not a board designed/made by ST, it is possible that the analogue references are not properly connected, which will give "interesting" results.
Note: I see you also sent me a message directly. I don't generally answer technical questions directly - any insight/wisdom I have (what little there is) I like to give to the whole board, not just individual members. (I might take a different view if I were being paid by that member for the advice, but perhaps we'd better not go there).
Hope this helps,
Danish