Spartan-3E FPGA Rotary Encoder

Rotary Shaft Encoder

In principal, the rotary shaft encoder behaves much like a cam, connected to central shaft.

Rotating the shaft then operates two push-button switches, as shown in Figure 2-7.

Depending on which way the shaft is rotated, one of the switches opens before the other.

Likewise, as the rotation continues, one switch closes before the other. However, when the shaft is stationary, also called the detent position, both switches are closed

Figure 2-9: UCF Constraints for Rotary Push-Button Switch

NET “ROT_A” LOC = “K18″ | IOSTANDARD = LVTTL | PULLUP ;

NET “ROT_B” LOC = “G18″ | IOSTANDARD = LVTTL | PULLUP ;

NET “ROT_CENTER” LOC = “V16″ | IOSTANDARD = LVTTL | PULLDOWN ;

Each LED has one side connected to ground and the other side connected to a pin on the

Spartan-3E device via a 390? current limiting resistor. To light an individual LED, drive

the associated FPGA control signal High.

Figure 2-11: UCF Constraints for Eight Discrete LEDs

NET “LED<7>” LOC = “F9″ | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;

NET “LED<6>” LOC = “E9″ | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;

NET “LED<5>” LOC = “D11″ | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;

NET “LED<4>” LOC = “C11″ | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;

NET “LED<3>” LOC = “F11″ | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;

NET “LED<2>” LOC = “E11″ | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;

NET “LED<1>” LOC = “E12″ | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;

NET “LED<0>” LOC = “F12″ | IOSTANDARD = LVTTL | SLEW = SLOW | DRIVE = 8 ;