Download - Input and Output ports - sel.eesc.usp.br
Transcript
STATUS EQU 0x03BSF STATUS,RP1; Change to Bank 1
MOVLW B’00000101’; RB0 e RB2 como entradas; RB1, RB3 a RB7 como saídas
MOVWF TRISB; Aplica as configurações à porta B
MOVLW B’10100010’; (W)=0xA2MOVWF PORTB; (PORTB)=(W)=0xA2
; RB1=1,RB3=0,RB4=0,RB5=1,RB6=0, RB7=1; No effect on RB0 and RB2 due to be; configured as input
BCF STATUS,RP0; Change to Bank 0
PIC16F84A/628A
STATUS EQU 0x03BSF STATUS,RP1; Call Bank 1
MOVLW B’00000101’; RA0 e RA2 como entradas; RA1, RA3 e RB4 como saídas
MOVWF TRISA; Aplica as configurações à porta A
MOVLW B’10100010’; (W)=0xA2MOVWF PORTA; (PORTA)=(W)=0xA2
BCF STATUS,RP0; Call Bank 1