Javier Valcarce's Personal Website

Main | Private | Templates | MediaWiki | Categories | Special pages | Upload |||| XHTML 1.0 Strict? | CSS?

Interface PS2

From JavierValcarce.Es

You are at: Home > Hardware > Interface PS2
Jump to: navigation, search
Summary
This VHDL macro is intended for interface PicoBlaze with a PS2 keyboard or mouse, the macro is only a receiver (device to host direction).

VHDL Macro

xc3s400-4ft256 utilization
Element Used
Slices 28
Flip-Flops 44
LUTs 31
Bonded IOBs 13
Global CLKs 1
Max Freq. 178.859MHz
component interface_ps2 
  port (
    reset   : in  std_logic;
    clk     : in  std_logic;
    kbdata  : in  std_logic;
    kbclk   : in  std_logic;
    newdata : out std_logic;
    do      : out std_logic_vector(7 downto 0)
    );
end component;


Ports and Usage

Port DIR Type Description
reset Input signal Asynchronous reset
clk Input signal Clock signal, must be x4 faster at least than kbclk
kbdata Output signal Serial PS2 data
kbclk Output signal PS2 clock (~15kHz)
newdata Output signal One clk cycle pulse, to raise an interrupt in PicoBlaze
do Output 8-bit bus Byte read from PS2 device

When a new data is available in do, a pulse (one clock cycle pulse) is present at newdata signal notifying the host circuit to transfer the octet to a FIFO buffer or something else. System clock clk must be faster (x4 or more) than kbclk (kbclk is about 15kHz, see References).

Block Diagram And Control State Machine

This article or section is still a stub. Este artículo o sección es todavía un esbozo.

Simulation

Cronogram in ModelSim for transmision of character 0x0F from keyboard to host Image:Interface ps2 crono.png

Download

Files:

References