Debbie Hynes   Deb's PICLIST Page  

ELECTRONICS & PROGRAMMING LINKS
It's early days for this page & not all these are gonna work .... NOT FIN !

DEB's PROJECTS ... under construction!
Member Number : DJH-yahoo-146

4x4 keypad, LED, HD44780 LCD interface
DS1802 Digital Potentiometer code

USEFUL LINKS
Xenu the link checker. Praise Xenu!

Code Snips

;Aaarrgh .. indexed addressing in MCUs gives me a LOT of mental worry.
;This routine should work, however ....
;Grab 4 bytes of data and place'em in successive mem locations.
;Use INDEXING !
;Decrement the array offset so we don't have to use a counter as well. 
;More compact code?
;Debbie H.

                clrf      FSR
                clrf      INDF
                clrf      keydata     ;Keypad byte goes here
                clrf      data04
                clrf      data03
                clrf      data02
                clrf      data01       
                movlw     0x04        ;Initial value = 4      
                movwf     offset      ;so 1st array element goes in data01 
;Important!
;Arrange  keydata &data01 .. data04 in consecutive memory addresses.

loop    call    kpdgrab     ;Subroutine returns a byte from a 4x4 keypad 
        movlw   keydata     ;Get the data address and
        addwf   offset,w    ;find its destination
        movwf   FSR         ;Tell the MCU where to shove it
        movf    keydata,w   ;Get the data byte and
        movwf   INDF        ;move the new keydata contents 
        decfsz  offset,f    ;Get ready for the next address 
         goto   loop        ;do it again.
fin     goto    $


PICLIST URL: http://www.piclist.com/techref/member/DJH-yahoo-146/index.htm  EMAIL: debbiehynes2002@yahoo.com.au Author : Debbie Hynes, 2002.