CanSerial Example Project

Discussion to talk about software related topics only.
Post Reply
yozdude
Posts: 1
Joined: Tue Jun 15, 2010 3:07 pm

CanSerial Example Project

Post by yozdude »

I've recently been working on getting a CAN bus connection with my MOD5234, and so I opened the CanTest project (found in NBURN\Examples\MOD5234\CANSERIAL) in NBEclipse, only to find that after wiring everything together correctly, the program simply doesn't work. All that I'm receiving from the MOD5234 in the MTTTY is:

Code: Select all

Waiting 4sec to start 'A' to abort
Configured IP = 192.168.100.119
Configured Mask = 255.255.255.0
MAC Address = 00:03:f4:02:bb:e44
Not completely unexpected, but after these lines it displays nothing else, despite the fact that it should display a welcome message. All of the other example projects I've loaded up have worked, and I haven't been able to find any more information about the CanTest project on any of the support websites.

I eventually isolated the problem down to this line:

Code: Select all

J2[22].function( PINJ2_22_CAN0TX );
If I comment this line out, then everything after it runs (which is basically a welcome message since there is no TX port for the CAN bus to transmit anything on). I have no idea why this function causes everything to freeze up, and if anyone has any ideas on what the problem might be it would be very helpful.

Thanks
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: CanSerial Example Project

Post by v8dave »

Hi there,

Not sure why your code fails. I have custom code and running CAN from another TASK. I have the same code to setup the function of pin 22 and it works. I then have a call to CanRxMessage can_msg(&fifo, 1); and this is returning data or no data as expected. This is simply taken from the demo code so should be similar to what you have.

Have you correctly setup the links on the development board for CAN? Not sure that this should matter but worth checking as a start.

Can you single step into the call to setup the IO pin and see what it is doing that it hangs? I can single step into this so you should be able to see what is going wrong.

Good luck.
Dave...
Post Reply