I had almost given up hope on this! Yesterday me and my son sat down and did some serious fault tracing. We even hooked up the logic analyzer and went thru the code, byte by byte. And we found 2 major things that will speed up the need for a new revision of the board.
- We had a tremendously stupid code mistake that will introduce incredible instability: we loaded the stack pointer wrong! I should be initialized with
lds #$E000
to set the pointer to 0xE000, but in some weird way the hash had gotten lost so it only said lds $EOOO. And since that memory is uninitialized anything could have gotten in to the stack pointer. - We could see some 10-15ns spikes in both BA, BS and the data lines, and in conjunction with that a failure to execute the program correctly. We could however only see this during a write operation, which leads me to believe it is some kind of reflection or voltage spike that occurs due to enabling the bus transceivers in the outward direction. And to hopefully solve that I have placed some weak pullups on the peripheral side of the transceivers.
This, and a lot of other improvements need to be tested before I can have a stable program execution. So therefore I need to order a new revision!
HOORAY for the Stage 3!