PRACTICA DE MICROCONTROLADORES Y LABORATORIO 1. Realizar un efecto de luces con leds, y un pulsador el cual controle dos funciones 1ro si el pulsador no se encuentre presionado los leds deben realizar el conteo de bits, 2do si el pulsador esta presionado los leds deben mostrar su complemento. 2 C1 22pF X1 4MHz 1 C2 U2 22pF 13 14 2 3 4 5 6 7 R1 8 9 10 10k 1 RESET RN2 OSC1/CLKIN OSC2/CLKOUT RB0/INT RB1 RB2 RB3/PGM RB4 RB5 RB6/PGC RB7/PGD 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 33 34 35 36 37 38 39 40 15 16 17 18 23 24 25 26 19 20 21 22 27 28 29 30 U1 1 2 3 4 5 6 7 8 16 15 14 13 12 11 10 9 220 1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 LED-BARGRAPH-RED R2 10k PIC16F877A 2. Realizar un semáforo el cual se encenderá por 5 segundos un conjunto de leds formando una “X”, después por 3 segundos se encenderán los leds amarillos formando un rectángulo y al final se encenderá un conjunto de leds verdes formando una flecha durante 5 segundos. U1 13 14 2 3 4 5 6 7 R23 10k 8 9 10 1 OSC1/CLKIN OSC2/CLKOUT RB0/INT RB1 RB2 RB3/PGM RB4 RB5 RB6/PGC RB7/PGD 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 R1 R2 330 R3 330 R4 330 R5 330 R6 330 R7 330 R8 33 34 35 36 37 38 39 40 15 16 17 18 23 24 25 26 19 20 21 22 27 28 29 30 R17 R18 330 R19 330 R20 330 R21 330 R22 330 330 330 330 D1 D7 LED-RED LED-RED D2 D5 LED-RED LED-RED D3 D6 LED-RED LED-RED D4 D8 LED-RED LED-RED D11 D9 R9 R10 330 R11 330 R12 330 R13 330 R14 330 R15 330 R16 LED-YELLOW LED-YELLOW D12 D10 LED-YELLOW LED-YELLOW 330 330 D13 D15 LED-YELLOW LED-YELLOW D14 D16 LED-YELLOW LED-YELLOW D20 D17 D18 LED-GREEN D22 D19 LED-GREEN LED-GREEN LED-GREEN D21 LED-GREEN LED-GREEN 3. Realizar un contador con display de 7 segmentos. De 0-9.Utilizando la herramienta Seven segment editor de mikroc. U1 13 14 2 3 4 5 6 7 R23 8 9 10 10k 1 OSC1/CLKIN OSC2/CLKOUT RB0/INT RB1 RB2 RB3/PGM RB4 RB5 RB6/PGC RB7/PGD 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 33 34 35 36 37 38 39 40 R1 R2 330 R3 330 R4 330 R5 330 R6 330 R7 330 330 15 16 17 18 23 24 25 26 19 20 21 22 27 28 29 30 PIC16F877A 4. Realizar un contador con dos displays de 7 segmentos independientes, que cuente de 0 a 30 y al final encienda un led que parpadee 5 veces. U1 13 14 2 3 4 5 6 7 R23 10k 8 9 10 1 OSC1/CLKIN OSC2/CLKOUT RB0/INT RB1 RB2 RB3/PGM RB4 RB5 RB6/PGC RB7/PGD 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 33 34 35 36 37 38 39 40 R1 R2 330 R3 330 R4 330 R5 330 R6 330 R7 330 330 15 16 17 18 23 24 25 26 19 20 21 22 27 28 29 30 R8 R9 330 R10 330 R11 330 R12 330 R13 330 R14 330 330 5. Realizar un conversor de valor decimal y hexadecimal, haciendo uso de la pantalla LCD y un dip-switch de 8. LCD1 C1 D0 D1 D2 D3 D4 D5 D6 D7 7 8 9 10 11 12 13 14 RS RW E 4 5 6 1 2 3 VSS VDD VEE LM016L RV1 2 1k 22pF 77% X1 4MHz 1 C2 U2 2 3 4 5 6 7 R1 10k RESET 8 9 10 1 OSC1/CLKIN OSC2/CLKOUT RB0/INT RB1 RB2 RB3/PGM RB4 RB5 RB6/PGC RB7/PGD 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 15 16 17 18 23 24 25 26 19 20 21 22 27 28 29 30 RP1 10k 1 2 3 4 5 6 7 8 RD0/PSP0 RD1/PSP1 RD2/PSP2 RD3/PSP3 RD4/PSP4 RD5/PSP5 RD6/PSP6 RD7/PSP7 33 34 35 36 37 38 39 40 1 13 14 9 8 7 6 5 4 3 2 22pF ON PIC16F877A DSW1 9 OFF DIPSWC_8 6. Con la matriz de leds escribir la palabra ELECTRONICA, y hacer que la palabra se desplace de izquierda a derecha. EN 15 A B C D 10 11 14 13 EN X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 9 8 7 6 5 4 3 2 23 22 21 20 19 18 17 16 15 10 11 14 13 A B C D X 1 1 X 9 8 7 6 5 4 3 2 23 22 21 20 19 18 17 16 15 EN 4067 X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 U4 4067 A B C D X U3 4067 10 11 14 13 EN U2 4067 X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 A B C D U1 9 8 7 6 5 4 3 2 23 22 21 20 19 18 17 16 15 10 11 14 13 9 8 7 6 5 4 3 2 23 22 21 20 19 18 17 16 X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X 1 1 +5v +5v 6 5 4 E1 E2 LE 74HC137 U7 2 3 4 5 6 7 14 13 A B C D A1 B1 33 34 35 36 37 38 39 40 18 RA0/AN0 RC0/T1OSO/T1CKI RA1/AN1 RC1/T1OSI/CCP2/UOE RA2/AN2/VREF-/CVREF RC2/CCP1/P1A RA3/AN3/VREF+ RC4/D-/VM RA4/T0CKI/C1OUT/RCV RC5/D+/VP RA5/AN4/SS/LVDIN/C2OUT RC6/TX/CK RA6/OSC2/CLKO RC7/RX/DT/SDO OSC1/CLKI RB0/AN12/INT0/FLT0/SDI/SDA RB1/AN10/INT1/SCK/SCL RB2/AN8/INT2/VMO RB3/AN9/CCP2/VPO RB4/AN11/KBI0/CSSPP RB5/KBI1/PGM RB6/KBI2/PGC RB7/KBI3/PGD VUSB PIC18F4550 RD0/SPP0 RD1/SPP1 RD2/SPP2 RD3/SPP3 RD4/SPP4 RD5/SPP5/P1B RD6/SPP6/P1C RD7/SPP7/P1D RE0/AN5/CK1SPP RE1/AN6/CK2SPP RE2/AN7/OESPP RE3/MCLR/VPP 15 16 17 23 24 25 26 19 20 21 22 27 28 29 30 8 9 10 1 Y3 Y0 Y1 Y2 Y3 Y2 15 14 13 12 11 10 9 7 Y1 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y0 A B C A B C D U5 1 2 3 A1 B1