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.
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
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.
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