This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CAN on Stellaris == Rage

Other Parts Discussed in Thread: EK-LM3S8962

I am a student at Western Washington University and I am going crazy trying to get CAN functioning on my stellaris.

For my senior project I wish to communicate between two or three boards using CAN protocol.  One board will receive user input and place that information on the CAN bus. While one or two boards will interpret that information and react accordingly. This is an over simplification of my project, but the foundation which I am running into issues with. 

Background:

I have been using the Stellaris LM4F120XL LaunchPad and now I have tried both the A540 and now the Mcp2551 trancivers with my board. I was excited to see someone in Germany had posted some information on getting the  the simple_tx.c working from the can examples. But after following his guidlines, I am still having issues:/ 

The guide I followed which has the wiring diagram for the Mcp2551 tranciver. this is my current set up:

http://www.fischl.de/arm/can_bus_interface_for_stellaris_launchpad/

Resulting output to terminal:

The 5's are part of my debuging 5 =  CAN_STATUS_TXOK, which means... 

//! A message was transmitted successfully since the last read of this
//! status.

Resulting output to scope on CAN_H and CAN_L:

both signals are in respect to ground, sorry for the zoom, I can not figure out how to get my roommates cheep O-scope to trigger on the messages, but they are there... 

UPDATE: I got the trigger working!

This is one of the messages... looks like CAN to me(does not mean much;)

my code:

3443.hello.c

my vector file:

2474.startup_ccs.c

my question:

Does anyone know why this is not working? FINAL UPDATE: I checked my receiver and it appears to be receiving the data I am transferring! I still dont understand the error I am getting or why the sending value is wrong... any ideas? Or does anyone know what this CAN_STATUS_TXOK is / where I can find the API documentation for this error?

Thank you,

Jordan Mosher

  • A few suggestions and places to look for more information come to mind.

    Do you have the terminating resistors on the CAN bus?  120 ohms at each end of the cable.

    Have you looked at the StellarisWare\boards\EK-LM3S8962 examples.  The quickstart (qs-ek-lm3s8962) example is the a game that plays on the board.  The volume of the game sounds are controlled by buttons on another board that comes in the kit over a CAN bus.  can_device_qs is the example app for the sound control board.  That is probably about as simple and straight forward of an example as we provide.

    The CAN system on the older LM3S devices should be identical to the LM4F.  Only the GPIO pin muxing should change.

    Dexter

  • Dexter, 

    Thank you for the reply! I do have terminating resistors of 120 ohm +-1% resistors.

    I spent a long time working with Can_Fifo and Can_device_Fifo, with little success.  Thus I switched to the simpler example. But now that things are mostly functioning I think I will try this example again. I will also look into this agin can_qs, but in my notes i have written down that this example did not look like it would scale well for my project. 

    Here is the output of my can_rx on the terminal:

    I have not read into the Rx code much but at lease there is data that is printing:)

    Thanks again,

    Jordan Mosher