Sheritronics
Newbie level 6
- Joined
- Feb 1, 2014
- Messages
- 12
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 80
I am a beginner to the programming can any one help me why the code below is not working i have to make a sequential led circuit on portE and portB, I am using pic16f877a in Mplab 8.76
Code ASM - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 DELAY EQU 0x20 DELAY2 EQU 0x21 DELAY3 EQU 0x22 start: ORG 0x00 #INCLUDE "P16F877A.INC" __CONFIG _WDT_OFF main: BSF 0X03,5 MOVLW B'00000000' MOVWF 0X86 MOVWF 0x89 red: BCF 0x03,5 MOVLW B'00000001' MOVWF 0x06 MOVLW B'00000100' MOVWF 0x09 CALL delay yellow: RLF 0x06,F RRF 0x09,F CALL delay green: RLF 0x06,F RRF 0x09,F CALL delay GOTO fin delay: MOVLW D'50' MOVWF DELAY loop1: DECFSZ DELAY GOTO loop1 MOVWF DELAY loop2: DECFSZ DELAY2 GOTO loop2 MOVWF DELAY3 loop3: DECFSZ DELAY3 GOTO loop3 RETURN fin GOTO red END
Last edited by a moderator: