[Coco] PIA keyboard input?

jdaggett at gate.net jdaggett at gate.net
Sun Dec 7 17:02:06 EST 2003


James

Essentially that is correct. Key keypad is normally open.A keypress forces a 
connection. IC5 configures port A as inputs for bit 0 to 7. Bits 0 to 6 are mapped to 
the keyboard rows. PortA of the 6821 has a weak pull up resistance internal. By 
configuring port B to the columns and as an output and low, any keypress will 
produce a low on a corresponding row of Port A and generate interrput. The rows 
are mapped to a 8 input nand gate and then to an inverter then to the GIME II1 pin 
(#25). Also the joysticks share the same interrupt. Bits 0 to 3 are also used for 
joystick button push. 

The software determines which key by first determining which row is down. Then by 
setting each column low one at a time, while the remaining columns are high, the 
column that change the row bit is the one that has a keypress.

Also bits 0 to 3 are used for joystick button press. I am not sure which is done first. 
Rule out key press then a button press or vice versa. 

james


On 7 Dec 2003 at 14:38, James Dessart wrote:

> I'm trying to figure out how to read the keyboard from the PIA, and
> I've checked out BASIC Unravelled.  What it seems to be is that you
> place a 0 into the bit of the column strobe that you want, and then
> check the rows to see if there are keys depressed in that row.  Is
> that correct?
> 
> So, as I see it, to find out which keys are depressed, I need to roll
> a 0 through the column register, and check the row register. 
> Depending on which I see depressed, I can say which keys are pressed. 
> Do I have a good understanding of this?  Other than the joystick
> button bit, are there any caveats to this?
> 
> James
> 
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco





More information about the Coco mailing list