I forgot comment that I have observed with the debugger (True-Time Simulator & Real-Time Debugger v6.1Build 6124) that while the application is running in the device, the clock sometimes changes to 16MHz, and sometimes to 8MHz and sometimes to 58KHz. I found a message with a similar problem in Freescale Forums (http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&message.id=6486&query.id=450311#M6486)but it didn't say how resolve the problem.
And some devices die in the loop of ICG_Setup function (in icg.c), see the picture attached for more details about it.
I would like somebody answer me these questions:
How can I look at the value of IRQ_Status Register with the debugger?
What reason can cause that the clock changes its frequency of this way?
Why do some devices die in the loop of ICG_Setup funciton?
Thanks in advance.