Motorola M68HC08 Designer Reference Manual page 23

Usb and ps/2 multimedia keyboard interface reference design
Hide thumbs Also See for M68HC08:
Table of Contents

Advertisement

1.5.10 USB Main Routine
DRM014 — Rev 0
MOTOROLA
Freescale Semiconductor, Inc.
Figure 1-11
shows the USB main routine. The routine scans the
keyboard every 40ms. If there are keys pressed or released, it puts the
key codes into a buffer and prepares the input reports for the keys
through endpoint 1 or endpoint 2. If the USB bus idles for more than
6ms, the routine puts the MC68HC908JB8 into STOP mode until it
detects a resume signal from the host or any key pressed for remote
wake-up.
Figure 1-12
shows the USB interrupt routines. The USB engine
automatically responds to a valid USB token with either ACK, NAK, or
STALL, depending on the registers setting, and ignores it if it is invalid.
The firmware has to set the registers for the USB engine to give a correct
response to the token in different stages. The USB interrupt will be
executed whenever there is an EOP, resume signal from host, valid data
received or data transmitted. The USB interrupt routine also makes
preparation for the next USB transaction and handles any valid
command or data received.
Figure 1-13
to
Figure 1-15
Transfers. Control transfers have two or three transaction stages: Setup,
Data (optional) and Status as shown below:
Control Write: SETUP, OUT, OUT, OUT... IN
Control Read: SETUP, IN, IN, IN... OUT
No Data Control: SETUP, IN
The firmware first distinguishes the kinds of control transfers and does
the corresponding preparation for the next stage.
USB and PS/2 Multimedia Keyboard Interface
For More Information On This Product,
Go to: www.freescale.com
USB and PS/2 Multimedia Keyboard Interface
show the routines of handling the Control
Firmware Description
Designer Reference Manual
23

Advertisement

Table of Contents
loading

Table of Contents