lebohangmaphothoane
Member
Hello!
can any one help me. I dont see why my circuit does not work. I am expecting a red light from the first trafic light to be on and the green light from the second traffic light to be on.
below is my code
I have attached the hex file and my traffic design of proteus
can any one help me. I dont see why my circuit does not work. I am expecting a red light from the first trafic light to be on and the green light from the second traffic light to be on.
below is my code
Code:
list P=16F877a
include "P16F877a.inc"
__config _RC_OSC & _WDT_OFF & _CP_OFF
;Declarations:
portb equ 06
org 1FF
goto Start
org 0
;Subroutines:
Init
clrw ; Zero.
movwf portb ;resets input/output ports
bsf STATUS,RP0 ; Select Bank 1
movlw b'00000000' ; Set port B bits as outputs
tris portb ; Set TRISB register.
bcf STATUS,RP0 ; Select Bank 0
retlw 0
;Program Start:
Start
call Init
Main
bsf portb,0 ;turn on the red light
bsf portb,1 ;turn on the green light
goto Main
END
Attachments
Last edited: