-
-
Save TheMrRafus/5c2f68613541b14838924ff03039d890 to your computer and use it in GitHub Desktop.
LED PIC16F84A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Programa que simplemente enciende un LED conectado a RB0 | |
LIST P=16F84A ;Declaramos el uC a usar | |
include "p16f84a.inc" ;Incluimos la hoja de definiciones para ese uC | |
__CONFIG _XT_OSC & _WDT_OFF ;Declaramos la palabara de configuracion del uC | |
ORG 0 | |
goto inicio | |
ORG 5 | |
inicio | |
banksel TRISB ;Nos desplazamos al banco dónde está TRISB | |
clrf TRISB ;Limpiamos TRISB,por si hubiera algo aún definido, y de paso lo ponemos como salida | |
;Si pusieramos el bit correspondiente de TRISB a 1,el puerto correspondiente en PORTB sería entrada | |
banksel PORTB ;Volvemos al banco dónde esta PORTB | |
clrf PORTB ;Limnpiamos PORTB, por si hubiera algo definido previamente | |
bsf PORTB,RB0 ;Activamos el bit 0 de PORTB, iluminando el LED | |
espera ;Bucle infinito intencionalmente puesto, para que no se apague el led | |
goto espera | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment