Designer Reference Manual
USB08 Evaluation Board
54
Software Module Descriptions
MOTOROLA
Software Module Descriptions
the ground potential at the resistors via the port pins PTD[3..5]
(calibration cycle) and PTD[6] (measuring cycle).
Before the software of the ADC module can be used, the initialization
function initSADC() has to be called. In addition, the main timer is
required to run with 3 MHz (prescaler 0). The clocking of three impulses
per microsecond is the basis of the time measurement in this module.
The function responsible for the A/D conversion of one channel at a time
is getSADC(). The channel number (1..3) is handled as a parameter.
The A/D conversion is performed in the two mentioned steps: calibration
and measurement.
The desired 8-bit range for the results (values of 0…255) is a result of
scaling of the A/D output. In order to keep the run time of the necessary
division and multiplication operations small, the scaling function is
implemented using some in-line assembler directives.
A detailed discussion of the software A/D converter used here is
contained in the application note entitled Simple A/D for MCUs without
Built-in A/D Converters, Motorola document order number AN477/D.
This application note can be found on the World Wide Web at:
http://www.motorola.com/semiconductors/
3.11 RS232 Communication Module U08232.C
The RS232 communication module performs the sending and the
receiving of data to the host PC. The RS232 implementation is one of the
two possible alternatives. By the definition of the macro
USE_USB_PIPE in the main module
, it is possible to switch
from the RS232 version to the USB version of the communication
module.
Since the MC68HC908JB8 does not have a hardware serial
communications interface (SCI) peripheral module, an RS232
transceiver has to be implemented by a software-based SCI module.
Two general-purpose I/O pins are used as receiving and transmission
lines. The timing necessary for the desired baud rate is derived from a
time loop.
Содержание MC68HC908JB8
Страница 2: ...blank ...
Страница 6: ...Designer Reference Manual USB08 Evaluation Board 6 List of Sections MOTOROLA List of Sections ...
Страница 16: ...Designer Reference Manual USB08 Evaluation Board 16 List of Tables MOTOROLA List of Tables ...
Страница 42: ...Designer Reference Manual USB08 Evaluation Board 42 Hardware Description MOTOROLA Hardware Description ...
Страница 88: ...Designer Reference Manual USB08 Evaluation Board 88 USB08 Descriptors MOTOROLA USB08 Descriptors ...
Страница 243: ...blank ...