I set up the CAN interface using the MSCAN driver and I can see that data is being transmitted ( as verified by being correctly received on another device). However, after the first transmission, TRANSMITTED (or 6) is never being set when we look at STATUS[0]. STATUS[0] always returns QUEUED2( or 3) to us. Since STATUS is never changing to TRANSMITTED we cannot send more data. What is required to get STATUS[0] to read TRANSMITTED? Do we need to clear or set some other flags?”
Try to check whether the flags are set up correctly for the MSCAN driver. There is a function for this page 33, 6.4.5 Check_CAN_Status of the MSCANDriver For S12 + S12X UserManual (attached).
Or e.g., page 7:
This reads out the registers for the MSCAN set up and status. This function obtains the status of the msCAN module. This function will write the status of the msCAN module to the address specified in the argument. The status will be 3 bytes with bits corresponding to the following register names of the msCAN that can be found with description in datasheet of MC9S12G Family, page 573, 18.3.2.1 MSCAN Control Register 0 (CANCTL0)…
http://cache.freescale.com/files/32bit/doc/ref_manual/MC9S12GRMV1.pdf
I hope this will help.
Hi Martin,
I have found the document but I am not able to locate the MSCAN driver source code; I am using an MC9S12G48 and, unfortunately, it does not have xGATE co-processor and AN2726 is useless in this case.
Any suggestion?
Thank you in advance,
Best regards,
Andrea Mocci
Hello,
I have used CAN driver for 10 or more years. I have never found source code to driver. I was told there was no plans to release but that was some time ago.
My experience has been on a MC912DG128 and not to many issues.
Hi Michael,
Have you used an MSCAN library? If yes, where could I find it????
Best Regards,
Andrea Mocci