T
H
E
D
E
S
I
G
N
C
Y
C
L
E
This was good and bad.
The LED was blinking because
the CPU was being clocked. However,
since the PLL never locked, the PLL
clock was probably not running the
bus at the desired 7.3728 MHz. This is
great for randomly blinking LEDs but
bad for functions and peripherals that
require a stable and accurate timing
source.
It took me several hours to find
the problem. Do you see the very
obvious cause of the problem in
Listing 2? (A little Jeopary music
goes here.) The comment regarding
the value of the PPG register is correct but the actual value in the code
and the comment that precedes the
PPG register load instruction are
bogus. The PLL never locked
because PPG was loaded with 0x1E
instead of 0x66, which we calculated
by hand earlier. I edited the code
in Listing 2, changing the
setReg8(PPG,0x1E) instruction to
setReg8(PPG,0x66) and recompiled.
Upon running the Cyclone Pro
debug session, the PLL code was
executed indicating that the PLL
successfully locked and the little
snippet of LED blinker code didn’t
hang and performed just as I expected it to.
So, I can’t really complain. Hopefully,
that little bug will be fixed in an
upcoming patch or maintenance
release.
We still have all of the
MC68HC908MR16 peripheral subsystems to explore and that’s
exactly what we’re going to do next
month. There’s also more I need
to tell you about CodeWarrior
Development Studio for HC08 v5.0.
In the meantime, for those of you
that wish to build your own
MC68HC908MR16 MCU module,
I’ll make an inexpensive
MC68HC908MR16 MCU module
parts kit available to you on the
EDTP Electronics website at
www.edtp.com Be sure to check in
on my progress next time as I’ll
continue to show you how to
include the HC08 series of Freescale
microcontrollers in your Design
Cycle. NV
THE FUN HAS
JUST BEGUN
Okay, the MC68HC908MR16
MCU module is functional and we
have identified and squashed a bug
inherent to the CodeWarrior
Processor Expert code generator.
Hey, the CodeWarrior code is free.
SOURCES:
■ Peter Best can be reached via
email at the following address:
peterbest@cfl.rr.com
■ A complete kit of parts,
which includes a printed circuit
board with a mounted
MC68HC908MR16 MCU, can
be purchased from EDTP
Electronics, Inc. ( www.edtp.com).
February 2006 83