Digilent Atlys Manuale di riferimento - Pagina 14
Sfoglia online o scarica il pdf Manuale di riferimento per Hardware del computer Digilent Atlys. Digilent Atlys 19. Circuit board
Atlys Reference Manual
USB HID Host
A Microchip PIC24FJ192 microcontroller provides the Atlys board with USB HID host capability.
Firmware in the MCU microcontroller can drive a mouse or a keyboard attached to the type A USB
connector at J13 labeled "Host".
Hub support is not currently
available, so only a single mouse
or a single keyboard can be used.
The PIC24 drives four signals into
the FPGA – two are used as a
keyboard port following the
keyboard PS/2 protocol, and two
are used as a mouse port
following the mouse PS/2
protocol.
Two PIC24 I/O pins are also
connected to the FPGA's two-wire
serial programming port, so the FPGA can be programmed from a file stored on a USB memory stick.
To program the FPGA, attach a memory stick containing a single .bit programming file in the root
directory, load JP11, and cycle board power. This will cause the PIC processor to program the FPGA,
and any incorrect bit files will automatically be rejected.
To access the USB host controller, EDK designs
can use the standard PS/2 core. Reference
designs posted on the Digilent website show an
example for reading characters from a USB
keyboard connected to the USB host interface.
Mice and keyboards that use the PS/2 protocol
use a two-wire serial bus (clock and data) to
communicate with a host device. Both use 11-bit
words that include a start, stop, and odd parity bit,
but the data packets are organized differently, and
the keyboard interface allows bi-directional data
transfers (so the host device can illuminate state LEDs on the keyboard). Bus timings are shown in
the figure. The clock and data signals are only driven when data transfers occur, and otherwise they
are held in the idle state at logic '1'. The timings define signal requirements for mouse-to-host
communications and bi-directional keyboard communications. A PS/2 interface circuit can be
implemented in the FPGA to create a keyboard or mouse interface.
Keyboard
The keyboard uses open-collector drivers so the keyboard, or an attached host device, can drive the
two-wire bus (if the host device will not send data to the keyboard, then the host can use input-only
ports).
PS/2-style keyboards use scan codes to communicate key press data. Each key is assigned a code
that is sent whenever the key is pressed. If the key is held down, the scan code will be sent
repeatedly about once every 100ms. When a key is released, an F0 key-up code is sent, followed by
the scan code of the released key. If a key can be shifted to produce a new character (like a capital
Doc: 502-178
page 14 of 19