View Single Post
Old 10 September 2021, 03:50   #11
rsquared
Registered User
 
Join Date: Dec 2020
Location: Vista, CA USA
Posts: 2
64Door problem solved (A2000 with Cherry G80 keyboard)

After almost a year I decided to look into why 64Door wouldn't run on my A2000, locking up after any keypress. I couldn't find anyone else with the same problem, but it's because I have that rarer early keyboard with the Cherry switches. 64Door doesn't really handshake with the keyboard well, it simply does this to send the pulse which acknowledges the receipt of a keypress
Code:
moveb  #-16,0x00bfec01    ;output byte to serial data register
bset   #6,0x00bfee01      ;CR-A, set port direction to output
nop
nop
nop
nop
bclr   #6,0x00bfee01     ;CR-A, set port direction to input
On a stock A2000, those 4 NOPs result in an effective wait or pulsewidth that I think was around 9us on my oscope--not enough for the early keyboard rev to recognize (the HW ref manual says > 80-something microseconds needed for compatibility with "all keyboard models" IIRC). Because the keyboard never sees an acknowledgement, the keyboard controller just loops for ever trying to resync communication by repeatedly clocking out a single bit "1" and 64 Door has no code to handle that either. The controllers in the later revs I think can see pulses down to 8us or less.

Luckily the fix is simple because there is just enough space taken up by the NOPs to patch in a delay loop. I went in and edited the file on disk, replacing those 4 NOPs with a little loop of around 64*10 cycles (move.w #64, d0 / dbf d0, -2) and now it all works just fine. So if you have the same problem, maybe this fix will work for you.
rsquared is offline  
 
Page generated in 0.04694 seconds with 11 queries