A quote from Toni from a thread somewhere on EAB (sorry I didn't record the exact location in my source code):
Quote:
Originally Posted by ToniWilen
; Reading Keyboard
; ================
;
; Check that CIA-A serial port (SP) interrupt is set (or use ports
; interrupt), if set, read SDR, then set bit 6 in CIA-A CRA, wait at least
; ~70us, clear bit 6. (this is one method to handle handshake, there is
; also another one)
;
; This tells keyboard micro controller that key code has been read and
; new code can be sent.
|
Here's my calculations from my own keyboard reading routine. In order to wait ~300uS, 4 scanlines should be sufficient assuming that 1) my calculations are correct and 2) you are designing this for a PAL system
Code:
;
;
; PAL
; ===
;
; 50 VBLs / second = 0.02 seconds per VBL
; 250 scanlines per VBL = 0.00008 seconds per scanline
; 0.00008 seconds = 0.08 milliseconds (mS)= 80 micro seconds (uS)
;