|
Adapt812 Frequently Asked
Questions
The 68HC812A4
doesn't do PWM, right?
The '812A4 may not be advertised
as doing PWM, but PWM can be generated on up to seven channels with no
CPU overhead. Here's how to do it:
Set CH7 to the PWM period and use the
channel7 reset function to reset the timer counter
The compare values in 0C0-OC6 will now
give a PWM output as desired.
Why can't I get the
COP watchdog function to work on my board in single-chip mode?
In normal modes, the COPCTL
register is designated as "Write-Once". The firmware bootloader residing
in the top 256 bytes of EEPROM is the first thing that gets executed following
reset in single-chip mode. It clears the COPCTL register, so any
subsequent write to the COPCTL register by your code will be ignored.
If you have a BDM pod, you can use DBug12 to load in a modified version
of the bootloader, which doesn't disable the COP. Of course, it has
to service the COP to prevent a timeout. (Contact us if you would
like a copy of the bootloader source code to modify.)
In expanded modes, the EEPROM is
located at $1000 following reset, so the firmware bootloader goes away
(ie. it's not in the vector space). So the MCU fetches the Reset
Vector directly from external memory (ie. Flash) upon reset. Your
program should include a pointer there to the first instruction of your
code. You are free to write to the COPCTL register at the beginning
of your program.
How do I set up a
DBug12-based BDM pod to use with my Adapt812 board?
-
Plug your BDM ribbon cable into the
BDM connector on your 812 board ("the target")
-
Set the target board jumpers/switches
to Single Chip Mode (ie. MODA=MODB=0). The position of the BOOT/RUN
switch doesn't matter, since it is only used by the bootloader
-
Supply power to your target board only
(not the BDM pod)-- the BDM pod will get the 5V it needs via the ribbon
cable
-
Use any terminal program at 9600 baud,
with the BDM pod connected to your PC's COM port
-
Type device 812a4
Loading your program into EEPROM (Single
Chip Mode):
-
mm f1 0
-
bulk
-
baud 1200
-
load
Then use the ASCII file transfer feature
of your terminal program at 1200 baud to send the s-record file to be programmed
|