AnsweredAssumed Answered

have a problem with using the Timer1 interrupt with External interrupt IRQ1 AND IIC SLAVE interrupt on the ADuC7023

Question asked by Caozhengou on Mar 1, 2018
Latest reply on Mar 1, 2018 by Caozhengou

I want to use timer1 interrupt,IRQ1,and I2C_Slave interrupt In my project.When I disable the IRQ1 INT,the other tow interrupts run properly.But,after I confgure  rising edge interrupts on IRQ1,the other tow  interrupts configured as before.My app doesn't run properly,It seems like it can not run to my functions in the "while". Here is my IRQ_HANDLER:

 

//CODE 

IRQSTATUS = IRQSTA;
if((IRQSTATUS & GP_TIMER_BIT) != 0) //Timer1 IRQ

{
T1CON = 0x00;//bit7:Timer1 Enable Bit. bit6:Timer1 Mode. Set by user to operate in periodic mode.bit[5:4]:Binary.bit[3:0]:Source Clock/32,768.
T1CLRI = 0;

 

 

T1LD =0x44;//4;//12;//4;//12;//0x3E;//0x7f;//0x3E; //12====10ms
// T1CLRI = 0;
T1CON = 0xC8;//bit7:Timer1 Enable Bit. bit6:Timer1 Mode. Set by user to operate in periodic mode.bit[5:4]:Binary.bit[3:0]:Source Clock/32,768.


// T1CON = 0xCF; //UCLK/16
}

if((IRQSTATUS & XIRQ0_BIT) != 0) //LPMODE
{


}
if((IRQSTATUS & XIRQ1_BIT) != 0) //MOD_DESEL
{

IRQCLRE =0X00010000;


//if(PIN_IN_MOD_DESEL_TRUE)
if(IIC_en == 1)
{

DISABLE_IIC;
IIC_en = 0;@@@@@

 

IRQCONE = 0X04;//0XC0;//External IRQ1 triggers on falling edge.
}
else if(IIC_en==0)
{
IIC_en = 1;
ENABLE_IIC;@
IRQCONE =0X00;// 0X80;//External IRQ1 triggers on rising edge.
}

//IRQCLR =XIRQ1_BIT;


}

 

Do you guys have any idea?

Outcomes