2025-02-03 09:13 PM
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:
Note: No input of the switches are shorted or grounded, the behavior is observed in all the boards we fabricated.
1) What is the possible cause for this behavior?
Solved! Go to Solution.
2025-02-05 08:22 AM
I took your .ioc and created a new project.
This is how your GPIO are setup.
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.
2025-02-03 10:21 PM
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.
2025-02-04 05:27 PM
Hi mbarg,
Attached the IOC file as suggested.
IDE Version used is IDE 1.16.0
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.
2025-02-05 08:22 AM
I took your .ioc and created a new project.
This is how your GPIO are setup.
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.
2025-02-06 10:43 PM
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.,
Thanks for the help!!!!