LIST P=16F886
INCLUDE P16F886.INC
__CONFIG _CONFIG1, _INTOSCIO & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_ON & _IESO_OFF & _FCMEN_OFF & _LVP_OFF & _DEBUG_OFF
__CONFIG _CONFIG2, _BOR40V & _WRT_OFF
CBLOCK 0X20
PDel0, PDel1, PDel2
ENDC
ORG 00
GOTO CONFIGURA
RETARDO movlw .150 ; 1 set number of repetitions (B)
movwf PDel0 ; 1 |
PLoop1 movlw .232 ; 1 set number of repetitions (A)
movwf PDel1 ; 1 |
PLoop2 clrwdt ; 1 clear watchdog
PDelL1 goto PDelL2 ; 2 cycles delay
PDelL2 goto PDelL3 ; 2 cycles delay
PDelL3 clrwdt ; 1 cycle delay
decfsz PDel1, 1 ; 1 + (1) is the time over? (A)
goto PLoop2 ; 2 no, loop
decfsz PDel0, 1 ; 1 + (1) is the time over? (B)
goto PLoop1 ; 2 no, loop
PDelL4 goto PDelL5 ; 2 cycles delay
PDelL5 goto PDelL6 ; 2 cycles delay
PDelL6 goto PDelL7 ; 2 cycles delay
PDelL7 clrwdt ; 1 cycle delay
return ; 2+2 Done
CONFIGURA CLRF PORTB
BANKSEL ANSEL
CLRF ANSEL
CLRF ANSELH
BANKSEL TRISB
MOVLW B'00000001'
MOVWF TRISB
BANKSEL PORTB
INICIO BTFSS PORTB,0
GOTO INICIO
CALL RETARDO
MOVLW B'00010000'
XORWF PORTB,F
GOTO INICIO
END
Para el celular
Circuito
Copyright 2012 edwtron
Este DOCUMENTO es un DOCUMENTO LIBRE, usted puede redistribuirlo y/o modificarlo bajo los terminos de la GNU FDL tal y como es publicada por la fundacion de software libre; bajo la version 1.3 de la licencia, o una version superior.
Leer la licencia GNU gpl para mas detalles.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
No hay comentarios:
Publicar un comentario