Hi All,
I am relatively new to working with Freescale chips (and the embbeded world in general), so please bear with me!
I am using CodeWarrior 5.9.0 with Processor Expert 3.04 and working on MC9S12XET256MAA controllers.
This is actually 2 questions in one; but first here is the context:
Questions:
Thanks.
S12(X) have 3 different reset vectors, there's dedicated vector for COP watchdog reset.
It's hard to guess what and how did you code, but maybe your acceptance filters are set up to ignore some messages? You should also make sure overrun flag is not set.
Thank you for the response.
I am aware that the COP has its own Reset vector. However I am interested in making my main application aware of the fact that the last reset was caused by the COP Watchdog. Is there a register/flag of some sort that I could poll for this information?
I have indeed been playing around with the acceptance filters to help me understand how they work. The Master node only sends one msg, which the Slave node's filter is set to. How does this affect the way the CAN Rx interrupt works?
Again please excuse my naivety, but how do I know if the Overrun Flag is set? Does this generate another interrupt which needs to be serviced?
Many of the configurations have been created for me through Processor Expert. I am in the process of trying to understand all the options available to me (there are a lot!).
Further help would be most appreciated.
There are PORF, LVRF and ILAF flags for power on reset, low voltage reset and illeggal address access reset, but there's no flag for COP reset. But you can define your own COP flag variable. It should be not affected by start up routine (as you should know, ANSI C startup routine by default clears all static variables), so pheraps allocate it in NO_INIT segment instead of READ_WRITE segment. Main reset vector and COP reset vector should point to different routines. One routine should set your COP flag, another one should clear your COP flag, then both routines should jump to startup routine.
Message filter makes CAN RX interrupt not generated for filtered out messages. I hope it answers your question about filters and CAN Rx interrupt interaction.
Yes, you can poll OVRIF flag or enable OVRIE interrupt.
Sorry, I'm not using Processor Expert.
I have implemented your suggestion using a NO_INIT segment using the following post (and your response) as a template:
How to know Reset is WatchDog Reset ?
After initial failure, I managed to get the Watchdog reset working with help from a colleague who changed the Reset RC circuit as suggested by the post.
Regarding the CAN implementation, what I want to do is use a CAN interrupt to wake the uC from WAIT mode, but I also want to use the data to send instructions. Any suggestions as to how to achieve this?