2006-05-02 02:17 AM
C interrupt pending after Reset
2011-05-17 01:13 AM
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.2011-05-17 01:13 AM
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, Tanio2011-05-17 01:13 AM
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.2011-05-17 01:13 AM
Small correction. During ''not first'' startup after switching off Direct Access mode CI bit is set, but it is possible to clear it.
2011-05-17 01:13 AM
Solved!!!
Nil value of MCOMP register in couple with mtc enabled timer was constantly generating C interrupt.2011-05-17 01:13 AM
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