I am using a Sparkfun CAN-Bus shield to talk to an ultrasonic module from a GM vehicle. I have found the MCP_CAN_lib and wrote the following code to send CAN signals that I have recorded in the vehicle. But the module is not responding the way I think it should to the signals sent. When I try to check if the message is being sent, I get an error code of 7. A 7 is #define CAN_SENDMSGTIMEOUT (7). Not sure why the message is timing out.
Do a loopback test to check that the Tx/Rx functionality is working.
Take a photo showing how things are connected.
Provide a link to the datasheet for the sensor.
Do a loopback test to check that the Tx/Rx functionality is working.
The loopback show it will send the first can id 0x100 and the last 0x10242040
Take a photo showing how things are connected. Provide a link to the datasheet for the sensor.
There is no "data sheet" on the sensor. It is a system out of a vehicle with four ultrasonic sensors connected to a module and that module outputs a can signal that operates at 33.33kbs GM signal wire can. I have the signal wire can wired to the high port on the board and the low and ground to the ground of the 12-volt power supply that is powering the module.
johnjudge01:
How do you tell if it is enabled and how to disable it?
I would start at the schematics for your hardware.
As for the termination, I do not have any prior experience with Single Wire CAN and my little bit of research suggests that most Single Wire CAN transceivers require a ~7kΩ resistance from BUS to LOAD or in your case CAN_H to GND. It is likely this resistance will get communications going for you.
So a asked someone in the department that works on this module what do they do when they work on this module on the bench. He said normally the Vector can case adds enough resistance around 120 ohms to the circuit and it is fine. If I am not mistaken the Sparkfun board has 100 ohms to the input circuit, so that should be fine.
I just received an oscilloscope today and had to see what I was getting as an output. I have attached the output to this post.
What could cause error 7 to be returned from a send the message?
The order
a. Obtain an available buffer for the message that is to be sent.
b. Write the message (output to the network).
c. Wait for a positive response from MCP2551.
It’s the last step, waiting for the response, that returns error 7
If I remove the if sndStat ==Can_OK this is what I get
coryjfowler:
I would start with the schematics for your hardware.
As for the termination, I do not have any prior experience with Single Wire CAN and my little bit of research suggests that most Single Wire CAN transceivers require a ~7kΩ resistance from BUS to LOAD or in your case CAN_H to GND. It is likely this resistance will get communications going for you.