Posts

Showing posts with the label 16f877a

Generación de una Onda Cuadrada utilizando el PIC 16F877A en Pic Simulator IDE.

Image
A continuación se muestra el código para generar una onda cuadrada, asi como su simulacion en Proteus. OPTION_REG = 0x01 TRISB = 0x00 TMR0 = 250 INTCON.GIE = 1 INTCON.T0IE = 1 loop: PORTB.1 = 0 Goto loop End                                               On Interrupt PORTB.1 = 1 INTCON.T0IE = 1 INTCON.T0IF = 0 TMR0 = 250 Resume                       Simulación:                     

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

Image
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 Sim...