Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Using rotary switch with a PIC16F877

Status
Not open for further replies.

abdullahbicen

Newbie level 2
Newbie level 2
Joined
Feb 10, 2006
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,295
I want to use 1 pole-12 ways rotary switch with a pic16f877 in my project. My problem is switch has a lot of pins and I don't want to use pic's pins in order to read switch's position. Is there another way of doing this?
 

Re: rotary switch

Hi,
Use two numbers of 74HC148 in cascade.
Regards,
 
Re: rotary switch

Or use a rotary encoder (requires 2 pins for the A and B encoder outputs)...

Mike
 
rotary switch

you could also use the ADC port
Connect the ADC port to a potentiometer, (center to adc port, max end to +5V and min end to GND)

Since you need 12 positions, each position change occur at intervals of 30 degrees.

or 1023/12= 85 bits (approx)

To get the position number, divide the ADC value (10 bit data) by 85, the result obtained (without approximation) will be the position selected.

arb
 
rotary switch

If you want to use Switch use 12 resitors and the ADC port
 
Re: Thank you all

Thanks for your help. I am planning to use two 74ls148. Since I am new to pcb design, I am not sure to use digital and analog parts on the same pcb.
 

rotary switch

you can use both
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top