Certain problems commonly occur due to the complexity of the C16x/ST10 microcontroller architecture. Check the following if your program hangs up or behaves strangely:
If your program runs in the µVision Simulator but not on your target hardware you may have problems with the initialization of the SYSCON and BUSCON registers in the STARTUP code. Carefully check to be certain that all parameters in the STARTUP code match your target hardware. In most cases, the hardware is not correctly configured.
Run a simple program on your target hardware before you try a complex application. Start with the HELLO program example provided in the \KEIL\C166\EXAMPLES\HELLO folder.
If your program runs in the µVision Simulator but not on your target hardware the linker memory classes for your ROM and RAM may not match your target system. Check the areas listed under MEMORY MAP in the linker/locator MAP file (*.M66) and verify that they match the memory configuration of your target hardware.
Make certain your code is not allocated to on-chip RAM (register or SFR area). Code allocated to on-chip RAM will not work in your target hardware. Select proper areas for the FCODE memory class with the linker's CLASSES directive. For example: