I was trying to use the GitHub - obdevel/ACAN2040: Arduino library wrapper for can2040 library to run software Canbus on my Xiao RP2040 with a waveshare Can transciever https://www.waveshare.com/wiki/SN65HVD230_CAN_Board
I’m working with the Arduino IDE with the RP2040 board manager added in and the Acan2040 library imported from Github.
I have an existing and working Canbus (Two Arduinos with MCP2515 based Can Controllers), one sending a packet and the other receiving the packet. All works fine between those until I connect the CAN_TX to the TX pin designated in the example. This pulls the bus into a Dominant state (CanH at 3v, CanL at 1v) and the bus goes into contention, the other two devices fail to pass data. As soon as I disconnect TX, the bus returns to normal and the existing devices pass communications. The RP2040 also doesn’t seem to receive data from the bus when TX is pulled high or left floating.
Unsure if I just got a bunk set of Waveshare canbus transcievers or have issues with the library or setup…
manually probing the Can transciever with RX and TX disconnected from the RP2040, I seem to get valid results. If I pull CanH to 3v3 and CanL to Gnd, Rx goes Low. It goes High as soon as the bus goes back to normal, including if I tie CanH and CanL together and connect to Vref (1.3v) on the transciever. If I put Tx to Low, CanH goes to 3v and CanL goes to 1v