koolguy
Active Member
Hello,
I have done 2 digit counter successfully with E2PROm of PIC16F877a in H tech c code.
but i have problem with 3 digit after 99 something like that the middle display get suck and brightness is now also issue.
here is my code and i am scanning it as usual
please suggest if something is wrong in it...
I have done 2 digit counter successfully with E2PROm of PIC16F877a in H tech c code.
but i have problem with 3 digit after 99 something like that the middle display get suck and brightness is now also issue.
here is my code and i am scanning it as usual
please suggest if something is wrong in it...
C:
TRISB = 0X00 ;
TRISC = 0B00000011 ;
unsigned int a=0;
unsigned int b=0;
unsigned int div;
unsigned int rem;
while(1){
b=eeprom_read(0x00);
PORTC=0b10000000;
rem = a%10;
PORTB=data[rem];
__delay_ms(5);
PORTC=0b01000000;
div=a/10;
PORTB=data[div];
__delay_ms(5);
PORTC=0b00100000;
div=a/100;
PORTB=data[div];
__delay_ms(5);
if(RC0==1){
__delay_ms(100);
a=a+1;
// eeprom_write(0x00, a);
if(a>999){
a=999;
}}
if(RC1==1){
__delay_ms(100);
//eeprom_write(0x00, a);
a=a-1;
if(a>999){
a=0;
}
}
}
}