| ??? 09/16/06 04:08 Read: times |
#124390 - Column scan after ROW confirmation Responding to: ???'s previous message |
ERIK said: ; before the below statement acc will be having the ; value of PORT 1 anl a, #0f0h ; here columns are made low and only ; rows are scanned cjne a, #0e0h, ROW_SCAN_2 sjmp ROW_1 You make all columns low, then you test for a row. What this will tell you is that a key in row 1 and any column is pressed. I do not know what that information is good for. By getting the values of ROW we the control will go ahead and will scan the particular column by the statement
SUB_FINAL:
rrc a
jnc MATCH
inc dptr
sjmp SUB_FINAL
MATCH:
clr a
movc a,@a+dptr
push acc
ret
As the Column is in lower nibble so after scanning the ROW, dptr will be having the particular ROW address and now by the above statement we can finsd the column and incement the dptr untill CARRY FLAG is clear. The incrementing value of DPTR is taken from the look up table which has the values according to the key is pressed. You can calculate that by using this logic the key is pressed is scanned correctly. Juz I am unable to make it work. thanks & regards Arvind Shrivastava |



