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:
- I have a CAN bus between two uC
- One a "Master", the other a "Slave"
- Master sends a CAN msg to Slave
- Slave receives the msg and sends an ack CAN msg.
- Slave has a Watchdog which is Kicked when the Slave receives the Master's CAN msg.
- If the Watchdog is not kicked, it will "bark" and cause the Slave to Reset
- How do I know that the Watchdog caused the Reset?
- I want the Slave to do something different if the Watchdog barks
- Is there a way to react to the most recent Rx CAN msg rather than when it is Full?
- I have set up internal counters to see which msg the Slave reacts to.
- There is always a count difference of 4 between the Slave and Master. I'm assuming this is due to the Rx buffer...
- I want the Slave to react to the msg it just received, not an old one.