Difference between revisions of "Unknown Year, 5.2L MC68HC16Z2 Initialization Code Overview"
From JTEC_PCM
(Added more initialization) |
m |
||
Line 30: | Line 30: | ||
* 0x2001E Write 0xB4 to SYPCR | * 0x2001E Write 0xB4 to SYPCR | ||
− | + | Enabled Watchdog | |
− | + | Turned off scaling | |
− | + | Set timeout to 2 to the 15th | |
Line 41: | Line 41: | ||
* 0x2002A Wrote 0xAA to SWSR | * 0x2002A Wrote 0xAA to SWSR | ||
− | + | Writing 0x55 then 0xAA to SWSR pets the watchdog |
Revision as of 09:26, 2 March 2012
- Reset Vector = 0x0
First byte of reset vector = PK (Program Counter Extension)
Second byte of reset vector = SK (Stack Pointer Extension)
Third byte of reset vector = ZK (Index Z Extension)
PK = 0x01
SK = 0xFF
ZK = 0xFF
Initial PC = 0x0 | PK = (0x10000)
- 0x10000 Jump to 0x20000
- 0x20002 Wrote 0xFF to SK
- 0x20004 Wrote 0xFF to ZK
- 0x20006 Wrote 0xF8FE to SP
- 0x2000A Wrote 0xF800 to Z
- 0x20010 Wrote 0x00 to EK, XK, & YK
- 0x2001E Write 0xB4 to SYPCR
Enabled Watchdog
Turned off scaling
Set timeout to 2 to the 15th
- 0x20024 Wrote 0x55 to SWSR
- 0x2002A Wrote 0xAA to SWSR
Writing 0x55 then 0xAA to SWSR pets the watchdog