Está en la página 1de 3

TRABAJO 3: CONTADOR DE PULSOS goto Sal3

btfss PORTB,5
LIST p=16F877A goto Sal3
#include "P16F877A.INC" nop
;contador de pulsos ;----------------------------------------------
org 0x000 SAL3 btfss PORTB,6
;......................................... goto Sal4
bsf STATUS,0 btfss PORTB,7
movlw 0xFF goto Sal4
movwf TRISB nop
movlw 0xFF ;----------------------------------------------
movwf TRISC SAL4 btfss PORTB,0
movwf TRISD goto Sal5
bcf STATUS,5 btfss PORTB,1
;......................................... goto Sal5
clrf PORTD bsf PORTD,7
INICIO ;----------------------------------------------
;.......................................... SAL5 btfss PORTB,0
Salida btfss PORTB,0 goto Sal6
goto Sal1 btfss PORTB,1
btfss PORTB,1 goto Sal6
goto Sal1 bsf PORTD,7
bsf PORTD,7 ;----------------------------------------------
;------------------------------------------- SAL5 btfss PORTB,0
SAL1 btfss PORTB,2 goto Salida
goto Sal2 btfss PORTB,1
btfss PORTB,3 goto Salida
goto Sal2 bsf PORTD,7
nop goto Salida
;---------------------------------------------- ;----------------------------------------------
SAL2 btfss PORTB,4 End
TRABAJO 2: EN ARDUINO MEGA // char customKey =
customKeypad.getKey();
//if (customKey != NO_KEY)
//#include <Keypad.h>;
{
char contrasena[]="2222";
// codigo[cont]=customKey;
char codigo[4];
Serial.print(codigo[cont]);
int cont=0;
cont=cont+1;
const byte ROWS = 4;
if(cont==4)
const byte COLS = 4;
{
char hexaKeys[ROWS][COLS] =
{
if(codigo[0]==contrasena[0]&&codig
{'1','2','3'}, o[1]==contrasena[1]&&codigo[2]==c
ontrasena[2]&&codigo[3]==contrase
{'4','5','6'},
na[3])
{'7','8','9'}
{
};
digitalWrite(13,!digitalRead(13));
Serial.println("Contraseña
byte rowPins[ROWS] = {9, 8, 7, 6}; correcta");
byte colPins[COLS] = {5, 4, 3, 2}; }
if(codigo!= contrasena)
//Keypad customKeypad = {
Keypad(makeKeymap(hexaKeys),
Serial.println("Contraseña
rowPins, colPins, ROWS, COLS);
incorrecta");
void setup()
}
{
cont=0;
pinMode(13, OUTPUT);
}
Serial.begin(9600);
}
}
}
void loop()
{
bsf PORTC,0
goto salint3
salint2 bcf PORTC,0
salint3 btfss PORTC,5
TRABAJO1: EN MPLAB goto Inicio
goto salint
nop
nop

LIST p=16F877A ;............................


#include ..
"P16F877A.INC" nop
flag equ 0x20 ;............................
tempe equ 0x21 ....
contador equ 0x22 end
;............................
.............
__CONFIG _HS_OSC & _WDT_OFF &
_LVP_OFF & _CPD_OFF &
_PWRTE_OFF
;............................
..
ORG 0X00
goto Inicio
ORG 0X04
goto salint
;........................
Inicio clrf PORTA
bsf STATUS,5
movlw 0xF0
movwf TRISC
movlw 0XA0
movwf INTCON
movlw 0x80
movwf OPTION_REG
bcf STATUS,5
bcf PORTC,0
movwf TRISC
movlw 0XF0
clrf TMR0
;............................
.....
Volver nop
goto Volver
;............................
......
salint incf contador
btfss contador,5
goto salint2

También podría gustarte