CONTADOR 3 DÍGITOS CON PULSADOR EN MICROBASIK

8
UNIVERSIDAD POLITECNICA SALESIANA LENIN VELÁSQUEZ ING. ELECTRONICA UNIVERSIDAD POLITECNICA SALESIANA SISTEMAS MICROPROCESADOS 1 PRUEBA NUMERO 1 Velásquez Lenin

Transcript of CONTADOR 3 DÍGITOS CON PULSADOR EN MICROBASIK

UNIVERSIDAD POLITECNICA SALESIANA LENIN VELSQUEZ ING. ELECTRONICA

UNIVERSIDAD POLITECNICA SALESIANA

SISTEMAS MICROPROCESADOS 1

PRUEBA NUMERO 1

Velsquez Lenin

UNIVERSIDAD POLITECNICA SALESIANA LENIN VELSQUEZ ING. ELECTRONICA

Enunciado: Cuando se presione un pulsador 3 veces inicie el contador desde 333 hasta el 367 en intervalos de 3, pero al momento que llegue a 367 comience a decrementar en 37 hasta llegar a 0. MATERIALES: Se realizo el amplificador inversor en el cual se necesitaba: 2 2 Pulsadores normalmente abierto 2 Capacitores de 33pF 3 Resistencias de 330 1 Cristal 4 MHz 1 Pic 16f877A 4 Display ctodo comn 1 TTL 7448

MARCO TERICO: Un microcontrolador es un circuito integrado o chip que incluye en su interior las tres unidades funcionales de una computadora: unidad central de procesamiento, memoria y unidades de E/S (entrada/salida). Las caractersticas del Pic 16f887A podemos encontrar como ya sabemos en los datasheet para poder saber las diferentes conexiones de este Microcontrolador. A continuacin mostraremos el circuito realizado al circuito ya funcionando.

UNIVERSIDAD POLITECNICA SALESIANA LENIN VELSQUEZ ING. ELECTRONICA

Diagrama:

C133p

X1CRYSTAL

U113 14 2 3 4 5 6 7 8 9 10 1 OSC1/CLKIN OSC2/CLKOUT RB0/INT RB1 RB2 RB3/PGM RB4 RB5 RB6/PGC RB7/PGD 33 34 35 36 37 38 39 40 15 16 17 18 23 24 25 26 19 20 21 22 27 28 29 30 7 1 2 6 4 5 3

U2A B C D BI/RBO RBI LT 74LS48 QA QB QC QD QE QF QG 13 12 11 10 9 15 14

C233p

R910k

RA0/AN0 RA1/AN1 RA2/AN2/VREF-/CVREF RA3/AN3/VREF+ RA4/T0CKI/C1OUT RA5/AN4/SS/C2OUT RC0/T1OSO/T1CKI RE0/AN5/RD RC1/T1OSI/CCP2 RE1/AN6/WR RC2/CCP1 RE2/AN7/CS RC3/SCK/SCL RC4/SDI/SDA MCLR/Vpp/THV RC5/SDO RC6/TX/CK RC7/RX/DT RD0/PSP0 RD1/PSP1 RD2/PSP2 RD3/PSP3 RD4/PSP4 RD5/PSP5 RD6/PSP6 RD7/PSP7 PIC16F877A

Q12N3904

Q22N3904

R110k

Q32N3904

UNIVERSIDAD POLITECNICA SALESIANA LENIN VELSQUEZ ING. ELECTRONICA

Programacion:' UNIVERSIDAD POLITECNICA SALESIANA // LENIN VELASQUEZ '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ '@@ @@@@@@@@ @@@ @@@@ @@@ @@@ @@@@ @@@@@@@ '@@ @@@@@@@@ @@@@@@@@@@ @@ @@@ @@@ @@ @@@@@@@ '@@ @@@@@@@@ @@@@@@@ @@ @@@ @@@ @@ @@@@@@@ '@@ @@@@@@@@ @@@@@@@@@@ @@@@@ @@@ @@@ @@@@@ @@@@@@@ '@@ @@@ @@@ @@@@@ @@@ @@@ @@@@@ @@@@@@@ '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ program LED_Blinking Dim A,B as byte Dim E,h as byte dim I as word Dim j as byte A=3 B=3 E=3 I=0 h=0 main1: TRISA=255 TRISB=0 TRISC=0 while true A=3 B=3 E=3 if porta.4=0 then verificar: if porta.4=0 then goto verificar end if h=h+1 if h=3 then goto comenzar end if end if wend comenzar: while true for j=0 to 100 Portc=1 PortB=A delay_us(2000) portc=2 portb=B delay_us(2000) portc=4 portb=E delay_us(2000) next j if i=0 then 'e primer display 'delay_us(32000) inc(E) inc(E) inc(E) if E>9 then E=E-10 inc(B) if B=10 then B=0 else if A=3 then ' primer display A= 3

UNIVERSIDAD POLITECNICA SALESIANA LENIN VELSQUEZ ING. ELECTRONICAend if end if end if I=0 if (B=6) then if E=3 then I=1 end if end if else 'delay_us(32000) if E