Hi all" PIC Engineers" A week ago I asked to piclist a quection about multiplexed sisyem with two 4 bit encoder how to use them . but I did not get any answer what so ever. well At list check my code see if it will work or not. I have only 6 pins aveliable (multiplexed system only). thank you very much list p=16c622 ; ***** PIC REGISTER EQUATES ***** STATUS EQU 3 ; STATUS REGISTER ; ***** PORT ASSIGNMENTS ***** porta equ 5 ; input from bcd switches portb equ 6 ; BCD drive #define switch1 portb,2 ; #define switch2 portb,3 ; trisa equ 5 trisb equ 6 ; ********** data register equates *********** R0 equ 22h R1 equ 23h temp equ 27h ; *********** reset point *************** org 00 goto init ;*********** subroutines here *********** delay movlw 0ffh ; to allow ports to settle movwf temp decfsz temp,f goto $-1 return ; ***************************** initalise software ****************** init clrf porta clrf portb ; start off with clear outputs bsf STATUS,5 ; goto page 1 clrf trisb clrf trisa movlw b'11111111' movwf trisa ; make inputs movlw b'00010011' movwf trisb ; make portb i/o bcf STATUS,5 ; return to page 0 clrf R0 clrf R1 clrf temp main clrf porta ; start with a clear output bsf switch1 ; turn on switch 1 power call delay ; allow time for voltages to settle movfw porta ; get switch settings movwf R0 ; Set R0 bcf switch1 nop bsf switch2 ; turn on switch 2 power call delay movfw porta ; get switch settings movwf R1 ; Set R1 bcf switch2 nop END