cancel
Showing results for 
Search instead for 
Did you mean: 

C interrupt pending after Reset

luter
Associate II
Posted on May 02, 2006 at 11:17

C interrupt pending after Reset

6 REPLIES 6
luter
Associate II
Posted on May 17, 2011 at 10:13

Hello, All.

At startup i drive motor in Direct Access mode, then I disable DAM and drive Switched mode. After disabling DAM C interrupt pending, but it is not possible to clear CI flag, if it is the first start after reset. On next starts CI flag is cleared without problems.

So, how to clear it at first startup?

Tnx.

gaetano
Associate II
Posted on May 17, 2011 at 10:13

Hello Luter,

please, could you explain how you conclude that the CI flag cannot be reset after first start? Could you explain in more detailed way what is happening to facilitate my analisys on the problem?

Regards,

Tanio

luter
Associate II
Posted on May 17, 2011 at 10:13

Tnx, for an answer.

So, after switching off Direct Access mode CI bit in MISR is set. I try to reset it by MISR = 0 or by MISR = ((u8)~(CI_MSK)) where CI_MSK is 0x01. Then i check MISR and see that MISR is 0x01. I just send this value through SCI. I try to reset it for several times, but bit stays set. All MTC interrupts are disabled. After enabling C interrupt it causes 2 consequent C interrupts, i use oscilloscope to watch interrupts. All this happens at first time after reset. For example, during second startup phase switching off Direct Access Mode does not set CI bit.

luter
Associate II
Posted on May 17, 2011 at 10:13

Small correction. During ''not first'' startup after switching off Direct Access mode CI bit is set, but it is possible to clear it.

luter
Associate II
Posted on May 17, 2011 at 10:13

Solved!!!

Nil value of MCOMP register in couple with mtc enabled timer was constantly generating C interrupt.

gaetano
Associate II
Posted on May 17, 2011 at 10:13

Very good, Luter!!!

I was answering to you to check the initialization of MCOMP value... but, as usual, you did the question and, then, the answer :-]

Have a nice day,

Tanio