i have to connect three digital pins A , B, C to either high or low voltages.
i am currently setting each pin to either 1 or 0 via dip switches and was planning to use a rotary switch for this but i am not understanding how they work.
I contacted a company e-swithes.com and they are asking me all kinds of questions which i dont know how to answer, e.g "2 or 3 terminal" , or "real of complimentary code"
.
can someone explain how can i interface these switches . I am attaching the switch and the specs.
thanks
With dip switches, there are two possible ways to connect it up.
You can connect the switch via a pull up resistor to ground, so that when the switch is closed "on" you get a logic low.
Or you can connect the switch common to +ve and have a pull down resistor, so that when the switch is closed "on" you get a logic high.
With these rotary switches you can do the same thing.
The common pin on the switch can be connected to either ground (with three pull up resistors) or to +ve (with three pull down resistors) and that will reverse the logic output.
You can use either type, real or complimentary, to get either polarity logic output.
The convention is:
Normal polarity, when the switch is at position zero, all three outputs will be open circuit (off).
Complimentary code, when the switch is at zero position, all three outputs will be connected to the common pin (on).
Those switches you show are BCD coded. One of the two separate pins will be the common. The three pins will be the A,B,C output and somewhere a D output. So for switch = 0, common not connected to anything, for SW = 1, A connected to common. For SW = 2, B connected to common. . . For SW = 9 common connected to A and D. If you want 1s out , connect common to Vcc, if zeros, connect common to 0V.
Frank
please take a look at this switch
how will I connect it to three pins that I want to set to either a 0 or 1 ?
what will I connect the common pin to in this case . 0 or 1 ?
I see what you mean , the data sheet is missing a lot of information. The only way to do it is to "buzz" it out your self. Do a sketch showing all the pins, number them (N).
So do N+1 number of columns, and 10 rows. Set switch to position "0", put the number of the "other" pin in the right place(s) in your chart where you get continuity between pins. i.e. if pos = 0, and P2 connects to P3, then put a 3 in the 2 column and and a 2 in the 3 column. Set switch to "1", repeat as before, do until you have captured all positions. After a few switch positions have been checked, a pattern will emerge, so you should not have to do them all.
Frank
There is no problem with the drawings of the switches. You have 1, C, 4, 2, 8 on the six pins. On the R93Y series there are 2 C pins that needs to be connected.
C = Common, 1,2,4,8 is the binary outputs, And you will only need to use 1,2,4 to get your 0-7 output code. The C(s) need to be connected, either to Vcc or GND depending on your choise of polarity of the code.