Section 7. Receiver Firmware; Firmware Structure - Motorola M68HC08 Designer Reference Manual

Hide thumbs Also See for M68HC08:
Table of Contents

Advertisement

Designer Reference Manual — DRM055

7.1 Firmware Structure

High Data Rate Wireless USB Optical Mouse Solution
MOTOROLA
Freescale Semiconductor, Inc.
The firmware consists of three main parts:
Main routine
Timer interrupt routine to capture and decode mouse data
USB interrupt routine
The USB routine includes reference codes for both universal serial bus (USB)
mouse and keyboard. Thus, it can be a reference on how to implement a
composite USB keyboard-mouse device using the JB12.
Figure 7-1
shows the flow of the main program for the JB12 receiver. The main
routine continually checks to see if there is any valid mouse data in the receiver
buffer queue. If there is new data received, the data will be converted to USB
report format and sent to the host via the USB endpoints.
Figure 7-2
shows the USB interrupt routines. The USB engine automatically
responds to a valid USB token with either ACK, NAK, or STALL, depending on
the register settings, and ignores it if it's invalid. The firmware has to set the
registers for the USB engine to give 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
7-3,
Figure
7-4, and
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 kind of control transfer and then does the
corresponding preparation for the next stage.
Receiver Firmware
For More Information On This Product,
Go to: www.freescale.com

Section 7. Receiver Firmware

Figure 7-5
show the routines handling control
DRM055
29

Advertisement

Table of Contents
loading

Table of Contents