Código:
list p=16f877a
#include<p16f877a.inc>
__CONFIG _XT_OSC & _PWRTE_ON & _BODEN_OFF & _CP_OFF & _WDT_OFF
CBLOCK 0X20
T1
T2
T3
ENDC
ORG 0X0000
BCF STATUS, RP1
BSF STATUS, RP0
MOVLW B'00000000'
MOVWF TRISB
MOVWF TRISC
BCF STATUS, RP0
INICIO
BSF PORTB,0 ; PUERTO B VERDE
BCF PORTB,1 ; PUERTO B AMARILLO
BCF PORTB,2 ; PUERTO B ROJO
BCF PORTC,0 ; PUERTO C ROJO
BCF PORTC,1 ; PUERTO C AMARILLO
BSF PORTC,2 ; PUERTO C VERDE
BSF TRISD;0 ; PUERTO D BOTON RAPIDO
BSF TRISD;1; PUERTO D BOTON LENTO
PRESIONARCORTO
BTFSS PORTD,0 ; BOTON PARA PASAR CORTO
GOTO PRESIONARCORTO
BCF PORTB,0; APAGA VERDE PUERTO B
BCF PORTC,2; APAGA VERDE PUERTO C
CALL RETARDOPARPADEO ; 0.5 SEGUNDOS
BSF PORTB,0; PRENDE VERDE PUERTO B
BSF PORTC,2; PRENDE VERDE PUERTO C
CALL RETARDOPARPADEO ; 0.5 SEGUNDOS
BCF PORTB,0; APAGA VERDE PUERTO B
BCF PORTC,2; APAGA VERDE PUERTO C
CALL RETARDOPARPADEO ; 0.5 SEGUNDOS
BSF PORTB,0; PRENDE VERDE PUERTO B
BSF PORTC,2; PRENDE VERDE PUERTO C
CALL RETARDOPARPADEO ; 0.5 SEGUNDOS
BCF PORTB,0; APAGA VERDE PUERTO B
BCF PORTC,2; APAGA VERDE PUERTO C
BSF PORTB,1; PRENDE AMARILLO PUERTO B
BSF PORTC,1; PRENDE AMARILLO PUERTO C
CALL RETARDOCAMBIO ; 1 SEGUNDO
BCF PORTB,1; APAGA AMARILLO PUERTO B
BCF PORTC,1; APAGA AMARILLO PUERTO C
BSF PORTB,2; PRENDE ROJO PUERTO B
BSF PORTC,0; PRENDE ROJO PUERTO C
CALL RETARDOLARGO ; 5 SEGUNDOS
GOTO INICIO
PRESIONARLARGO
BTFSS PORTD,1; BOTON PARA PASAR LARGO
GOTO PRESIONARLARGO
Mensaje automáticamente combinado:
Hice este codigo para hacer 2 semaforos en una avenida, que se mantengan en verde y que cuando alguien presione un boton, comience la secuencia y se cambie a rojo, pero cuando intento compilarlo, me manda este error.
"C:\Program Files\Microchip\xc8\v2.31\bin\xc8-cc.exe" -c -mcpu=16F877A -mdfp="C:/Program Files/Microchip/MPLABX/v5.45/packs/Microchip/PIC16Fxxx_DFP/1.2.33/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/production/SemaforoEuropeo.o SemaforoEuropeo.asm
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
SemaforoEuropeo.asm:2:9: fatal error: 'p16f877a.inc' file not found