Quote:
Rob, you are so productive in you microprocessor designs! I don't know how you can keep multiple ones going.
A lot of block copying, practice, and learning from prior mistakes (experience).
This problem has me stumped good. The system hangs only if an attempt is made to invoke EnhBASIC, otherwise the system runs smoothly. I traced a problem to the system’s OutChar() routine which is run when EnhBASIC tries to display the startup message.
In the OutChar routine below, storing the acc to the LEDs shows an incorrect value and the system hangs.
Code:
OutChar:
PHP
REP #$30
PHX
PHY
LDX #0
STA $5:$7000
JSR (OutputVec,x)
PLY
PLX
PLP
RTS
However, storing acc to LEDs one instruction sooner displays the correct value and the system still hangs.
Code:
OutChar:
PHP
REP #$30
PHX
PHY
STA $5:$7000
LDX #0
JSR (OutputVec,x)
PLY
PLX
PLP
RTS
It looks to me like the LDX instruction might have some sort of side-effect. If .X were to be corrupted somehow then the following indexed indirect jump wouldn’t work properly. But the problem is only present when EnhBASIC is invoked. I can’t see any errors in the Verilog code. LDX # is pretty straightforward.
I had to slow down access to the BASIC rom to get rid of the bit error. (ROMs are begin accessed at only an 8MHz rate with wait states inserted). The core is using a cache however and runs at 33MHz.