i real need somones help with this pic16f84a question
A de-multiplexer has an input line, pinRB0, and four output
lines, output0 to output3, which are, respectively, the pins RA0-RA3. the
demultiplexer copies the digital signal appearing on the input line on to one of
the four output lines. The output line is selected by a two bit
selection code input on the pins RB1 and RB2.
i have this code that does the following
The following program, in assembly language of the pic16f84A microcontroller, configures the three
; lower pins of PORTA(RA0, RA1 and RA2) as inputs, and the pins of PORTB as output. The program then
;enters a non-terminating loop. in the loop program read the three input lines, interpret the input as
;a 3 bit binary value(RA0 as the least significant bit), and make PORTB line corresponding to the
;input value 'on' by outputting the value '1' on this line.
;All other output lins must remain '0'.
#DEFINE PAGE0 BCF 0x03,5
#DEFINE PAGE1 BSF 0x03,5
PCL: EQU 0x02
STATUS: EQU 0x03
PORTA: EQU 0x05
TRISA: EQU 0x05
PORTB: EQU 0x06
TRISB: EQU 0x06
W: EQU 0
F: EQU 1
ORG 0x0
goto MAIN
org 5
MAIN:
clrf PORTA
clrf PORTNB
PAGE1
movlw B'00000111'
iorwf TRISA,F ;RA0-RA2 as input
clrf TRISB ;Port B0-B7 as output
PAGE0
LOOPX:
movf PORTA. W
andlw B'00000111'
call TABLE
movfw PORTB
goto LOOPX
TABLE:
addwf PCL, F
retlw B'00000001'
retlw B'00000010'
retlw B'00000100'
retlw B'00001000'
retlw B'00010000'
retlw B'00100000'
retlw B'01000000'
retlw B'10000000'
END
after goign through this code anybody can tell me how can code teh above question(can anybody the code so it does what i asked at the top)
i just hope iam clear enough.....please if u can send resoponse to my emailktdksk@yahoo.com.au
A de-multiplexer has an input line, pinRB0, and four output
lines, output0 to output3, which are, respectively, the pins RA0-RA3. the
demultiplexer copies the digital signal appearing on the input line on to one of
the four output lines. The output line is selected by a two bit
selection code input on the pins RB1 and RB2.
i have this code that does the following
The following program, in assembly language of the pic16f84A microcontroller, configures the three
; lower pins of PORTA(RA0, RA1 and RA2) as inputs, and the pins of PORTB as output. The program then
;enters a non-terminating loop. in the loop program read the three input lines, interpret the input as
;a 3 bit binary value(RA0 as the least significant bit), and make PORTB line corresponding to the
;input value 'on' by outputting the value '1' on this line.
;All other output lins must remain '0'.
#DEFINE PAGE0 BCF 0x03,5
#DEFINE PAGE1 BSF 0x03,5
PCL: EQU 0x02
STATUS: EQU 0x03
PORTA: EQU 0x05
TRISA: EQU 0x05
PORTB: EQU 0x06
TRISB: EQU 0x06
W: EQU 0
F: EQU 1
ORG 0x0
goto MAIN
org 5
MAIN:
clrf PORTA
clrf PORTNB
PAGE1
movlw B'00000111'
iorwf TRISA,F ;RA0-RA2 as input
clrf TRISB ;Port B0-B7 as output
PAGE0
LOOPX:
movf PORTA. W
andlw B'00000111'
call TABLE
movfw PORTB
goto LOOPX
TABLE:
addwf PCL, F
retlw B'00000001'
retlw B'00000010'
retlw B'00000100'
retlw B'00001000'
retlw B'00010000'
retlw B'00100000'
retlw B'01000000'
retlw B'10000000'
END
after goign through this code anybody can tell me how can code teh above question(can anybody the code so it does what i asked at the top)
i just hope iam clear enough.....please if u can send resoponse to my emailktdksk@yahoo.com.au