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.

Has anyone had problems with QEI affecting the rest of the CODE?

Status
Not open for further replies.

camerart

Well-Known Member
Hi,
I am using an 18F4431 with a QEI and an incremental encoder.
On it's own it works perfectly, and I use it for degrees so 0 to 359 then over to 0 again.

I've now added a second section for reading a GPS module, which also works ok, but when the QEI goes over 359, then it stalls the program.
Any ideas please?
Cheers, Camerart
 
Last edited:
Because you're writing (or copying) code with no idea how it works and this code could end up in a commercial device.

Very scary.

Mike.
Hi M,
The only CODE I copy is what is offered to me by forum members.

While I don't consider myself as a 'good' programmer, I do understand most of what I do, accepting that I forget some of it until dug out of my memeory again.

Over the years this has been developed, others have tidied it up for me, with Procedures, Functions and includes. In this case:
ADCON0
ADCON1
were in an include, which stopped the QEI working, but once returned to the main program it now works. I suspect timing or similar.

As for commercial use, I started this because I could't tell which way round my Tricoper was (even with coloured light) So it may be good in some ways :)
C
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top