There does not appear to be an MCAN demo program for SAME70 Xplained Ultra evaluation board. I am trying to construct one myself, as a starting point for our development.
There actually do not appear to be any demo programs for this development board. However, it is similar enough to the SAM70 Xplained board (not Ultra) that I was easily able to adapt the Getting Started example for that board and run it on the Ultra. (This required changing the main clock source to bypass, as per this article, and changing the pin for the User LED).
Using that as a basis, I did the following:
- Added the MCAN driver via the ASF wizard
- Copied the CAN code from the MCAN_QUICK_START1 demo program for the SAMV71 Xplained Ultra evaluation board. I copied two files, conf_mcan.h and qs_mcan_basic.c
- In the project, I removed main.c and replaced it with qs_mcan_basic.c
This gives me a program with the CAN features from the MCAN_QUICK_START1 demo, that compiles and runs, at least basically, on the SAME70 Xplained Ultra board.
I have connected the CANL, CANH, and CAN ground pins.
I can interact with the program via the serial interface, via a terminal emulator. However, when I put one board into a receive mode and send the corresponding message from the other board, the transmitter displays:
: MCAN bus off error, re-initialization.
I have compared the MCAN pin assignments in the schematics of the SAME70 Xplained and Ultra boards; they appear to be identical.
Have any of you succeeded in getting this to work?
Or, can you suggest what might cause this bus error, when using this demo program?
Or, does anyone have a working CAN demo for the SAME70 Xplained Ultra board? (Or, even for the SAME70 Xplained board!)
Thank you.