The previous log entry incorrectly stated that SP is initialised to 0000 on reset. This isn’t true - it is undefined - so it needs to be initialised too. Here is a sequence that will do this:
E1 11100001 POP HL F1 11110001 POP AF 31 00110001 LD SP,nn 31 00110001 E3 11100110 F6 11110110 OR n 76 01110110 76 01110110 HALT
Because LD SP,nn is executed after POP HL and POP AF, this code needs to be executed twice, which can be achieved by pressing reset a short time after power on. You can see above that the data bits are still a fairly simple function of the address bits. A 6PDT switch will be needed to switch between this sequence and the “memory program” sequence described in the first log entry.
So the complete sequence of steps required to bootstrap the system will be:
- Disable /OE on RAM with a manual switch
- Ensure 6PDT switch is set to ‘initialise’
- Start running host program on PC that sets up serial port (using fastest available baud rate) and sets RTS signal coming into the Z80 system to zero.
- Power on the Z80 system
- Wait for a second
- Press RESET
- Wait for a second
- Switch the 6PDT to ‘memory program’
- Tell the host program to run programming mode.
- When programming has finished, reenable /OE.
- Tell the host program to send a final NMI to start the Z80 executing from RAM.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.