2-Channel Isolated CAN Expansion HAT for Raspberry Pi

Hi All i am bringing in a few nice isolated can hats for Raspberry pi.

They cost $17.19 and the courier fee is $38 for 15 units. I will in any case pay 38usd for only bringing in 2 for myself, so adding up to 13 units will stil cost 38usd, so the only cost to you would be for the unit and R99 PostNet to get it to you if you are not in Gauteng.

Let me know if anyone wants one, I will order in 2 days time.

Thanks for the link @JohanB

2 Likes

Yes for 1.

OK, looking at the pictures now, it looks as if the CAN side doesn’t need its own power supply. I was a bit concerned about that, because quite often the CAN transceiver has two power supplies (one for each side of the isolation gap), and that means you need to either make an isolated supply yourself to power the other side, or it needs to be powered FROM the other side. But I only see three wires connecting here, so it appears that is covered.

image
I circled the Isolated power supply in red. Looks like a B0505LS-1W or similar

1 Like

Yup. And it has a very clear creepage gap there. The chip across the gap is an SI8642 which is a garden variety digital isolator. Then you can see the two CAN transceivers on the other side, and the two MCP2515 CAN controllers on this side.

Also, I see CS0 and CS1. That would be the two chip-select lines that goes with the SPI connection.

If I am not mistaken, this should be easily supported on venus. There are already two overlays on the image for can0 and can1, and in theory (though I have never tried it) simply loading both ought to do the trick.

Edit: Just one caveat. Because this is two CAN-buses addressed over a single SPI bus, the Pi can physically only talk to one chip at a time. So even though you have two CAN-buses, the total bandwidth is technically halved. The MCP2515 also only have one register (well, two, but it depends on the programming) for storing a received frame, so you have to be quick about fetching it. This should not be a problem for your average CAN-bms battery, which generally spits out a few frames every second, but on a high bandwidth bus it will likely lose frames.

Yes, the MCP2515 is very easy to get going on a raspberry PI, since there are drivers for it in the standard raspbian images. The only problem I know of is that it can be a bit unstable. i.e. The CAN just stops working sometimes if there are errors on the bus.

Haven’t really seen that issue. In one of my earlier experiments I did have an issue with a chip that would hang up randomly, and later discovered I had left the reset pin on the MCP2515 floating. Rookie mistake :slight_smile:

I also discovered that if you use an arduino to read data at 500kbaud… it becomes easy to lose an interrupt if you spend too much time inside the interrupt handler.

I don’t think it is an MCP2515 problem, I think it’s a problem with the driver that comes with Raspbian.
I have never had a problem when just using the MCP2515 on a PI to listen on the CAN bus, but when using it to also send CAN messages it seems to sometimes just lock up. I know SolarMD also uses them in their logger and they had similar issues so they ended up writing their own driver, which must have been quite a job. (I wouldn’t know where to begin writing a driver)

1 Like

Ordered yesterday,

@warwickchapman, @PJJ will send yours as soon as it arrives.

@plonkster, your toys will follow shortly.

@JacoDeJongh Thanks!