Open Gcaravell0 opened 3 years ago
I haven't tried using the Due over SPI talking to a MCP2515 with MCP2551 transceiver. The Due has 2 Can ports built in so you don't need to use a driver (MCP2515) only a transceiver. Also It only operates at 3.3v so you cant use the MCP2515 over SPI without a level shifter to convert Due logic at 3.3v to MCP2515 at 5v.
If you do want to use the Due can ports then you will need a Can transceiver that operates at 3.3v logic but can drive the Can bus at the correct levels. Most of the 3.3v Can transceiver use a charge pump and dont interface well to most NMEA2000 buses as the other drivers on the bus tend to be 5v devices and have a higher common mode voltage. Using a MCP2562 tranciever which is a 5v device on the CAN side, but a 3.3v device on the logic side does work well. That is the setup I use. A Due using its internal Can drivers and a MCP2562 trancerver.
That said, if I was doing this again, I would connect the Pi over SPI directly to a MCP2515/MCP2551 through a level shifter and use socketCan eliminating the Due completely. See https://dayba.wordpress.com/2017/05/25/connecting-socket-can-adapter-to-signalk/ https://www.skpang.co.uk/products/pican2-can-bus-board-for-raspberry-pi-2-3?_pos=9&_sid=583288f2c&_ss=r or you could use a cheap ebay MCP2515 driver with level shifter eg https://www.ebay.co.uk/itm/154316486567 + https://www.ebay.co.uk/itm/251742375561
If you want to replace an ITC-5, then the ESP32 modules also have 2x Can bus drivers, and are much more powerful than a Due. They will drive MCP2562 trancevers. Take a look at https://github.com/ttlappalainen/NMEA2000_esp32 for the original library and https://github.com/ieb/WindSensorBase or https://github.com/ieb/EngineMonitor for examples of code doing something similar. The only hard part of the ITC5 will be the depth sounder which is going to need some form of high voltage ultrasonic pulse driver. The rest is ADC+pulse measurements. You might also be interested in https://github.com/SignalK/SensESP which has some of the capabilities, but doesnt interface to a CAN Bus.
Hi to everybody and tanks a lot for this magnific library!! I'm replaicing my iTC-5 device with an arduino DUE. With this opportunity I also want to export some data to my PC via serial interface. I performed different communication tests with two arduino, as shown below. Observing the oscilloscope I'm able to see that there is a message in the bus. I am also sure that the transimitting node is working because when I disconnect one of the two bus I see a message sending error... However, trying to use the examples "Datadisplay 2" or "Actisense Listener" I cannot see any message on the listener node. :( I attached the following preamble to the code: _
_ Someone could tell me what the mistake could be? Thank you in advance for your time and consideration
Giuseppe