I am trying to use the CAN protocol in order to communicate with a CubeMars motor. Did anyone work on a similar project and could help me with this? A fully working solution would be so nice!
I have:
Arduino Mega
Arduino Nano
ESP32 NodeMCU WROOM32
Arduino Nano ESP32
MCP2515 module
SN65HVD230 transceiver
I guess that with all that stuff it should be possible to implement something working fine!
You need two MCP2515 modules or something else that talks CAN. There is an almost identical question posted in the last 24 hours. What does the motor data sheet say. Post a link to the Motor technical data.
Obviously you have not taken the time to read the CAN specification: http://esd.cs.ucr.edu/webres/can20.pdf. CAN uses an IFR (In Frame Response), that occurs during data transmission. The transmitter sends a recessive bit and the responder sends a dominate bit ACK (Acknowledge). If the transmitter does not receive the ACK bit it will try again until its counter counts out, it then quits. Also it is important to note that if the transmitter does not receive the ACK bit in the right time slot it simply shuts down and errors out. The motor could be your second node which I would suspect it is. Now that you have the needed information post an annotated schematic showing how you will wire this. Frizzes do not count..