
Chapter 2: Switches, Buttons, and Rotary Knob
R
chatter can falsely indicate extra rotation events or even indicate rotations in the opposite
direction!
Rotating RIGHT
Rising edge on ‘A’ when ‘B’ is Low indicates RIGHT (clockwise) rotation
Switch opening chatter on ‘A’
injects false “clicks” to the RIGHT
A
B
Switch closing chatter on ‘B’
injects false “clicks” to the LEFT
(’B’ rising edge when ‘A’ is Low)
UG230_c2_07_030606
Figure 2-10: Outputs from Rotary Shaft Encoder Might Include Mechanical Chatter
UCF Location Constraints
Figure 2-11 provides the UCF constraints for the rotary encoder/push-button switch,
including the I/O pin assignment and the I/O standard used, and defines a pull-up or
pull-down resistor for each FPGA input.
NET "ROT_A"
NET "ROT_B"
LOC = "T13" | IOSTANDARD = LVTTL | PULLUP
LOC = "R14" | IOSTANDARD = LVTTL | PULLUP
;
;
NET "ROT_CENTER" LOC = "R13" | IOSTANDARD = LVTTL | PULLDOWN ;
Figure 2-11:
UCF Constraints for Rotary Push-Button Switch
Discrete LEDs
Locations and Labels
The Spartan-3A Starter Kit board has eight individual surface-mount LEDs located
immediately above the slide switches as shown in Figure 2-12 . The LEDs are labeled LED7
through LED0. LED7 is the left-most LED, LED0 the right-most LED.
30
Spartan-3A FPGA Starter Kit Board User Guide
UG330 (v1.3) June 21, 2007