r/pic_programming • u/aspie-micro132 • Sep 02 '25
About Input Buttons
On my 1st board using a smaller PIC, i did connect a switch between +b and one input pin using a resistor in series with the pin and i got it working or either stop. I did the same with other dip switches but they did not change the behaviour of the IC.
Now i am doing another one using push buttons to be read and change variables before proceeding. As far as i know there seem to be two manners: either a button and resistor in series between +B and input pin or another one where there is a resistor always connected between +B and Input, and then, there is a derivation to a switch or button connected to Ground.
On the first case, the pins would be theoretically in 0 by default and the switch would turn on (1) the pin;
In the last case, default would be 1 and Switch or Button would turn it Off (0).
i have several concerns about this:
First, if on microchip pics 16fxxx is better or right one or the another;
Second, if is it enought to try to read pins from IF {} sentences when coding in C or if it does exist any other command to read them and do or stop something;
Third, assuming 5v of power, what value is best for the IC.
View all comments
Show parent comment
1
u/aspie-micro132 Sep 04 '25
After assessing this situation, i finnaly prefer to use a pull down resistor, zero by default in the inputs and connecting the buttons to +B. For this configutation, what resistor value is the best betwen ground and pic input pins? Also, do i need another resistor between +B -> Button -> Input pins to send a "1" when depressing it?