GARTHWILSON wrote:
U4B section A (pins 1, 2, and 3) time the power-up reset to somewhere in the 70ms area. The actual length depends on not just resistor (component 10) and capacitor (component 11) tolerances, but on the size of the hysteresis size of the Schmitt-trigger gate input and how fast the power supply comes up.
The interesting thing here is that U4B section B (pins 4, 5, and 6) will act as an oscillator if the REST (not "RESET") input is not pulled down. This oscillator, if allowed to run freely, will put out a square wave of around 250Hz (exact rate again depending on the things mentioned above). When its output transitions to a low state, it brings the NAND's pin 2 low, setting the inverter's output low for a RST\-true condition. When the NAND's pin 4 goes back high again, the RST\ output comes up and the processor can run its reset routine and get things going again. I expect then that the software tells something to pull the REST input low again to keep the first NAND section from oscillating. Because of that, the oscillator is stopped after just one cycle. Without knowing what exactly is connected to that REST input, I have to assume it's some sort of watchdog-timer-like arrangement, to reset the computer if the program fails, or at least something that the program can correct fails. Time is allowed for the oscillator to start up after the REST input comes up. This time appears to be around 60 or 80ms, depending on the above considerations and how low REST had been pulled down to before it came up. This amount of time is pretty common for watchdog timers.
Thank you for your answer! REST is connected to an output of an LS138. Long story short, the inputs of this LS138 depend on address pins of the 6502, except one active-low connected to R/W and the second active-low being an output of another LS138, itself also connected to address pins and Φ2 as an active-low.
Thus, if what I understand with my limited knowledge is correct, REST is always 1, except when the program writes to a particular address (what is written is unimportant as what matters in this case are the address pins activated - it is not a memory chip). If I am not mistaken, this address is $17E0.
Now the program calls this a few times, in particular... near the beginning
Here are the first lines :
Code:
E9D1 A2 FF LDX #$FF
E9D3 9A TXS
E9D4 E8 INX
E9D5 8A TXA
E9D6 95 00 STA $00,X
E9D8 9D 00 01 STA $0100,X
E9DB 9D 00 02 STA $0200,X
E9DE 8D E0 17 STA $17E0
E9E1 CA DEX
E9E2 D0 F2 BNE $E9D6
The beginning seems sensible for a start/reset, as memory is initialized with 00... But then STA $17E0 ?
It does not make sense to me to activate the reset here. I have been banging my head on this wall for a while and can't figure out what is wrong.