En fin, ahora tengo tiempo y te lo he solucionado, pero que no cunda el ejemplo eh!
Codigo:
#include <16f84a.h>
#use delay(clock=4000000)
#include <Lcd84sinRB0.c> //16f84 con RB0 libre
int contador=0;
int timer1s=0;
int timer=0;
int tim=0;
#int_TIMER0
TIMER0_isr()
{
timer++;
if(timer==250) // 2,048ms · 250= 512ms
{
timer=0;
timer1s++;
}
if(timer1s==10) // 512ms · 10= 5,1s
{
lcd_putc("f");
switch (contador)
{
case 0: lcd_putc("0 PULSOS
");
break;
case 1: lcd_putc("1 PULSO
");
break;
case 2: lcd_putc("2 PULSOS
");
break;
case 3: lcd_putc("3 PULSOS
");
break;
case 4: lcd_putc("4 PULSOS
");
break;
case 5: lcd_putc("5 PULSOS
");
break;
case 6: lcd_putc("6 PULSOS
");
break;
case 7: lcd_putc("7 PULSOS
");
break;
case 8: lcd_putc("8 PULSOS
");
break;
case 9: lcd_putc("9 PULSOS
");
break;
case 10: lcd_putc("10 PULSOS
");
break;
case 11: lcd_putc("11 PULSOS
");
break;
case 12: lcd_putc("12 PULSOS
");
break;
default: lcd_putc("MAS DE 12 PULSOS
");
break;
}
contador=0;
timer1s=0;
}
}
void main()
{
lcd_init();
setup_timer_0(RTCC_INTERNAL | RTCC_DIV_8);
enable_interrupts(GLOBAL);
while(1)
{
while(!input(PIN_A0)); // Esperar flanco ascendente
while(input(PIN_A0)); // Esperar flanco descendente
enable_interrupts(INT_TIMER0);
contador++;
}
}
Un saludo