Hello,
Yes, I did happen to omit stack initialisation from the previous check list. This is so fundamental, it should be the first thing done on entry to the program, normally to set the stack pointer to "end of RAM". Symbolically, this is done with the following code -
org ROMStart
Startup_:
ldhx #RAMEnd+1
txs
...
Note that the value in the stack pointer will be one less than the H:X value.
A further essential item that was omitted from the check list, to set the reset vector to the start of your code. For an absolute assembly program, the following code should be present at the end of the .asm file -
org Vreset
dc.w Startup_
Of course, if the project requires use of other interrupt vectors, these should also be initialised in a similar manner.
For the following items, you should at least check whether the default register settings meet the specific requirements of the project.
System options:
SOPT1, SOPT2 registers
System power management:
SPMSC1, SPMSC2, SPMSC3 registers
ISC module:
ICS1, ICS2 registers
GPIO pins, port A:
PTAD, PTADD, PTAPE, PTASE, PTADS
GPIO pins, port B:
PTBD,PTBDD,PTBPE, PTBSE, PTBDS
In many instances, the default settings may suffice, but you will need to check anyway. Suitable initialisation of unused GPIO pins is just as important as for the pins that are used by the project, to prevent any input from floating at an indeterminate voltage level.
Regards,
Mac