2025-01-21 07:43 AM
Hey everyone,
I have an odd problem with a STM32H563VGT6.
I have configured several GPIO as inputs with no pull-up/ no pull-down. The pins are wired to an external 10k pull-down and a DIP-Switch which is directly connected to +3V3. (screenshot below).
When all switches are off, I read and measure +0V on my pins. If I set one switch to active so it connects +3V3 to the MCU-Pin this pin reads a high and I can measure +3V3 with an osciloscope. The weird thing is now that I can also measure something between +1.7V and 2.9V on the other lanes, even though thex should be low and pulled down by the 10k resitor. I tried to work with the internal pull down of the mcu with the same results. I tried to configure 3 of the pins to output and set them to low. The remaining pin was set as input. After I switched the respective switch to high I got the same result and even the pins which should drive the lanes active low got some voltage somewhere between 1.7V and 2.3V.
I work on a custom board but all other functions like DAC, ADC, USART work fine and I have never had the situation that GPIO was an issue. I have already checked the bare PCB without parts for possible wrong connections between GND and 3V3 or any wrong or missing connections in the area of the DIP-switch. Seems alright and values and open lines are what I would expect.
I have already seen in the documentation that there is an SMPS versions of my MCU but from everything I can see and from everything that is printed on the MCU it should be the STM32H563VGT6 and the PCB layout matches to this controller.
I configured with CubeMX Version 6.13 and worked with CubeIDE Versions 1.16 and 1.17. Maybe there are some known issues somewhere that I missed?
Thanks in advance for any help
2025-01-22 03:00 AM
Once again: are you sure that the "lower" terminal of your pulldown resistors is actually connected to the ground? What happens if you physically remove the resistors and use internal port pulldowns?
2025-01-22 03:07 AM - edited 2025-01-22 03:08 AM
@gbmThe external pull-down resistors to ground are properly connected and they are the 10k. I double checked with a multimeter on two different PCB. And the whole ground and supply voltage network of the PCB seems ok as well. I checked with an oscilloscope. The levels of 3V3 and +15V look stable and the osci did not trigger any change of edge. I also measured GND to GND on several different places. It was all in the range of a few mV. Nothing out of the ordinary.To rule out the DIP switch we soldered it out and hard soldered a bridge to one of the paths, same problem.
Just as I am writing this there is one idea comming in my mind that we have not yet tryed: I am going to solder out the 10k resistors and the dip-switch so there really is only the one path with high and the other pins are let open with internal pull down. If I still can measure weird behavior it has to come from some internal connection between the pins on the port. If the beavior is right then there is a mayor problem on the schematics or the PCB.
@gbmI was just writing as you wrote yours ;)
@SofLitNow I have tried a firmware version where I set the internal resistors to pull up. The behavior is pretty much what I expectet but it does not make sense. If all switches are on I can measure 3V3 and the pins register high. That is ok. If all switches are off I can measure 0.7V and the pins register low. The 0.7 is around what I would expect with the internal pull up active so I think also OK. If only one of the switches is high and the others are low I get back to measuring something between 1.7V and 2.9V on the lines which should be at 0.7V. I do not understand were this voltage comes from.
2025-01-22 03:10 AM
Remove the resistors, keep the switch. For me it looks like 99% that some ground connection is missing, either for the resistors or one of MCU's GND pins.
2025-01-22 04:11 AM - edited 2025-01-22 04:25 AM
What's the MCU's actual supply voltage?
I would never connect any supply voltage to a GPIO directly, I'd put at least serial 100R in there somewhere.
And I support gbm's idea about the missing / bad GND connection.
We once had a PCB where someone gave the wrong net names to all internal GND planes, that was a mess...
PS: If somehow that GPIO bank A is not running from 3.3V but any lower voltage, then your results might make some more sense