22.10.2014 Views

MANUAL DE MICROCONTROLADORES PIC

MANUAL DE MICROCONTROLADORES PIC

MANUAL DE MICROCONTROLADORES PIC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

en las salidas DCBA ( FIG. 5.1.1).<br />

FIG. 5.1.2 Distribución del teclado, numeración en filas y columnas y la fórmula<br />

para hallar la tecla oprimida<br />

En este experimento se realiza la emulación del integrado decodificador de teclado 74C922<br />

en cuanto a su funcionamiento, pero de acuerdo a la configuración de hardware de la FIG.<br />

5.1.1.<br />

Listado del programa para exploración de teclado:<br />

list p=16f84<br />

#include ;archivo de encabezado por Microchip®<br />

;<br />

;ESTE PROGRAMA EMULA UN 74C922 <strong>DE</strong>CODIFICADOR <strong>DE</strong> TECLADO<br />

;<br />

CONTFIL EQU 0x12 ;Contador de Filas<br />

CONTCOL EQU 0x13 ;Contador de Columnas<br />

COLKBD EQU 0x14 ;DATO EN COLUMNAS<br />

Temp EQU 0x15<br />

R1 EQU 0x16 ;Variable para Retardo<br />

R2 EQU 0x17 ;Variable para Retardo<br />

R3 EQU 0x18 ;Variable para Retardo<br />

R4 EQU 0x19 ;Variable para Retardo<br />

COUNT EQU 0x1A<br />

CHAR EQU 0x1B ;Almacenamiento temporal SCAN<br />

AUX EQU 0x1C ;Variable Auxiliar<br />

#define _z STATUS,2<br />

#define _c STATUS,0<br />

#define OE PORTA,4<br />

#define BANK0 bcf STATUS,RP0<br />

#define BANK1 bsf STATUS,RP0<br />

;<br />

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::<br />

ORG 0x00<br />

MAIN

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!