Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

inteerupt programming doubt

Status
Not open for further replies.
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:
could you say what error you got ?

give me more information about Error , compiler and on which PIC you are working
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top