Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For PIC 1 6 F 6 2 8 A a ) There are two traffic lights in the Proteus file and they have red, yellow
For PICFA
a There are two traffic lights in the Proteus file and they have red, yellow and green LEDs. Among these LEDs, the ones for the vehicle are placed on the thst and nd pins of PORTB, respectively; The ones for the pedestrian are connected to the rdth and th pins, respectively. While the time allowed for traffic on the road to pass is seconds, the time allowed for pedestrians to pass is seconds. The duration of the yellow light that will turn on when switching from red to green and from green to red is second.
b There is also a button for pedestrians. While the green light is on for vehicles and the red light is on for pedestrians, when pedestrians press this button, vehicle traffic will stop and it will turn green for pedestrians and red for vehicles.
I can't set the delay time in item a and I couldn't do item b
My codes :
LIST PFA
INCLUDE PFAINC"
CONFIG INTRCOSCNOCLKOUT & WDTOFF & PWRTEON & MCLREON & BODENOFF & LVPOFF & CPOFF
;
SAYAC EQU h
SAYAC EQU h
DALLAN EQU h
BL EQU h
ORG h ;Program kodlarnn balangc
BANKSEL TRISB ;BANKe ge
CLRF TRISB ;PortB'nin tm ulark
MOVLW HFF ;W hFF
MOVWF TRISA ;PortA'nn tm ular giri
BANKSEL PORTB ;BANKa ge
MOVLW h ;W saklaycya b ykle
MOVWF CMCON ;PORTA girileri dijital IO
CLRF PORTB ;PortB'yi sfrla
BASLA
MOVLW h ;b saysn W'ye ykle
MOVWF DALLAN ;DALLAN W
DONGU
MOVF DALLAN, W ;W DALLAN
ANDLW B ;W'nin st drt bitini sfrla
CALL CEVSEG ;Kod evirme alt programnar
MOVWF PORTB ;Kodu segment displayde gster
INCF DALLAN, F ;DALLAN DALLAN
MOVF DALLAN, W ;
MOVWF BL ;
MOVLW hF ; W saklaycsna ykle
SUBWF DALLAN, f ; WBLW
BTFSC STATUS, Z ; ZERO BACAI SE ATLA
GOTO BASLA ; DONGU YE GT
MOVF BL W ;
MOVWF DALLAN ;
CALL GECIKME ;Gecikme yap
BTFSS PORTA, ;PortA'nn bit'i m
CALL YAYA
GOTO DONGU ;Yeni bir say iin baa dn
YAYA
MOVLW h ;b saysn W'ye ykle
MOVWF DALLAN ;DALLAN W
CEVSEG
ADDWF PCLF ;PCLPCLWDALLAN
RETLW h ;
RETLW h ;
RETLW h ;
RETLW h ;
RETLW h ;
RETLW h ;
RETLW h ;
RETLW h ;
RETLW h ;
RETLW h ;
RETLW hC ;A
RETLW hC ;b
RETLW hC ;C
RETLW h ;d
RETLW h ;E
RETLW h ;F
GECIKME ;Gecikme alt program
MOVLW hFF
MOVWF SAYAC
DONGU
MOVLW hFF
MOVWF SAYAC
DONGU
DECFSZ SAYAC F
GOTO DONGU
DECFSZ SAYAC F
GOTO DONGU
RETURN
END
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started