Page 1 of 1
Bi-phase rotary encoder
Posted: Thu May 22, 2008 12:31 pm
by jadiflow
Hello,
I need to inteface a rotary encoder to a PIC. I can bit-bang it, but I would like to know if there is a standard macro for such a component available?
TIA,
Jan Didden
Re: Bi-phase rotary encoder
Posted: Fri May 23, 2008 9:59 am
by Benj
Hello Jan
Some of the PICmicro chips have quadrature encoders built in as a peripheral. These can be used with flowcode via C code calls. Currently there is no component to utilize this hardware.
Other then this yes you will have to perform a bit banged interface.
Re: Bi-phase rotary encoder
Posted: Fri May 23, 2008 5:37 pm
by jadiflow
OK, thanks.
Jan Didden
Re: Bi-phase rotary encoder
Posted: Tue May 27, 2008 5:25 pm
by mytekcontrols
Not that I have a need for this at the moment (although I have used these in the past); a Quadrature Encoder Component seems like it would make a great addition to flowcode. Any plans to add one in the near future?
Edit: Just realized that this post might have been better posted in the "Components Other" section, since this isn't really a communication component (or is it

)
Re: Bi-phase rotary encoder
Posted: Wed May 28, 2008 1:50 pm
by Sean
We are working on quadrature encoder functions as part of a proposed, advanced motor control project. There are several possible techniques that avoid the requirement for a dedicated hardware interface module. These depend on the maximum frequency of the encoder signals and the availability of other device resources (timers, interrupts etc.)
It should be possible to make some development macros available in the very near future.
Re: Bi-phase rotary encoder
Posted: Sun Jun 01, 2008 10:10 am
by jadiflow
That would be nice!
Another, related, question: does Flowcode support the Interrupt-on-Change feature on some PIC ports? Or do I need to set the appropriate registers in C or ASM supplemental code?
Edit: answer found elsewhere: No
Jan Didden
Re: Bi-phase rotary encoder
Posted: Sun Jun 01, 2008 12:41 pm
by jadiflow
... and one more:
Using the switch macro to read a switch, you need to specify a variable WhichSwitch(byte). What does that signify? If I have switches A1...A8, and I want to read switch A3, do I use WhichSwitch = 2? 3?
If I define a variable SW3(byte), and give the switch also the label SW3, can I then use SW3 as variable to access the switch as well as the return variable name?
Jan Didden