MANUAL DE MICROCONTROLADORES PIC
MANUAL DE MICROCONTROLADORES PIC
MANUAL DE MICROCONTROLADORES PIC
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
;<br />
rlf<br />
rlf<br />
rlf<br />
rlf<br />
rlf<br />
L_BYTE<br />
H_BYTE<br />
R2<br />
R1<br />
R0<br />
decfsz count<br />
goto adj<strong>DE</strong>C<br />
retlw 0<br />
;<br />
adj<strong>DE</strong>C<br />
movlw R2<br />
movwf FSR<br />
call adjBCD<br />
;<br />
movlw R1<br />
movwf FSR<br />
call adjBCD<br />
;<br />
movlw R0<br />
movwf FSR<br />
call adjBCD<br />
;<br />
goto Loop16<br />
;<br />
adjBCD<br />
movlw 3<br />
addwf 0,W<br />
movwf temp<br />
btfsc temp,3<br />
movwf 0<br />
movlw 30<br />
addwf 0,W<br />
movwf temp<br />
btfsc temp,7<br />
movwf 0<br />
retlw 0<br />
;######################################################<br />
####################<br />
Main<br />
;Inicialización de puertos<br />
BANK1<br />
CLRF TRISB ;Programación del puerto B como salida<br />
MOVLW 03<br />
MOVWF TRISA ;Programación del puerto A, RA0 y RA1 como entrada<br />
BANK0<br />
MOVLW 0FF<br />
MOVWF PORTA ;Inicialización de los puertos A y B