Pmod JSTK Reference Manual

Note

The Pmod JSTK stock is retired and no longer available for purchase in our store. We recommend migration to the newer, pin-compatible version: Pmod JSTK2.

The Pmod JSTK (Revision C) is designed to be a versatile peripheral module that can be used in a wide variety of projects. It contains a resistive twin axis joystick that includes a center push button along with two additional push buttons. Also, Pmod JSTK has two programmable LEDs located on the board that can provide additional information to the user.

The Pmod JSTK is ideally suited for Digilent microcontroller or FPGA-based projects that required proportional control from the user, such as robotic applications.

Download This Reference Manual

Features

  • 2-axis resistive joystick with central push button
  • Two additional user push buttons
  • Two user indicator LEDs
  • 6-pin Pmod connector with SPI interface
  • Follows Digilent Pmod Interface Specification Type 2

Functional Description

The Pmod JSTK uses an Atmel ATtiny24 microcontroller in a MLF20 package to collect information about its peripherals. The twin axis joystick uses two potentiometers to measure the current position in the x and y coordinate directions and stores the information in two 10-bit values ranging from 0 to 1023.


Interfacing with the Pmod

The Pmod JSTK communicates with the host board via the SPI communication protocol in 5 byte chunks at a maximum clock speed of 1 MHz, with a recommended delay between the SS pin going low and the start of data transmission on the bus of 15µs. The minimum recommended amount of time between the end of one byte being shifted and the beginning of the next is 10μs. The first four bytes correspond to the two 10-bit values representing the X and Y coordinate directions and the last byte indicates the status of the three push buttons. Details on the organization of these bytes are provided a little further down in this document.

The Pmod JSTK will send its total of 23 bits of information to the system board through 40 clock cycles. The first two bytes received will consist of the 10-bit position of the potentiometer in the x-direction (with the Pmod arranged so that the pin header is facing “up”). The lower 8 bits of this 10-bit value will arrive MSB in the first byte and the remaining two MSB of the 10-bit value will arrive as the last two bits in the second byte.

Similarly, the 10-bit position of the potentiometer in the y-direction (with the Pmod arranged so that the pin header is facing “up”). The lower 8 bits of this 10-bit value will arrive MSB in the third byte and the remaining two MSB of the 10-bit value will arrive as the last two bits in the fourth byte.

The three bits representing the three push buttons arrive as the last three bits in the fifth byte where a '1' indicates that the button is pressed and a '0' indicates that the button is not being pressed. The organization of the button bits (as labeled on the silk screen of the Pmod) are arranged as follows in the fifth byte.

The overall order of bytes that will be sent by the Pmod JSTK to the system board will be as follows:

1 2 3 4 5
X (low) X (high) Y (low) Y (high) Buttons

As per the SPI protocol, the system board also needs to send five bytes of information to the Pmod. The first byte will contain information indicating if the two on-board LEDs should be turned on or off with the remaining four bytes ignored by the Pmod JSTK. The last two bits of the first byte sent indicate the status LED2 and LED1, respectively.

A pinout table for the Pmod JSTK is provided below:

Pin Descriptions for the Pmod JSTK
Header J1
Pin Signal Description
1 ~CS Chip Select (active low)
2 MOSI Master-Out-Slave-In
3 MISO Master-In-Slave-Out
4 SCK Serial Clock
5 GND Power Supply Ground
6 VCC Power Supply (3.3V/5V)

Table 1 Connector J1- Pin Descriptions as labeled on the Pmod

Any external power applied to the Pmod JSTK must be within 2.7V and 5.5V; however, it is recommended that Pmod is operated at 3.3V.


Physical Dimensions

The pins on the pin header are spaced 100 mil apart. The PCB is 1.8 inches long on the sides parallel to the pins on the pin header and 1.3 inches long on the sides perpendicular to the pin header.


Additional Information

The schematics of the Pmod JSTK are available here. Additional information about the Atmel ATtiny24 can be found at atmel.com.

Example code demonstrating how to get information from the Pmod JSTK can be found here.

If you have any questions or comments about the Pmod JSTK, feel free to post them under the appropriate section (“Add-on Boards”) of the Digilent Forum.