SlideShare une entreprise Scribd logo
1  sur  2
;CONTADOR UP/DOWN

                LIST                     P=16F88

                #INCLUDE                 <P16F88.INC>

; ======================= DIRECTIVA DE CONFIGURACION DE FUSIBLES ==============

                __ CONFIG _CONFIG1, _XT_OSC & _MCLR_ON & _LVP_OFF & _CP_OFF & _WDT_OFF       ;FUSIBLES MAS IMPORTANTES


;NO OLVIDAR ACTIVAR _MCLR_ON




; ======================= DECLARAR FSR A UTILIZAR ==============================




TRISA           EQU              0X85

TRISB           EQU              0X86

PORTA           EQU              0X05

PORTB           EQU              0X06

;======================= DECLARAR PGR A UTILIZAR ==============================

DELAY1          EQU              0X20

DELAY2          EQU              0X21

;=================================== INICIO DEL PROGRAMA =================================

RESET                   ORG      0X00

                        GOTO     PREINICIO

                        ORG      0X05

;====================================== RUTINA DE RETARDO ===================================

RETARDO                 MOVLW D'150'

                        MOVWF DELAY1

TOP2                    MOVLW D'150'

                        MOVWF DELAY2

TOP1

                        DECFSZ DELAY2

                        GOTO             TOP1

                        DECFSZ DELAY1

                        GOTO             TOP2

                        RETLW    0X00
;================================== CONFIGURACION DE PREINICIO =============================

PREINICIO               MOVLW 0X20

                        MOVWF STATUS            ;ME UBICOEN EL BANCO 1 PARA CONFIGURAR PUERTOS MEDIANTE TRISA Y TRISB

                        CLRF    TRISB

                        MOVLW 0XFF

                        MOVWF TRISA

                        CLRF    ANSEL           ;CONFIGURANDO PUERTO A COMO E/S DIGITAL




                        MOVLW 0X07

                        MOVWF CMCON

                        CLRF    STATUS          ;RETORNO AL BANCO 0

                        CLRF    PORTA

                        CLRF    PORTB

;================================= INICIO DEL PROGRAMA ======================================

INICIO                  BTFSS   PORTA,0X0       ;PREGUNTA SI EL CLOCK SE ACTIVA O NO

                        GOTO    INICIO

                        CALL    RETARDO         ;RETARDO PARA ELIMINAR LOS REBOTES




                        BTFSS   PORTA,0X1       ;PREGUNTA SI LA CUENTA ES UP/DOWN

                        GOTO DECREMENTO

INCREMENTO              INCF    PORTB,D

                        GOTO    PREGUNTA




DECREMENTO              DECF    PORTB,D

PREGUNTA                BTFSC   PORTA,0X0

                        GOTO    PREGUNTA

                        GOTO    INICIO

;============================ DIRECTIVA DE FIN DE PROGRAMA ====================




                        END

Contenu connexe

Plus de gilmer poveda

Plus de gilmer poveda (6)

Intro invest cientifica_1
Intro invest cientifica_1Intro invest cientifica_1
Intro invest cientifica_1
 
Teleco1
Teleco1Teleco1
Teleco1
 
estabilidad
estabilidadestabilidad
estabilidad
 
Canola
CanolaCanola
Canola
 
Inteligencia emocional
Inteligencia emocionalInteligencia emocional
Inteligencia emocional
 
Caos y turbulenci agio
Caos y turbulenci agioCaos y turbulenci agio
Caos y turbulenci agio
 

Dernier

Formation M2i - Comprendre les neurosciences pour développer son leadership
Formation M2i - Comprendre les neurosciences pour développer son leadershipFormation M2i - Comprendre les neurosciences pour développer son leadership
Formation M2i - Comprendre les neurosciences pour développer son leadershipM2i Formation
 
A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.Franck Apolis
 
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...Faga1939
 
Guide Final de rédaction de mémoire de fin d'étude
Guide Final de rédaction de mémoire de fin d'étudeGuide Final de rédaction de mémoire de fin d'étude
Guide Final de rédaction de mémoire de fin d'étudeBenamraneMarwa
 
systeme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expertsysteme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expertChristianMbip
 
Présentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptxPrésentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptxpopzair
 
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxApproche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxssusercbaa22
 
Bolero. pptx . Film de A nnne Fontaine
Bolero. pptx . Film   de  A nnne FontaineBolero. pptx . Film   de  A nnne Fontaine
Bolero. pptx . Film de A nnne FontaineTxaruka
 
MaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptMaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptssusercbaa22
 
presentation l'interactionnisme symbolique finale.pptx
presentation l'interactionnisme symbolique  finale.pptxpresentation l'interactionnisme symbolique  finale.pptx
presentation l'interactionnisme symbolique finale.pptxMalikaIdseaid1
 
Cours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptxCours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptxlamourfrantz
 
