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.

interface for PIC microcontroller?

Status
Not open for further replies.

engkeat

Junior Member level 1
Joined
Aug 18, 2008
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,409
interface rotary encoder microcontroller

i am using a rotary encoder as a feedback of motor speed to PIC microcontroller(PIC-16f877A), the output of the encoder is in the form of open collector output, do i need any interface for connecting the encoder to I/O pin of the PIC? thanks for guidance, i m new to PIC
 

using rotary encoder pic microcontroller

Hi engkeat,

I did something similar with an optical encoder off of a wheel. I had both an A & B channel that I combined together with logic gates before sending them to a PIC input. I also setup a system of logic the required both channels to be operating to gate the other channel through to the PIC. This way if I lost one channel I would get no feedback at all. Otherwise you would get only half the information and adjust the motor speed based on only half the information and not know the thing was broken. Better to loose everything and flag an error. To your question :
you should be able to input directly with the open collector if you wish.

Regards

Dfullmer
 

i m using only A channel as i m not concern on the direction, may i know the purpose u combine the channels with logic gates? to increase to resolution? when i test the encoder with oscilloscope, there are pulses appear, but with lots of interference as well in sinusoidal form, is there anyway to get rid of those interference? or it's the sign of the encoder is not in well condition? thanks for ur reply
 

Depends on the application. If you can stand a slower rising edge you can filter the signals with some capacitance. Maybe start with a .01 uf and see how it behaves. You could also try a stronger pull up depending on the current source capability of the encoder. Any time you have noise you can shield, filter or lower the impeadance to source or ground to try and eliminate. The sinusoidal information bothers me. It may be an artifact of your measurement. Maybe the scope probe isn't grounded well.

Good luck let me know what you find.

Regards

dfullmer
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top