1300 Henley Court Pullman, WA 99163 509.334.6306 www.digilentinc.com PmodENC Reference Manual Revised April 12, 2016 This manual applies to the PmodENC rev. A Overview The Digilent PmodENC features a rotary shaft encoder with an integral push-button to provide multiple types of outputs. The module also includes a sliding switch that is commonly used as an on/off output. An encoder is commonly used in freely rotating volume knobs to detect how many clicks a knob has been rotated. Features include: Rotary push-button shaft encoder Add multiple types of user input to host board or project Additional static slide switch Small PCB size for flexible designs 1.5 in 0.8 in (3.8 cm 2.0 cm) 6-pin Pmod port with GPIO interface Follows Digilent Pmod Interface Specification Type 1 Library and example code available in resource center The PmodENC. 1 Functional Description The PmodENC utilizes a rotary shaft encoder as a way for users to quickly switch between multiple options such as choices shown on a screen or predefined motors speeds. An integral push-button on the shaft as well as a slide switch allow for a highly configurable Pmod. 2 Interfacing with the Pmod The PmodENC communicates with the host board via the GPIO protocol. It provides four inputs to the system board the two buttons internal to the encoder that are in quadrature with each other as well as the integral push button on the shaft and the slide switch. A system board will read the integral push button and the slide switch at a logic low voltage in their native (or off in the case of the switch) states. Copyright Digilent, Inc. All rights reserved. DOC : 502-117 Page 1 of 3 Other product and company names mentioned may be trademarks of their respective owners. PmodENC Reference Manual The two internal buttons are both natively pulled to a logic high level through a pull-up resistor. As the two buttons are located 90 degrees from each other (i.e. in quadrature), while the shaft is rotating one button will be pulled to a low logic level voltage before the other button. Figure 1. Rotary shaft encoder circuitry. Users can program their system boards to determine which button was pulled low last (within a small time frame to ensure additional clicks are not also captured) in order to figure out which direction the shaft is being rotated. Switch Chatter Rotate Right A B Rising edge of A first, then B is decoded as a rotate right Figure 2. Timing of outputs A and B. 2.1 Pinout Description Table Pin Signal Description 1 A Output of button A in the encoder shaft 2 B Output of button B in the encoder shaft 3 BTN Output of the integral push button in the encoder shaft 4 SWT Output of the on board switch 5 GND Power Supply Ground 6 VCC Positive Power Supply (3.3/5V) It is recommended that Pmod is operated at 3.3V or 5V, although because there are no integrated circuits on the Pmod, any voltage that your system board can handle as a digital input will work fine. Copyright Digilent, Inc. All rights reserved. Page 2 of 3 Other product and company names mentioned may be trademarks of their respective owners. Detent