Watchdog is a timer which is started before beginning to wait for a long-term process.
If the process is completed at the expected time, the watchdog timer is stopped. Otherwise, the timer triggers an emergency procedure.
In this case, it has been used to reset the counter of nibbles after expire 1500 μs since of receiving last nibble.
I see, that explains why SymbOS works even now, that - as I thought too - my watchdog implementation expires before new mouse query of SymbOS, so it will always read only four nibbles, even if I implement much more. Now, SymbOS seems to work, even if I enable 16 nibble protocol, but using the J-column (not so surprising that it won't work with the K ...).
Now what I can't see clearly: what exactly stops the watchdog. Only the data read, or the RTS signal change as well? I mean, my idea after reading many posts in this topic, that, after the expected nibble number (ie 4 for boxsoft, 8 for extended MSX) I must provide zero mibbles basically *forever*. So if I keep trying to read without giving chance for watchdog to expire and reset the counter, I will only read zeros then, till the lifespan of the whole Universe
The *only* (??) way to to begin with 0th nibble again is to wait at least 1500usec so watchdog expires and it resets the nibble counter, so next nibble read will be again 0th nibble, and everybody is happy.
Now as gflorez noted, my implementation based on these ideas still does not work
well, it's even more worse ... :-/ Even in boxsoft mode, where SymbOS works nicely, according my own tests. I basically have run out of ideas soon what I should done then ... I really pray for a more simple like parallel protocol
OK, it's just my lameness, that I can't implement that, it's not the protocol's bad. Of course
Currently, I check expiration of watchdog only at read (of port 0xB6). So application can send RST pulses, but it does not affect at all the state of the watchdog. Hmmm, I have the suspect, that the problem can be with my code
https://raw.githubusercontent.com/lgblgblgb/xep128/master/input.cIn mouse_read() I check the watchdog, if that expires I resets the nibble counter. However still, the *old* nibble is returned, which was zero (or some other if not all nibbles were read before). Maybe, with resetting the nibble counter, I should also provide a new value on read. But if it's true, I don't really understand why SymbOS still works and not confused by the "exra" zero. Now, I am more or less sure that my problem is about the exact "places" to reset / check watchdog, and similar things, that it does not comply to the rules ...