2007-05-13 08:11 AM
2007-05-13 05:28 AM
Hi,
I use PC3 for comunicate with sensor. I send 8 bit(PC3 Output) and I wait the ACK bit. The sensor must set low PC3 pin. I have setting PC3 input-floating and I have enable input capture with: TempVar=TBCSR; //remove pending int TBCR1 = ICIE; //enable interrupt After last istruction the interrupt occurred.( :o ) In my routing I have write: if(TBCSR & ICF1) //for reset the interrupt but I am locked inside interrupt! Where is the error? Thanks!2007-05-13 08:11 AM
I have foud! :D
I write the solution for other people. Before enable the interrupt I must remove the pending int with 2 istruction: tmp0=TBCSR; tmp0=TBIC1LR; and after enable the int: TBCR2= 0x00; TBCR1 =ICIE; In the interrupt routine I must remove the interrupt in same way: #pragma TRAP_PROC void timerB_handler(void) { if(TBCSR & ICF1) { tmp0= TBIC1LR; .... Bye bye