Programación de un teclado con Pic Simulator Ide, PIC 16F877A.

Programación de un teclado matricial del 1-9 en Pic Simulator Ide, ademas de la simulación en un Pic 16F877A en Proteus:

Programa:

TRISA = 0
TRISC = 255
TRISD = 0
PORTD = 255

main:

PORTA.0 = 1
tres: If PORTC.0 = 1 Then
PORTD = 110000
Goto tres
Else
seis: If PORTC.1 = 1 Then
PORTD = 000010
Goto seis
Else
nueve: If PORTC.2 = 1 Then
PORTD = 010000
Goto nueve
Endif
Endif
Endif

PORTA.0 = 0
PORTA.1 = 1
dos: If PORTC.0 = 1 Then
PORTD = %10100100
Goto dos
Else
cinco: If PORTC.1 = 1 Then
PORTD = %10010010
Goto cinco
Else
ocho: If PORTC.2 = 1 Then
PORTD = %10000000
Goto ocho
Endif
Endif
Endif

PORTA.1 = 0
PORTA.2 = 1
uno: If PORTC.0 = 1 Then
PORTD = %11111001
Goto uno
Else
cuatro: If PORTC.1 = 1 Then
PORTD = %10011001
Goto cuatro
Else
siete: If PORTC.2 = 1 Then
PORTD = %11111000
Goto siete
Endif
Endif
Endif

PORTA.2 = 0

PORTD = 255
Goto main
End

Simulación en Proteus:








Comments

Popular posts from this blog

IPVT GRATIS MEDIANTE VLC CON LISTA-2 M3U

Diseño Antena Logaritmica Microstrip de 10-20 GHz en Ansoft Dessigner.

VoIP en Cisco Packet Tracer con dial peer.