CAN bus messages to/from XDK
Answer
8/10/17 1:16 PM

Is it possible for the XDK to send and/or receive CAN messages?

If so, can these values then be sent to the "cloud" using the XDK's WiFi module (as an MQTT topic)?

If not, does anyone know of the cheapest/easiest way to get CAN signals to the "cloud?"

+1 (1 Vote)
RE: CAN bus messages to/from XDK
Answer
8/10/17 2:23 PM as a reply to Frank Kachinski.
Hi Frank, how are you?

As far I know the current MCU on the XDK (a EFM32GG family) does not has a CAN controller on it peripheral set, so the alternative is to use a external CAN controller + phy to obtain messages from both 2.0A/B buses.

Fortunately, XDK comes with a gpio extension connector which allows you to access all microcontroller pins, so you can setup the SPI and use a external can controller such this very known Microchip part:
http://ww1.microchip.com/downloads/en/DeviceDoc/20005282A.pdf

Then read the can frame, filter out the fields not used (in general the ID, DLC and DATA are the most important fields to extract data), then formward the packages through the MQTT :)

Let us know your further questions about it, I personally love the automotive buses and this seems to be a great project using XDK :)

Best

Felipe
0 (0 Votes)
RE: CAN bus messages to/from XDK
Answer
8/10/17 3:28 PM as a reply to Felipe Neves.

Hello Frank,

as Felipe already mentioned, the current MCU of the XDK does not have a CAN controller. You can, of course, use the CAN controller, which Felipe proposed and I recommend as well, and connect it via the extension bus to the XDK and then set up an SPI connection with the XDK.

For this, I recommend using the SPI example as a starting point to implement the SPI connection to the CAN controller. The example is available in the extension bus guide of the related pages section in the XDK community.

Afterwards, you can of course send the received CAN data via MQTT to a cloud of your choice. For more information on how to implement an application based on MQTT, I recommend taking a look at the MQTT guide, which is available in the learning section of the XDK community. Of course you can also use one of the other protocols, such as HTTP or CoAP.

Please let us know if this was helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

+1 (1 Vote)