No encuentro el error en un programa tan sencillo como el que esta a continuacion:
#include <htc.h>
#include <pic.h>
#include "lcd.h"
#include "delay.h"
#include "stdio.h"
#include "stdlib.h"
__CONFIG(XT & WDTDIS & PWRTDIS & LVPDIS & DEBUGDIS & UNPROTECT );
void mostrar_int(int val);
void retardo(int n);
bit banderasssTMR1=0;
int aux=0;
void main(){
GIE=1;
T1CON=0;
TMR1H=0;
TMR1L=0;
TMR1ON=1;
TMR1IE=1;
TMR1IF=1;
lcd_init();
lcd_goto(0x00);
while(1){
if(banderasssTMR1==1){
banderasssTMR1=0;
lcd_goto(0x00);
mostrar_int(45);
}
//lcd_goto(0x00);
//mostrar_int(TMR1H);
}
}
void retardo(int n){
for(int i=0;i<=n;i++){
DelayMs(100);
}
}
void mostrar_int(int val){
int n=5;
if(val<10)n=1;
else if(val<100)n=2;
else if(val<1000)n=3;
else if(val<10000)n=4;
else if(val<100000)n=5;
char buf[10];
int base=10;
itoa(buf,val,base);
for(int i=0; i<n;i++){
lcd_putch(buf);
}
}
void interrupt ISR(void){
if(TMR1IF==1){
TMR1IF=0;
banderasssTMR1=1;
}
}
simplemente corro el programa y no hace nada
#include <htc.h>
#include <pic.h>
#include "lcd.h"
#include "delay.h"
#include "stdio.h"
#include "stdlib.h"
__CONFIG(XT & WDTDIS & PWRTDIS & LVPDIS & DEBUGDIS & UNPROTECT );
void mostrar_int(int val);
void retardo(int n);
bit banderasssTMR1=0;
int aux=0;
void main(){
GIE=1;
T1CON=0;
TMR1H=0;
TMR1L=0;
TMR1ON=1;
TMR1IE=1;
TMR1IF=1;
lcd_init();
lcd_goto(0x00);
while(1){
if(banderasssTMR1==1){
banderasssTMR1=0;
lcd_goto(0x00);
mostrar_int(45);
}
//lcd_goto(0x00);
//mostrar_int(TMR1H);
}
}
void retardo(int n){
for(int i=0;i<=n;i++){
DelayMs(100);
}
}
void mostrar_int(int val){
int n=5;
if(val<10)n=1;
else if(val<100)n=2;
else if(val<1000)n=3;
else if(val<10000)n=4;
else if(val<100000)n=5;
char buf[10];
int base=10;
itoa(buf,val,base);
for(int i=0; i<n;i++){
lcd_putch(buf);
}
}
void interrupt ISR(void){
if(TMR1IF==1){
TMR1IF=0;
banderasssTMR1=1;
}
}
simplemente corro el programa y no hace nada