Hello,
I am using MC9S12 for my project. My project is 1 master and more than 10 salve. There is no problem that data can send and receive for 1 master and 1 salve. One of the salve is hang if two salve send data same time, but master is still working normally. Every time I have to do reset for the salve. Is this problem because MCU bit rate is 20kbit/s?
http://forums.freescale.com/freescale/attachments/freescale/PEGEN/132/1/bitRate.JPG
I take it you mean slaves. The CAN bus as such doesn't have any master, unless you implement that in an application layer protocol. It is using bit arbitration with collision avoidance, so it is not possible for two nodes to send at the same time. If someone with higher priority sends, the CAN controller in the S12 will wait until the bus is available and try again. Lower CAN identifier means higher prio.
The bit rate will only cause problems if you are clocking the CPU (bus clock) with a frequency that can't be divided accurately enough, I believe CAN expects 0,5% accuracy. But since you can transmit and receive, that seems unlikely.
It sounds like the problem is caused by your program and/or hardware.
Hello,
Thanks for your replying.
Regarding your reply, bit rate doesn't affect microcontroller's hang.
Can I ask you one question from my testing? Is it possible microcontroller hang if IO work non-stop? Because it hang when IO work non-stop.
There is a whole lot of things that can cause a MCU to "hang". You have to provide more info.