EmbDev.net

Forum: FPGA, VHDL & Verilog Use of rotary encoder in Spartan 3E


von Nirav B. (Company: Uvic) (nirav_bhatt)



Rate this post
useful
not useful
Hello everyone,

I have generated four signals/output (G1, G2, G3 and G4) using the 
attached code. G1 and G2 are out of phase while G3 and G4 are out of 
phase. At present, the requirement of the code is to give a variable 
phase shift between G1 and G3 as shown in the attached figure. I am able 
to achieve the phase shift using the code by manually changing inputs, 
reprogram, load and run. But it is taking too much time for the 
experiment.
Could I be able to use the rotary encoder on Spartan 3E board to change 
the phase shift? If anyone can help me with the code, it would help my 
project a lot.
I can provide more information as required.

Thank you
Nirav

von Duke Scarring (Guest)


Rate this post
useful
not useful
Nirav B. wrote:
> Could I be able to use the rotary encoder on Spartan 3E board to change
> the phase shift?
I think: yes

You could write code which detect edges on the rotary encoder and count 
up or down a counter value.

This counter value can be used in your code to set the phase shift.
Btw. what is the minimum and maximum phase shift you need?
What resolution is acceptable?

Duke

von Nirav B. (Company: Uvic) (nirav_bhatt)


Attached files:

Rate this post
useful
not useful
Thank you for getting back on this Duke.

Yesterday I tried to work on the code by giving a "phaseshift" integer 
in the code and introduce in the output condition statement of G3 and 
G4. Initially, I thought of using a potentiometer with the board but the 
code worked in a funny way, G3 and G4 does not go high on the expected 
count.

The phase shift shall be minimum zero degree and maximum 180 degrees 
between G1 and G3. While G1 and G2 are out of phase and G3 and G4 are 
out of phase. The resolution can be of 1 degree.

If you could help/direct me how to proceed with the code, it would be a 
great help for me.

Thank you

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.