Re: A86: Direct keypad reading


[Next][Index][Thread]

Re: A86: Direct keypad reading




At 12:18 AM 12/26/97 -0600, you wrote:
>
>I need detailed instructions on how to do this.  I understand everything I
>think.  Could you please tell me what is wrong with this.
>
>I am trying to get F4-
>
>ld a,$6
> out (1),a
> nop
> nop
> in a,(1)
> bit 1,a
> call nz,whatever
>
>Thanks for any help you can give me,
>Caymran
>
>

you don't load $6 directly into a.  6 is the bit number that you want
clear, for example:
          76543210
 bit 6 - %00111111
           ^
 bit 4 - %01101111
             ^

note that bit 7 doesn't matter, just keep that 0.

so the code would be:
	
	ld a,%00111111      bit 6 is clear, or zero, or off, or reset
	out (1),a
	nop
	nop
	in a,(1)
	bit 1,a			;this is all correct, i'm pretty sure
	call nz,whatever	;this is if the key is pressed

In addition, here's a little excerpt from 86ports.txt
    This port can be represented by a 7*8 matrix:

   ROWS represent the bit you don't want to mask out when writing to the port
   COLUMNS represent the bit set when reading from the port

         7     6     5     4     3     2     1     0     
    6  [ MORE  EXIT  2nd   F1    F2    F3    F4    F5   ]
    5  [ ALPHA GRAPH LOG   LN    x^2   ,     STO   --   ]
    4  [ x-var TABLE SIN   EE    7     4     1     0    ]
    3  [ DEL   PRGM  COS   (     8     5     2     .    ]
    2  [ --   CUSTOM TAN   )     9     6     3     (-)  ]
    1  [ --   CLEAR  ^     /     *     -     +    ENTER ]
    0  [ --    --    --    --    UP    RIGHT LEFT DOWN  ]



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Alan Bailey            mailto:bailela@charlie.cns.iit.edu
 IRC:Abalone              Web:http://www.iit.edu/~bailela/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 


References: