Homebrew Mini-Computer based on Z80 CPU

armandoacostawong@gmail.com

:: "Wrong Step" compromises project schedule

12/21/2010

This is the expected behavior:

The operator actuates the STEP switch up (active). If the machine were running at that time, it will fall into Halt mode immediately. Now the Operator has time to examine the memory for debugging or whatever he/she wants to do while the machine is halted.

Eventually, the Operator presses the CONT button. As soon as the button is pressed, the microprocessor executes the next instruction after which the machine halts again automatically... the Operator had had no time for releasing the button so at this point in history the Operator's finger is still on the button and the machine is already in full Halt.


That is not exactly what is happening. I press the button and the machine resumes execution, find, but it doesn't stop immediatelly but continues to run instead as long as my finger keeps pressing the button! --This is not what we can call "single step"... obviously!

This misbehaviour is caused by the logic itself which was designed --I have to confess-- very badly.


In fact, the HALT F-F (U5) gets reset (pin 13) when the HLT button is pressed (as well as when the reset signal is generated but that is another story). The FF output makes a bus request (BUSRQ) to the microprocessor, meaning that the machine is now in Halt mode. This is find.

Eventually, I press the CONT button and the F-F gets set (pin 10). The F-F output goes high so releasing the BUSRQ. The machine has exited Halt mode and now is executing the next instruction. This is find too.

The microprocessor's M1 signal is generated and it reaches the F-F clock (pin 11) because the AND (U6) is "open" since the STEP switch is in active position so putting a logical high at pin 9. This M1 signal clocks the F-F (pin 11) so the D value (ground) passes to the output, which is equivalent to reset the F-F. Now the output must be low and a new BUSRQS is supposed to be requested to the microprocessor, completing the "step" this way.

That simply don't happen, because the F-F remain in set condition as long the pin 10 remains low and that is exactly what happens while my finger is still pressing the button.

A lesson to my self

Logic must be tested separately before assembling the whole board. Simulation could helps in this respect, as a couple of international friends had suggested already.

Anyways... the fact of the matter is that all that part of the circuit must be dismantled, redisigned and built again. This has priority over the Console Controller design, hence the "schedule" has been compromised... I mean... I was hopping to finish this by my birthday which is in February.