
HC908
Application Note #9
Programming &
Operating Cautions

This page describes specific actions or
conditions that will cause the need for reprogramming of the HC Monitor program.
The HCmon debug monitor program comes preloaded
on the daughtercard and resides in upper memory. (See Memory Map.)
This area is well away from the application code area that holds the various
custom programs of interest, such as Exerciser, VFO, Keyer, Commander, Antenna
Analyzer, etc. Since HCmon is integral to the loading and programming of
new user programs into flash memory, anything that messes up HCmon will prevent
you from continued use of the daughtercard.
If you do not heed the following cautions,
you'll likely need to send the daughtercard back for reprogramming. (Homebrewers
outfitted with HC908 programming hardware such as the Mon08 cable/dongle from PE
Micro may perform the HCmon re-programming on their own, of course.)
- Do not attempt
programming of HCmon via the 'Load' command --
The HCmon debug monitor cannot be programmed into Flash memory by means of
its own 'Load' command. HCmon may only be burned into flash memory by means
of special hardware programming cable/dongle such as the PE Micro's
"Mon08" device or the "ICS08 Developer Board".
- Do not interrupt the
daughtercard during the HCmon 'Load' sequence --
If, during active Loading of a new user application, you reset the
daughtercard, interrupt system power, disconnect the serial cable, or
otherwise interrupt the data flow of the new software, the data being burned
into flash memory will likely be corrupted. This could cause
- Do not define
constants, strings, etc within in the HCmon memory space --
Attempting to define strings, constants or otherwise trying to place
executable program code within the memory space reserved for HCmon will
likely corrupt HCmon and prevent normal operation from there onward.
- Do not develop a user
application program that extends into HCmon memory space --
The maximum size of a user software application (i.e., the software programs
we write starting at $8000) is about 30 kilobytes. That's a big user program
space, but if your program grows and extends higher than $E0FF, you will
corrupt the bottom area of HCmon program and the daughtercard will require
reprogramming of the monitor.
- Be sure to include
the software hook for 'HCmon_LCD_Display' routine in all application
programs -- A
"software hook" is utilized to allow HCmon to display an initial
message to the LCD (See App Note #10). If that hook in the user
program (at $803C) is not maintained, or if it is overwritten or
significantly modified, the start-up sequence for the daughtercard will be
blocked and the system will hang.
- In HCmon, do not
'Clear' flash memory without immediately performing a 'Load' of another user
program -- The normal sequence
of operations in loading a new software program to user memory space using
HCmon is to 'Clear' the current application space ($8000-$E0FF) and then
'Load' the new program. If the new program is not loaded, the 'software
hook' is not placed where HCmon expects to see it in user space ($803C) and
the system will not proceed past the barest of initialization the next time
the system is power cycled or reset. Always include the software hook in
place
- Don't forget to
configure the terminal program (TeraTerm) with a 5ms pacing delay for each
character -- As instructed in
the TeraTerm section of the user manual, it's necessary to configure a 5
millisecond 'pacing' delay to occur after each data byte is sent to the
daughtercard during the 'Load' operation. This delay accounts for not
having hardware flow control in the serial link and ensures that the flash
programming sequence in HCmon has enough time to complete before another
data byte is received. If the pacing character is not configured to be at
least 5ms, data overrun will be experienced on the daughtercard which will
result in improper/incomplete programming of the new user software
application.
- Be careful to only
"Load" an S Record file into the daughtercard --
Only files with an extension of ".s19" may be burned into user
application memory space on the daughtercard. The S Record file contains
specific address and checksum information to ensure proper programming of
flash memory, and if a different file is selected by mistake (e.g., an .asm
file), the boot loader may be instructed to program data into illegal areas
of memory space.
Although this list of "cautions" may
seem daunting, most are common sense and are rarely encountered during normal
operation. After you get a feel for using the daughtercard and its
software tools, safe operation becomes second nature. .

Last Modified: April 20, 2003