21
Code Execution
•
Make sure ALL jumpers are set correctly according to your board’s configuration.
Read the hardware manual section on jumpers carefully if you’re not sure.
•
Always remember to remove the Programming Jumpers after programming the
code memory.
•
If you programmed your code into external EEPROM memory and it doesn’t run,
check the HC11 reset vector, located at $FFFE - $FFFF. These 2 bytes contain
the reset vector address where execution will begin when the unit is powered on or
reset. The default vector is E000, which is the beginning of the 8k program
address space.
•
Verify that all peripheral devices are initialized properly in your code. Failure to
initialize the serial port, for example, is a common problem. This is usually the
case when the code works under buffalo but not after programming.
ImageCraft C
•
Your make or build should create a .MAP file. Some versions change this to a .MP
file. At the top of this file should be a label __START. This is where you should
CALL or GO to when debugging in buffalo.
SMALLC Compiler
•
If you’re programming to ROM, delete the first line of the S19 record generated,
since SMALL.C adds data there.
•
Make sure you put the CODE, DATA, and STACK at the correct locations per your
memory configuration. DATA may need to be at 0000 if you’re burning a ROM,
and STACK should have plenty of room.
•
Don’t forget to use the -R option if you’re compiling for ROM.
•
If Internal Registers have been re-mapped (default at 0x1000) be sure to change
the #define REG_BASE accordingly.
•
If you’re having trouble with the shift operations (>> or <<) this is probably
because the small c compiler uses a rotate thru carry instruction here. Try using
inline assembly code to accomplish the shift.
•
You may have trouble returning any values larger than 1 byte from functions (i.e.
char functions). You will have to use global integer values instead.
•
Small C does not support structures or unions.
•
Small C is a free “un-supported” public domain compiler. If your application is
complex, consider purchasing a commercial quality 68HC11 C compiler.