cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5G7VJT6Q GPIO Input issue

NIVI
Associate III

Hi,

I'm using the STM32U5G7VJT6Q microcontroller to read input from a few switches. All switches should show a high state when unpressed (due to the pull-up resistor) and a low state when pressed (grounded).

However, one switch is acting strangely:

  • When it's unpressed, it stays in a low (reset) state, but it should be high.
  • It only changes to high when another switch is pressed.
  • The other switches are working fine.
  • The switch is connected in the following order: TVS diode -> Pull-up resistor -> RC filter -> GPIO pin.
  • The GPIO pins are set as inputs with internal pull-ups enabled.
  • The wiring looks correct, and the pull-up resistor is in place.
  • The other switches behave as expected.
  • Tried removing the tvs diode and capacitor in rc as well, still the same behavior occurs

Note: No input of the switches are shorted or grounded, the behavior is observed in all the boards we fabricated.

Questions:

1) What is the possible cause for this behavior?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

I took your .ioc and created a new project.

This is how your GPIO are setup.

mbarg1_0-1738772329908.png

There is no pull up selected and inputs are driving interupts !

Any noise is detected.

These inputs acr CMOS, that means that they can take any state (thanks to internal capacitative coupling) of any internal register or signal line.

 

View solution in original post

4 REPLIES 4
mbarg.1
Senior

I beleve nobody has a glass ball handy ...

You must include at least an ioc file to give you some useful hint.

By sure, there is some problem in configuration, but listing dozen of possible reasons would not help.

Also include versions of IDE, FW, and any other useful info on yuor project - and somebody will try to help you.

Hi mbarg,

Attached the IOC file as suggested.

IDE Version used is IDE 1.16.0

NIVI_1-1738718720246.png

The issue is with Tog_down_sw. it is in floating state even when pulled up both internally and externally (no other passive components inbetween). when tog_up_sw is pressed tog_down_sw goes low.

please list the possible cause.

I took your .ioc and created a new project.

This is how your GPIO are setup.

mbarg1_0-1738772329908.png

There is no pull up selected and inputs are driving interupts !

Any noise is detected.

These inputs acr CMOS, that means that they can take any state (thanks to internal capacitative coupling) of any internal register or signal line.

 

Hi,

The issue is resolved by setting UCPD_DBDIS = 1 in the PWR_UCPDR register.

By default, in reset mode, it behaves like the above way I mentioned. Now it works good

As mentioned in the datasheet.,

NIVI_1-1738910545615.png

Thanks for the help!!!!