Universal Serial Bus (USB) Interface
USB Implementation in the Reference Design
USB08 Evaluation Board
Designer Reference Manual
MOTOROLA
Universal Serial Bus (USB) Interface
65
4.5 USB Implementation in the Reference Design
The following paragraphs describe the implementation of the USB into
the reference design.
4.5.1 Activation of the USB Module
For initialization of the MC68HC908JB8 USB module, the user program
must call the initialization routine initUSB(). This routine writes all
registers with the same default values, which are present after a
power-on reset. Beyond that, the USB module is activated by setting the
bit USBEN in the USB address register UADDR.
In addition, the bit PULLEN in USB control register UCR3 is set resulting
in the internal pullup resistor at D-/PTE4 being activated if this option
was selected in the source code. For this, the macro USB_IPUE must be
defined as 1. Alternatively, it is possible to add an external resistor on the
USB08 evaluation board (see
Section 2. Hardware Description
).
4.5.2 Endpoint Configuration
The integrated USB module of the MCHC908JB8 supports three
endpoints. In addition to the mandatory bidirectional control endpoint
EP0, two unidirectional interrupt endpoints, EP1 and EP2, are available.
The data direction is always indicated from the view of the host. An
IN endpoint serves for the data transfer from the device to the host and
an OUT endpoint is used for the data transfer from the host to the device.
EP1 is always configured as an IN endpoint, since the MCU sends data
via this endpoint. The endpoint EP2 of the MC68HC908JB8 can be
Bit 7
6
5
4
3
2
1
Bit 0
Read:
USBEN
UADD6
UADD5
UADD4
UADD3
UADD2
UADD1
UADD0
Write:
Reset:
0
0
0
0
0
0
0
0
Figure 4-1. USB Address Register (UADDR)