Professional Documents
Culture Documents
Informeexamen
Informeexamen
7/1
CIRCUITO SEMAFORO
CIRCUITO DISPLAY
Con un pulsador
Código mplab
LIST p=16F84A ;
#include "P16F84A.INC" ;
CBLOCK 0x10
state
l1,l2
ENDC
org 0
goto PUERTO
org 4
PUERTO clrw
movwf PORTA
movwf PORTB
bsf STATUS,RP0
clrw
movwf TRISB
bcf STATUS,RP0
INICIO clrw
movwf state
movwf PORTB
incf state,W
andlw 0x03
movwf state
call wait
goto loop
addwf PCL,F
retlw 0x41
retlw 0x23
retlw 0x14
retlw 0x32
wait movlw 5
movwf l1
w1 call wait2
decfsz l1
goto w1
return
wait2 clrf l2
w2 decfsz l2
goto w2
return
END