Q1. We have to write some registers of CAN module to send CAN messages .(e.g, MSGID, CANMDL, CANMDH)
We need very short delay for completing writing to the registers?
When I sent thousands of messages, one message had Old data in MSGID, CANMDL or CANMDH.
The other messages were what I currently wrote and OK.
I guessed CAN module might need very short delay because I set CANTRS just after writing to MSGID, CANMDH and CANMDL.
My code is summarized like this.
1.Disable CANME
2. Write MSGID
3. Enable CANME
4. Write CANMDH
5.Write CANMDL
6.Set CANTRS
I need a delay between 5 and 6?
Q2. In order to send next CAN message, it's recommended to read CANTA.
But I read CANTRS. If the bit of CANTRS is 0, I send next CAN message.
Does this method have some problem?