jimmyvarghese143
New Member
Code:
#include <pic.h>
void main(void)
{
int tmp;
TRISB = 0b00000000;
RBPU = 0; // Use internal pullups
T0IE = 1; // Enable interrupt on TMR0 overflow
INTEDG = 1; // falling edge trigger the interrupt
INTE = 1; // enable the external interrupt
GIE = 1; // Global interrupt enable
tmp=1;
for(;;)
{
CLRWDT(); // Idly kick the dog
}
}
static void interrupt
isr(void) // Here be interrupt function - the name is unimportant.
{
if(T0IF==1)
{
if(tmp==1)
{
PORTD=map[i];
RB3=1;
T0IF=0;
}
else if(tmp==2)
{
PORTD=map[i];
RB3=0;
RB2=1;
T0IF=0;
}
else if(tmp==4)
{
PORTD=map[i];
RB2=0;
RB1=1;
T0IF=0;
}
else if(tmp==8)
{
PORTD=map[i];
RB1=0;
RB0,1;
T0IF=0;
}
tmp=0;
tmp=1;
}
}
//*************************************************************
here i am trying do make a multiplexed display in intrpt.but while compling i am getting somany error.i dont knw to use intrpt an d i dont whethr the program is correct or not.
Last edited: