Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/25/00 18:22
Read: times


 
#4708 - RE: 8051 ROM lookup table
Hi Ben,

if I understand you right, your problem was, how you can scan a 10*8 key matrix.

The most used solution was, to activate always only 1 output and scan the inputs:

E.g. on 10 outputs apply the following pattern:
11 11111110b
11 11111101b
...
01 11111111b

After every pattern was applied, read the input byte and compare, if it was 0FFh.
If yes, increment a row counter and apply the next value.
If not equal 0FFh, you found the row of the key.
Then you must only find the column.
This can easy be done by shifting trough carry (RLC A) until carry was cleared. On every shift increment a column counter.
After this all calculate:
row * 8 + column and you get a value in the range 0 ... 79.

Then to get a pointer to a 5 byte entry, multiply it by 5, add the table start address and load it to DPTR.


Peter


List of 19 messages in thread
TopicAuthorDate
8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      
RE: 8051 ROM lookup table            01/01/70 00:00      

Back to Subject List