Usb Communication Module U08Usb.c - Motorola USB08 Reference Manual

Universal serial bus evaluation board using the mc68hc908jb8
Table of Contents

Advertisement

Software Module Descriptions

3.12 USB Communication Module U08USB.C

Designer Reference Manual
56
disables any interrupts. Also, in an application with permanent interrupt
use, the software SCI should run in an interrupt-controlled way. Since
the receiving of a character is performed using port pin PTA7, the use of
the keyboard interrupt associated with this pin would be possible for the
recognition of the start bit. The timing for the scanning of the following
received data bits could be made using the available main timer (TIM) of
the MC68HC908JB8 as well as the sending of characters using the
PTC0 pin.
The USB communication module
can be exchanged between the microcontroller and host PC over an
USB connection. This module can be linked (alternatively to the RS232
communication module U08232.C) into the USB08 application when the
macro USE_USB_PIPE in the main module
Just like RS232, the USB uses serial streams for the data
communication. The substantially more complex operational sequence
of the USB can be encapsulated so that the integration into existing
projects is possible without problems. Therefore, the USB
implementation shown here is just as simple to manage for the firmware
programmer as the classical RS232 version. Only three interface
functions are needed:
initUSB() — initialization of the USB communication module
getUSB() — receiving a character
putUSB() — transmitting a character
The integrated USB peripheral module of the MC68HC908JB8 is
controlled using some control registers within the address range of
0x020 to 0x03F; the function initUSB() takes care of the initialization of
these registers. In addition, the status of the USB equipment is set to the
initial status (Powered) and the two software buffers which buffer the
sending and/or the receiving of data in the application are initialized.
If data should be received, the routine getUSB() is called by the
application. First, this routine stays in a waiting loop until data from the
Software Module Descriptions
U08USB.C
demonstrates how data
U08MAIN.C
USB08 Evaluation Board
is activated.
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mc68hc908jb8

Table of Contents