Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;*******************************************************************************
- ; *
- ; Filename: Proyecto 1 *
- ; Date: 21/01/2017 *
- ; File Version: 0.01 *
- ; Author: Mariano Rocha *
- ; Company: Electronicos embebidos *
- ; Description: Led Blink *
- ; *
- ;*******************************************************************************
- ; MAIN PROGRAM
- ;*******************************************************************************
- LIST P=16f1827
- RADIX HEX
- include P16f1827.inc
- __CONFIG _CONFIG1, _FOSC_XT & _WDTE_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_ON & _FCMEN_ON
- __CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_ON & _BORV_LO & _LVP_ON
- ORG 0
- CBLOCK 0X20
- PDel0, PDel1, PDel2
- ENDC
- INICIO
- BANKSEL PORTB
- clrf PORTB
- BANKSEL ANSELB
- clrf ANSELB
- BANKSEL TRISB
- clrf TRISB
- BANKSEL PORTB
- BUCLE
- bsf PORTB,0
- call DEMORA
- bcf PORTB,0
- call DEMORA
- goto BUCLE
- goto INICIO
- ;-------------------------------------------------------------
- DEMORA movlw .14 ; 1 set numero de repeticion (C)
- movwf PDel0 ; 1 |
- PLoop0 movlw .72 ; 1 set numero de repeticion (B)
- movwf PDel1 ; 1 |
- PLoop1 movlw .247 ; 1 set numero de repeticion (A)
- movwf PDel2 ; 1 |
- PLoop2 clrwdt ; 1 clear watchdog
- decfsz PDel2, 1 ; 1 + (1) es el tiempo 0 ? (A)
- goto PLoop2 ; 2 no, loop
- decfsz PDel1, 1 ; 1 + (1) es el tiempo 0 ? (B)
- goto PLoop1 ; 2 no, loop
- decfsz PDel0, 1 ; 1 + (1) es el tiempo 0 ? (C)
- goto PLoop0 ; 2 no, loop
- PDelL1 goto PDelL2 ; 2 ciclos delay
- PDelL2 clrwdt ; 1 ciclo delay
- return ; 2+2 Fin.
- ;-------------------------------------------------------------
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement