
Designer Reference Manual USB08 Evaluation Board
52 Software Module Descriptions MOTOROLA
Software Module Descriptio ns
NOTE: It has to be pointed out for com pleteness, that with the KBI module o f the
MC68HC908JB8 not only single keys but also extensive key fields in
matrix arrangement can be easily scanned.
3.9 LED Control with U08LED.HControlling the three light-emitting diodes (LED) attached to port D is
easy. For initialization, the data direction of the used port pins PTD[0 ..2]
has to be switched to an output state. The initialization as well as the
switching of the LEDs is performed via four macros. Therefo re, a header
file is enough for the realization of these functions. A special C module
is not required in this case.
The LEDs are addressed, beginning with a 1. The switching on of the
first LED (at PTD[0]) takes place, for example, by means of:
onLED(1);
3.10 Software ADC Module U08ADC.CAlthough the MC68HC908JB8 does not have an integrated ADC, it is
nevertheless possible to measure analog values (and in particular
resistance values) in a simple way. For this purpose, a n RC combinat ion
is attached to a conventional digital port pin and the load time of the
capacitor is measured. The working principle is shown in Figure 3-2.
Figure 3-2. Measurement of Resistor Values Using a Digital Input
VCC
R
C
GND
S
E