#define digit1 PORTE.F0
#define digit2 PORTE.F1
unsigned char segment[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
unsigned char i1,i2,i3,i4,i5,i6;
void interrupt()
{
i6++;
if(i6>9)
{
i6=0;
i5++;
}
if(i5>9)
{
i5=0;
i4++;
}
if(i4>9)
{
i4=0;
i3++;
}
if(i3>5)
{
i3=0;
i2++;
}
if(i2>9)
{
i2=0;
i1++;
}
if(i1>5)i1=0;
TMR3H=0xD8;
TMR3L=0xF0;
PIR2.TMR3IF=0;
}
void main()
{
TRISB=0;
TRISC=0;
TRISD=0;
TRISE=0;
T3CON=0x80;
TMR3H=0xD8;
TMR3L=0xF0;
PIE2.TMR3IE=1;
PIR2.TMR3IF=0;
INTCON.PEIE=1;
INTCON.GIE=1;
T3CON.TMR3ON=1;
while(1)
{
digit1=0;digit2=1;
PORTC=segment[i1];
PORTD=segment[i3];
PORTB=segment[i5];
delay_ms(15);
digit1=1;digit2=0;
PORTC=segment[i2];
PORTD=segment[i4];
PORTB=segment[i6];
delay_ms(15);
}
}
#define digit2 PORTE.F1
unsigned char segment[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
unsigned char i1,i2,i3,i4,i5,i6;
void interrupt()
{
i6++;
if(i6>9)
{
i6=0;
i5++;
}
if(i5>9)
{
i5=0;
i4++;
}
if(i4>9)
{
i4=0;
i3++;
}
if(i3>5)
{
i3=0;
i2++;
}
if(i2>9)
{
i2=0;
i1++;
}
if(i1>5)i1=0;
TMR3H=0xD8;
TMR3L=0xF0;
PIR2.TMR3IF=0;
}
void main()
{
TRISB=0;
TRISC=0;
TRISD=0;
TRISE=0;
T3CON=0x80;
TMR3H=0xD8;
TMR3L=0xF0;
PIE2.TMR3IE=1;
PIR2.TMR3IF=0;
INTCON.PEIE=1;
INTCON.GIE=1;
T3CON.TMR3ON=1;
while(1)
{
digit1=0;digit2=1;
PORTC=segment[i1];
PORTD=segment[i3];
PORTB=segment[i5];
delay_ms(15);
digit1=1;digit2=0;
PORTC=segment[i2];
PORTD=segment[i4];
PORTB=segment[i6];
delay_ms(15);
}
}