interruption
Posted: 05 Jun 2010 15:16
i have a program in microc in which i'll show a message throw a LCD 16*2 and i use an interruption of timer0 but the simulation in Proteus isis don't work
this is my program if there ara mistakes
unsigned cnt;
void interrupt()
{
cnt++; // Increment value of cnt on every interrupt
TMR0 = 96;
INTCON.INTF=0; // Set T0IE, clear T0IF
}
void main()
{
OPTION_REG = 0x84; // Assign prescaler to TMR0
TRISB = 0;
TMR0 = 96; // Timer0 initial value
INTCON = 0x90; // Enable TMRO interrupt
cnt = 0; // Initialize cnt
lcd_init(&PORTB); //initialisation de l'afficheur
do {
if (cnt == 400)
{
lcd_out(1,1,"A");
//delay_ms(1000);
cnt = 0; // Reset cnt
}
} while(1);
}
this is my program if there ara mistakes
unsigned cnt;
void interrupt()
{
cnt++; // Increment value of cnt on every interrupt
TMR0 = 96;
INTCON.INTF=0; // Set T0IE, clear T0IF
}
void main()
{
OPTION_REG = 0x84; // Assign prescaler to TMR0
TRISB = 0;
TMR0 = 96; // Timer0 initial value
INTCON = 0x90; // Enable TMRO interrupt
cnt = 0; // Initialize cnt
lcd_init(&PORTB); //initialisation de l'afficheur
do {
if (cnt == 400)
{
lcd_out(1,1,"A");
//delay_ms(1000);
cnt = 0; // Reset cnt
}
} while(1);
}