Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Quick question about QEI module of PIC18F2580

Status
Not open for further replies.

Cantafford

Member
Hello I have a quick question about the QEI module. I want to use it but I cannot find it in the PIC18F2580 datasheet(the pic i'm using).
Now is it possible that this PIC does not have QEI module or can it have another name? Please excuse my beginner question. Thanks.
 
Who knows?

It would help if you told us (me) what a "QEI module" is.

JimB
 
hi,
Please post the datasheet for the 18F2850.

I use the the 18F2431 , see attachment.
E
 

Attachments

  • 18F2431 quadrature.pdf
    218.4 KB · Views: 296
Hi C,
I do not see a QEI module in that 18F2850 PIC.
Look at the pic 18F2431 for QEI

Eric
 
Last edited:
Yeah I suppose I could just use another PIC. Or read the speed using another method.
hi,
Is the motor shaft already fitted with an encoder disk.?
Also are you trying to read CCW and CW rotation.?
E
 
If you do not need direction information you could XOR the A & B signals from the endoder then feed the output of the first XOR gate to a second XOR gate. The output of the first gate goes directly to one input of the second gate and also to the second input of the second gate via resistor. There is also a small capacitor to ground from the second input to produce a small delay. The result is a short pulse on every transition of either A or B encoder input.
This is the method I use on the table feed on my milling machine. (The serial port connections are used to set the PID gain values.)
Speed_control.png

Les.
 
If you have the encoder and it has an index pulse, And you only need RPM, not position or direction, then the marker could be used in simple tachometer mode with a CCP capture module etc.
Max.
 
If you have the encoder and it has an index pulse, And you only need RPM, not position or direction, then the marker could be used in simple tachometer mode with a CCP capture module etc.
Max.
Yes I think this is the way I will go with. I need just want the RPM value for now.
 
What's the problem with reading timer0??? Did that not work? When I test it in simulation is worked okay!
I have taken a few days off that project to read about timers, CCP and other features of the ucontroller as I was not very familiar with them. Among those I read about the QEI module which seemt like a very easy way to get the speed and direction of rotation. So I just wanted to give it a try but there was no such module on my PIC. :D I will get back on that project tomorrow. Will let you know in the other thread.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top