PS2 Joystick Demo

<< Click to Display Table of Contents >>

Navigation:  STM32F4 Target > Demos > Standard Peripherals Demos > SPI >

PS2 Joystick Demo

Previous pageReturn to chapter overviewNext page

demo File: ps2_joystick_demo.mdl

ps2_joystick_demo_mdl

Description

The demo showing how to use SPI module to interface with PS2 joystick.

SPI Configuration

ps2_joystick_demo_spi_mask

SPI configuration:

Data format, 8bit and first bit is LSB.
SPI clock frequency is 164.063kHz (Note: we tried to increase the speed but the reading value seem not stable).
Clock polarity low and data capture on 2nd edge.

Hardware Setup

The demo test with following hardware:

F4DISCOVERY
aMG F4 Connect board 2
aMG CLCD 2

ps2_joystick_demo_hw1

Pin-out of Joystick adapter

A simple connection for pin adapter.

ps2_joystick_demo_hw2

Testing

Push the button on Joystick and observe status on LCD. When button pressed, status will be 1.

ps2_joystick_demo_test2

ps2_joystick_demo_test1