Fondation Louis Vuitton. pptx
Fondation      Louis      Vuitton.   pptxFondation      Louis      Vuitton.   pptx
Fondation Louis Vuitton. pptxTxaruka
 
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptxSAID MASHATE
 

Dernier (15)

Formation M2i - Comprendre les neurosciences pour développer son leadership
Formation M2i - Comprendre les neurosciences pour développer son leadershipFormation M2i - Comprendre les neurosciences pour développer son leadership
Formation M2i - Comprendre les neurosciences pour développer son leadership
 
Evaluación Alumnos de Ecole Victor Hugo
Evaluación Alumnos de Ecole  Victor HugoEvaluación Alumnos de Ecole  Victor Hugo
Evaluación Alumnos de Ecole Victor Hugo
 
A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.
 
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
LA MONTÉE DE L'ÉDUCATION DANS LE MONDE DE LA PRÉHISTOIRE À L'ÈRE CONTEMPORAIN...
 
Guide Final de rédaction de mémoire de fin d'étude
Guide Final de rédaction de mémoire de fin d'étudeGuide Final de rédaction de mémoire de fin d'étude
Guide Final de rédaction de mémoire de fin d'étude
 
systeme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expertsysteme expert_systeme expert_systeme expert
systeme expert_systeme expert_systeme expert
 
Présentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptxPrésentation de cartes d'extension zhr..pptx
Présentation de cartes d'extension zhr..pptx
 
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxApproche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
 
Pâques de Sainte Marie-Euphrasie Pelletier
Pâques de Sainte Marie-Euphrasie PelletierPâques de Sainte Marie-Euphrasie Pelletier
Pâques de Sainte Marie-Euphrasie Pelletier
 
Bolero. pptx . Film de A nnne Fontaine
Bolero. pptx . Film   de  A nnne FontaineBolero. pptx . Film   de  A nnne Fontaine
Bolero. pptx . Film de A nnne Fontaine
 
MaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptMaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.ppt
 
presentation l'interactionnisme symbolique finale.pptx
presentation l'interactionnisme symbolique  finale.pptxpresentation l'interactionnisme symbolique  finale.pptx
presentation l'interactionnisme symbolique finale.pptx
 
Cours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptxCours-irrigation_et_drainage_cours1.pptx
Cours-irrigation_et_drainage_cours1.pptx
 
Fondation Louis Vuitton. pptx
Fondation      Louis      Vuitton.   pptxFondation      Louis      Vuitton.   pptx
Fondation Louis Vuitton. pptx
 
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
 

Contador cc

  • 1. ;CONTADOR UP/DOWN LIST P=16F88 #INCLUDE <P16F88.INC> ; ======================= DIRECTIVA DE CONFIGURACION DE FUSIBLES ============== __ CONFIG _CONFIG1, _XT_OSC & _MCLR_ON & _LVP_OFF & _CP_OFF & _WDT_OFF ;FUSIBLES MAS IMPORTANTES ;NO OLVIDAR ACTIVAR _MCLR_ON ; ======================= DECLARAR FSR A UTILIZAR ============================== TRISA EQU 0X85 TRISB EQU 0X86 PORTA EQU 0X05 PORTB EQU 0X06 ;======================= DECLARAR PGR A UTILIZAR ============================== DELAY1 EQU 0X20 DELAY2 EQU 0X21 ;=================================== INICIO DEL PROGRAMA ================================= RESET ORG 0X00 GOTO PREINICIO ORG 0X05 ;====================================== RUTINA DE RETARDO =================================== RETARDO MOVLW D'150' MOVWF DELAY1 TOP2 MOVLW D'150' MOVWF DELAY2 TOP1 DECFSZ DELAY2 GOTO TOP1 DECFSZ DELAY1 GOTO TOP2 RETLW 0X00
  • 2. ;================================== CONFIGURACION DE PREINICIO ============================= PREINICIO MOVLW 0X20 MOVWF STATUS ;ME UBICOEN EL BANCO 1 PARA CONFIGURAR PUERTOS MEDIANTE TRISA Y TRISB CLRF TRISB MOVLW 0XFF MOVWF TRISA CLRF ANSEL ;CONFIGURANDO PUERTO A COMO E/S DIGITAL MOVLW 0X07 MOVWF CMCON CLRF STATUS ;RETORNO AL BANCO 0 CLRF PORTA CLRF PORTB ;================================= INICIO DEL PROGRAMA ====================================== INICIO BTFSS PORTA,0X0 ;PREGUNTA SI EL CLOCK SE ACTIVA O NO GOTO INICIO CALL RETARDO ;RETARDO PARA ELIMINAR LOS REBOTES BTFSS PORTA,0X1 ;PREGUNTA SI LA CUENTA ES UP/DOWN GOTO DECREMENTO INCREMENTO INCF PORTB,D GOTO PREGUNTA DECREMENTO DECF PORTB,D PREGUNTA BTFSC PORTA,0X0 GOTO PREGUNTA GOTO INICIO ;============================ DIRECTIVA DE FIN DE PROGRAMA ==================== END