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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/15/06 09:14
Read: times


 
#124345 - Subroutine Details
Responding to: ???'s previous message
SCAN_MATRIX_KEYBOARD:
subroutine is used to find whether any coulmn ie. lower nibble of PORT 1 is high or low. If any column or a single bit in the lower nibble of PORT 1 is found to be low that means there is some key pressed and so jumped to the next subroutine named AHEAD. Otherwise continuos loop will be there to check is there any column is low or not.

AHEAD:
subroutine is used to find whether any ROW ie. higher nibble of the PORT 1 is high or low. If any row or a single bit in the higher nibble is low implioes that any key has been pressed and so jumped to the next subroutine named PROCESS_SCAN. Otherwise jump to SCAN_MATRIX_KEYBOARD for continious loop will be there to check is there any column is low or not.

PROCESS_SCAN :
subroutine is to check again whether any key is pressed or not in the form of checking the column status.
If in this subroutine it is found that the onbe of the bit in the lower nibble of PORT 1 is low ie. column is low then it will jump to next subroutine named ROW_SCAN_1 to check which row is correspondingly low to this column.

ROW_SCAN_1:
Subroutine is to check whether the first ROW ie bit 4 is low or not by the statement
                       ; 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
              


Similarly ROW is scanned and if any value is matched then the control jump to corresponding ROW_number so that the DPTR pointer will have the address of the corresponding staring row address in the look up table.

FINAL :
it is used for getting the value of PORT 1 as the coulmn is to be evaluated after the row has been scaned.

MATCH :
this subroutine is used to calculate the value of column by seeing the CARRY flag and when CARRY flag is found to be clear then the corresponding value address from DPTR is moved to Accumulator and in this way the keypressed can be scanned.

regards
AS





List of 27 messages in thread
TopicAuthorDate
Matrix Keyboard not working            01/01/70 00:00      
   the logic            01/01/70 00:00      
   Lots of problems            01/01/70 00:00      
      no, it's completely bad in concept            01/01/70 00:00      
      Does the LCD Work?            01/01/70 00:00      
      enphasizing            01/01/70 00:00      
   commented code            01/01/70 00:00      
      Persistance my friend            01/01/70 00:00      
         I'll try it in other way            01/01/70 00:00      
            I'll make the corrections            01/01/70 00:00      
      Note on comments            01/01/70 00:00      
         bad, very bad - yes, but not necessarily because            01/01/70 00:00      
            Subroutine Details            01/01/70 00:00      
               I don't know            01/01/70 00:00      
                I do not know what that information is good for.            01/01/70 00:00      
                  Column scan after ROW confirmation            01/01/70 00:00      
                     Maybe the problem is not here            01/01/70 00:00      
      more Informative code            01/01/70 00:00      
         Comments are better            01/01/70 00:00      
         The Algorithm            01/01/70 00:00      
            This isn\'t necessarily true ...            01/01/70 00:00      
               a correct pain in the gluteus maximus            01/01/70 00:00      
                  Why so much pain?            01/01/70 00:00      
               An exercise for the student            01/01/70 00:00      
               everyone else            01/01/70 00:00      
   Does the LCD Work?            01/01/70 00:00      
      LCD is fine            01/01/70 00:00      

Back to Subject List