[Coco] PIA keyboard input?

jdaggett at gate.net jdaggett at gate.net
Mon Dec 8 12:56:00 EST 2003


Paul

I went back and read the 6821 spec. Yes PortA of the PIA can read the state of the 
port pin. PortB cannot. PortB is used to drive the columns. 

per the spec

"Notice the difference between PortA and Port B read operation when in the output 
mode. When reading Port A the actual pinis read, whereas the B side reads come 
from an ouptput latch, ahead of the actual pin."

On PortB you read the outputof the latch and not the pin. There is no real way to 
read the state of the load external to the pin unless it is externally wire to another 
PIA port configured as an input.  

It is as assumption that when you read PortB output latch that the corresponding 
output pin is correct. 


james
 

On 8 Dec 2003 at 8:22, Paul T. Barton wrote:

> 
> --- James Dessart <dessart at istop.com> wrote:
> > 
> > On 7-Dec-03, at 5:09 PM, Robert Gault wrote:
> > 
> > > Whether you ROL/ROR or ST depends on whether
> > you want to detect one 
> > > specific key or any possible key press
> > combination. Clearly if you 
> > > want any key you must test all possible
> > column/row combinations.
> > 
> > Well, what I wanted to do was to store a value
> > into the PIA register, 
> > through a loop.  I'm doing this in C, and to do
> > a ROL you need to write 
> > inline assembly.  So I was trying to store a
> > constantly changing value 
> > into the register through a C assignment.  That
> > didn't work for me, for 
> > some reason... I never got key presses... I'll
> > retry it, though, maybe 
> > I was doing it wrong the first time and didn't
> > realize it.
> > 
> > James
> 
> James,
> If you're doing "ROL ADDRESS"
> then it depends on what has been read
> back from that address (to roll). I don't
> remember correctly, but it may be that
> you can't read the output pins fron the
> data port even tho you just wrote them.
> 
> Anyway, it depends on the reading from
> the PIA port that your "0" gets rolled.
> 
> Paul
> 
> 
> =====
> IBO 1482969 WWG
> Linux # 314458
> 
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
> 
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco





More information about the Coco mailing list