You are on page 1of 2

El programa del PIC lo realice en lenguaje C en el compilador CCS C, la

simulacin en proteus y el PCB en PCBWizard. El circuito se debe alimentar con


una fuente de 5v.
CDIGO:
#include <16f887.h>
#fuses hs,wdt
#use delay(clock=800000)
#byte trisb=0x86
#byte trisc=0x87
#byte trisd=0x88
#byte portb=0x06
#byte portc=0x07
#byte portd=0x08
byte display[10]={0x7B,0x0A,0xB3,0x9B,0xCA,0xD9,0xF9,0x0B,0xFB,0xDB};
byte display_2[10]={0x7B,0x0A,0xB3,0x9B,0xCA,0xD9,0xF9,0x0B,0xFB,0xDB};
int8 a;
int8 b;
void main(){
trisd=0x00;
trisc=0xff;
trisb=0x00;
inicio:
portd=display[0];
portb=display_2[0];
while(true){
if (bit_test(portc,1)==1){
delay_us(100);
a++;
p1:
if(bit_test(portc,1)==1){
portd=display[a];
goto p1;
}
}
if(a==10){
a=0;
b++;
portb=display_2;
}
if((b==10)||(bit_test(portc,2)==1)){

a=0;
b=0;
goto inicio;
}
}
}

You might also like