1
votes

I have purchased a Seeed Studio Can Bus Shield V1.2 and I’m having problems listening to a bus at 200kbps but I had success listing to my car's bus.

I have an undocumented bus running at 200kps (it’ not a car bus) that I need to sniff, there are 3 devices on the bus. The impedance between canh and canl is 60ohm. I have cut the P1 jumper and checked the impedance is still 60 ohm when wiring on the screw terminal. I have plug the bus ground to the shield ground.

I’m using the receive_check example provided with the lib. I have set the bus speed to 200kbps.

This bus inits well but receives nothing. The Rx led blinks when receiving data, I have signal on pin 4 of MCP2551, but nothing is displayed.

To be sure to be doing things well, I have plugged the shield/arduino to my car. My car is running the bus at 500kps. I got it working the right way and the Arduino started displaying a message.

I have a picoscope oscilloscope which can decode CAN BUS messages.

My oscilloscope decodes the can bus messages with no difficulties. The bit time is about 5 micro sec, the oscilloscope auto-configured itself to 200kbps.

I have compared my car’s and my devices messages and they look really very similar. I use exactly the same settings on my oscillon (except for speed) to decode both messages. The only difference I can see is that my device signal is not as clean as my car’s signal.

This is my car’s signal (500kbps)

my can's canbus message

This is my device’s signal (200kbps)

my devie canbus message

Sometimes it’s a bit noisy, in that case, the oscillo cannot decode, but most of the time it is successful.

low quality signal

Could this be part of the problem? Should I anyway get a clear message from time to time? I’m not getting any.

I have been wondering whether the config was right for the 200kbps speed so I installed the Chinese tool mentioned on the wiki page.

For my speed 200kbps, the lib config is :

#define MCP_16MHz_200kBPS_CFG1 (0x01)
#define MCP_16MHz_200kBPS_CFG2 (0xFA)
#define MCP_16MHz_200kBPS_CFG3 (0x87)

I have tried other configurations for this speed but with no success.

#define MCP_16MHz_200kBPS_CFG1 (0x01)
#define MCP_16MHz_200kBPS_CFG2 (0xF5)
#define MCP_16MHz_200kBPS_CFG3 (0x85)

I have also turned the debug mode on, in the CanBus lib I get more messages on init but the arduino keeps silent when data is received.

CAN BUS Shield init ok!
Enter setting mode success 
set rate success!!
Enter Normal Mode Success!!
CAN BUS Shield init ok!

I'm using a Arduino Mega.

What can I do? What is the problem?

Thank you for your help

1

1 Answers

0
votes

Read the datasheet. The MCP2515 needs to be in listen only mode. device automatically enters configuration mode after resetting. You will then call upon the appropriate function to place device in listen only mode.

All the answers are in the CAN bus library files read and understand.

Listen only mode is a private feature you will need to leverage library.