Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;http://www.archimon-tx8.blogspot.com
- list p=16F84A
- include "p16f84a.inc"
- ;Definicion de fuses
- __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
- ;Ubicacion de variables en banco de memoria
- COUNT1 equ 0x0c
- COUNT2 equ 0x0d
- ;Inicio de programa
- org 0x00
- ;Modo de operacion de puertos I/O, interrupciones
- bsf STATUS,5
- movlw b'11111110' ;la unica salida será RB0
- movwf TRISB
- bcf STATUS,5
- ;Codigo de programa
- INICIO
- bsf PORTB,0
- call DELAY ;llamo a la rutina de retardo
- bcf PORTB,0
- call DELAY ;otra vez para notar el efecto del parpadeo
- goto INICIO
- DELAY movlw 0xFF ; Subrutina de retardo
- movwf COUNT1 ; 256x256=65536 cuentas
- movwf COUNT2
- LOOP decfsz COUNT1,1 ; Decrementa COUNT1
- goto LOOP ; Salta si COUNT1=0
- movlw 0xFF
- movwf COUNT1 ; COUNT1=FF
- decfsz COUNT2,1 ; Decrementa COUNT2
- goto LOOP ; Salta si COUNT2=0
- return ; Retorno de subrutina
- end ; Fin de programa
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement