sorry about that..
my coding..
void interrupt ISR()
{
if(TMR0IE==1&&TMR0IF==1)
{
t++; //increase counter by 1
if(t<s1){
motor1=1;
}
if(t<s2){
motor2=1;
}
if(t<s3){
motor3=1;
}
if(t<s4){
motor4=1;
}
if(t==s1){
motor1=0;
}
if(t==s2){
motor2=0;
}
if(t==s3){
motor3=0;
}
if(t==s4){
motor4=0;
}
if(t==1000) //Reset counter to 0
{
t=0;
}
TMR0IF=0; //Reset interrupt flag to 0
TMR0=250;
}
if (CCP4IE==1&&CCP4IF==1)
{
count1++;
CCP4IF=0;
if (count1==1)
{
t1=TMR1;
count1==1;
CCP4CON=0b00000100; //falling edge detection
}
if (count1==2)
{
t2=TMR1;
count1=0;
CCP4CON=0b00000101; //rising edge detection
}
TMR1=0;
}
if(CCP5IE==1 && CCP5IF==1)
{
count++;
CCP5IF=0;
if (count==1)
{
t11=TMR1;
count==1;
CCP5CON=0b00000100; //falling edge detection
}
if (count==2)
{
t22=TMR1;
count=0;
CCP5CON=0b00000101; //rising edge detection
}
TMR1=0;
}
}
With the CCP5 interrupt in the coding just wont run. it hangs.