4 ms·
Didn't study Pico but I don't think PIO can interface CAN bus. The physical layer uses differential wired-AND scheme where any device can pull it into dominant
by jmiskovic 6y ago
Didn't study Pico but I don't think PIO can interface CAN bus.
The physical layer uses differential wired-AND scheme where any device can pull it into dominant state but recessive state is possible only if no device is driving the bus. In most cases CAN requires a dedicated HW transceiver, I would be pleasantly surprised if Pico can pull it off without external components.
- deleted 6y ago[deleted]
- sokoloff 6y agoAnd a 120 ohm termination at the end of the bus.
- SV_BubbleTime 6y agoThis is not a required item. It is suggested that the termination is 120ohms, but depends entirely on the length of the bus and number of modules. You can have short runs of can with no transceiver and no termination.
- zootboy 6y agoCAN uses a dominant/recessive transmission method, similar to I2C. The termination resistors are absolutely required, as they are what drive the bus back to the recessive state. Perhaps you were thinking of RS-485, which actively drives both bus states and therefore can get away with unterminated buses at low bitrates / short runs.
- SV_BubbleTime 6y agoNo, I was not thinking RJ485 where termination is optional. You are forgetting that CAN can work at short distances without being a differential bus at all. I mention this where I wrote “no transceiver AND no termination”.
- zootboy 6y agoIn that case, it's not really CAN, it's more like CAN-tranceiver-control-signals. That may work, but would realistically be limited to only two devices, at which point it probably makes more sense to just use a protocol that's meant for short point-to-point links, like U[S]ART or SPI.
- SV_BubbleTime 6y agoI think a better way to describe it that it’s CAN all the way up until the PHY. It’s still CAN protocol, you still need CAN modules, and really, nothing looks different at all to them. You just lose out on the differential pair... but even that isn’t required when you look at fault tolerance CAN in single wire mode, or single wire CAN PHY transceiver options, as to the original point about termination, I can’t remember if Single Wire CAN is terminated in a loop or pulled up or down, but I promise it’s not 120ohm termination like differential CAN is. Imo, safer to say that CAN is a protocol that can take many physical forms, and one of them is direct A to B modules with no termination.
- a9h74j 6y agoYes. You could do all-point-to-point CAN by or-ing all of the CAN-TX logic-level outputs, perhaps in an inverted tree, and then fanning out the global OR result to all CAN-TX logic-level inputs. Or, at short distances, just use wired-or at logic levels.
- Too 6y agoSingle resistor can easily be added yourself. It doesn't have to be inside the transceiver, just close enough to end of cable. Bigger issue is the arbitration feedback as others noted.
- sokoloff 6y agoAgreed. However, going from zero external parts to one is a big step in terms of easy experience and sharing of code/projects. Arduino “took off” because it was easy and standardized. You and I could probably lay hands on a 120R today, but fewer than 0.01% of the population could without ordering something (at which point you could just as well order an MCP2515 module). It’s a “what’s in my hand right now?” hurdle not an “it’s technically advanced” hurdle that makes 0 external parts such a selling point.
- SV_BubbleTime 6y agoYes. Did you notice where I wrote ”fast enough to toggle a CAN transceiver”. The point is the PIO may be great at wiggling pins, but that doesn’t mean you can “support hardware protocols” you don’t have peripherals for. It means it gets you a pin wiggler, and the rest of the protocol would have to be software.