Page 1 of 1

IPC keyboard scanning: Anyone know what the maximum delay between input and output?

Posted: Fri Jul 18, 2025 10:50 pm
by stephen_usher
Does anyone know what the maximum delay between the column scan going high and the IPC reading a correct value from the row is?

JustCurious(tm)...

Re: IPC keyboard scanning: Anyone know what the maximum delay between input and output?

Posted: Fri Jul 18, 2025 11:57 pm
by Pr0f
It will depend a bit on which IPC you are using. It would mean counting the states / cycles for the instructions between setting the row address and then reading the column data in.

In the original IPC code:

; scan keyboard, entry A (one bit=1), ret A
05C8: 39 OUTL P1,A output A on P1
05C9: AB MOV R3,A
05CA: 80 MOVX A,@R0 put P0 in read mode=HI-Z ??
05CB: 00 NOP wait a bit
05CC: 00 NOP
05CD: 00 NOP
05CE: 00 NOP
05CF: 00 NOP
05D0: 00 NOP
05D1: 08 IN A,P0 get P0 into A
05D2: 93 RETR

OUTL and MOVX are 2 cycle instructions , the rest all 1 cycle - a cycle is 5 T states (11MHz / 5) - so I make that about 10 cycles - a bit over 4.5uS