Kubilay
Newbie level 4
DEAR FRIENDS
I'M USING PIC 16F84A, AND CODING WITH MPLAB V8.87 AND I WANT LCD TO COUNT "0" TO "F"
YOU KNOW 0,1,2,...,D,E,F
HERE IS MY CODE
WHAT IS WRONG
IT DOES NOT WORK PROPERLY
I'M USING PIC 16F84A, AND CODING WITH MPLAB V8.87 AND I WANT LCD TO COUNT "0" TO "F"
YOU KNOW 0,1,2,...,D,E,F
HERE IS MY CODE
WHAT IS WRONG
IT DOES NOT WORK PROPERLY
Code:
LIST P=PIC16F84A
__CONFIG_XC_OSC
STATUS EQU 0X03
PORTA EQU 0X05
PORTB EQU 0X06
TRISA EQU 0X85
TRISB EQU 0X86
SAYAC EQU 0X0C
BSF STATUS,5
BSF TRISB,0
CLRF TRISA
BCF STATUS,5
CLRF SAYAC
CLRF PORTA
GENEL
CLRWDT
BTFSS PORTB,0
GOTO GENEL
MOVF SAYAC,W
CALL TABLO
MOVWF PORTA
INCF SAYAC,F
GOTO TEST
TEST
CLRWDT
BTFSS PORTB,0
GOTO GENEL
GOTO TEST
TABLO
ADDWF PCL,F ;PCL(program counter) + W >>PCL
RETLW B'00111111' ;segmen data 0 >> W (PCL+0)
RETLW B'00000110' ;segmen data 1 >> W (PCL+1)
RETLW B'01011011' ;segmen data 2 >> W (PCL+2)
RETLW B'01001111' ;segmen data 3 >> W (PCL+3)
RETLW B'01100110' ;segmen data 4 >> W (PCL+4)
RETLW B'01101101' ;segmen data 5 >> W (PCL+5)
RETLW B'01111101' ;segmen data 6 >> W (PCL+6)
RETLW B'00100111' ;segmen data 7 >> W (PCL+7)
RETLW B'01111111' ;segmen data 8 >> W (PCL+8)
RETLW B'01101111' ;segmen data 9 >> W (PCL+9)
CLRF SAYAC
RETURN GENEL
goto $
END