2025-02-03 11:26 PM
Hello,
I am using the internal pull up for the input pins, but when read the port status using the program, it always reads 0 instead of 1. I expected it to read 1 and if make that pin grounded it shall read 0.
Solved! Go to Solution.
2025-02-04 03:28 AM
Yes I think the problem should be solved if you remove that 4K resistor
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-02-04 03:29 AM
I can see 5 problems with the "existing" version and 3 with the new one. In the schematic they are labeled as R and C. Remove all of them and you circuit will work.
2025-02-04 04:29 AM
I would say, check the datasheet of your MCU for the value range of the internal pull-ups, and check it through.
I see nothing wrong with reading a 0-value for an unactuated switch. You could just drop the pull-up configuration, as it is most probably pointless in this situation.
I think the aim of the whole exercise is to differ between actuated switch state (1) and unactuated switch state (0).
And that does most probably work.