I am so grateful for all the valuable information shared here by wonderful people, and I wish this website had existed 40 years ago!
I just encountered a strange behavior at reset. The system consists of a WDC 65C02 in minimal configuration with RESB, PHI2 and data bus under external control for blind boot. For analysis, an AVR is connected to the address and data bus and a simple logic analyzer is connected to the control lines.
Normally the reset vector is loaded after the 6th falling edge of phi2. This can be seen on the address bus and the negative edge of VPB. However, in some cases this already happens after the 5th falling edge. The behavior is reproducible even at low clock rates.
Normal bootavr output
Code:
340c a2
resb lo
340e 22
340e 22
340e 22
340e 22
340e 22
resb hi
340e 22
---------
ffff ff
340f aa
01db 35
01da 0c
01d9 ff
fffc 00
strange behavioravr output
Code:
340c a2
resb lo
340e 22
340e 22
340e 22
340e 22
340e 22
resb hi
---------
ffff ff
340f aa
01de 0c
01dd ff
01dc 13
fffc 00
fffd 20
This causes the blind start to behave differently than expected in some cases. A possible workaround would be to simply put $EA on the data bus first (for the reset vector and the first commands). Then the changing behavior would have no influence on the following sequence.
Of course, this is somewhat unsatisfactory. The expectation is that the processor shows a strictly deterministic behavior. I have now changed the sequence so that the rising edge of RESB occurs during PHI2 low. After this change, the system behaves reproducibly after each reset.
This seems to have solved the problem. Maybe this information is useful for someone. Of course, it would be great if one of the experienced professionals had an explanation for the behavior!
p. s.
This is my first post here. Please let me know if something is missing or unclear.