cancel
Showing results for 
Search instead for 
Did you mean: 

Pin on STM32L4P5VGT6 interfering with ADC PC3 and PC2

flatirondesigns
Visitor

I made a mistake and set PC2 as an ADC input and PC3 as an GPIO_EXT. The IDE does not warn you when setting the pin to GPIO_EXT, it only shows the warning in the ADC, so I missed it since the ADC was already set.

The question is, is there anyway to make this work. The issue I am seeing is the ADC is reading incorrectly. The GPIO_EXT works fine. 

Thanks.

1 REPLY 1
waclawek.jan
Super User

What do you want to accomplish, exactly?

I don't use Cube/HAL, so I only have to guess that "GPIO_EXT" - which is not to be found in Datasheet or Reference Manual - means that you set PC3 to trigger an EXTI interrupt, and that in turn you set it also to Input in the respective GPIOx_MODER.

But I don't know, which pin(s) do you want to take ADC readings for, PC2, PC3 or both? You can't use PC3 as ADC input and EXTI trigger simultaneously, as ADC requires the pin to be set as Analog in GPIOx_MODER and that disconnects the digital input buffer at that pin.

Otherwise, what is the expected reading, what is the signal source, what is the ADC sampling set to, and how do you know the ADC is reading incorrectly?

JW