[PIO] allows you to add support for protocols you don't have hardware for.
PHY level support, yes. But nothing higher than that. You would still need to implement the protocol in software for the most part. So at 133Mhz, it’s probably fast enough to toggle a CAN transceiver correctly, but would have very little comprehension of bus arbitration or CRC or what makes a message valid (RTR, IDE, DLC, etc).
It’s very cool, but the example they used of making a simple waveform for the serial driven LEDs is more what they were going for.
That example is pretty much already taken care of with an SPI or PWM that runs off DMA though. You can easily make a waveform for those LEDs. I’ve never understood why the enthusiasts use bit banging and special hardware.
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.
Yes. 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.
This 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.
CAN 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.
In 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.
I 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.
Yes. 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.
Single 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.
Agreed. 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.
It's a game-changer in the hobbyist marine-electronics world. The marine electronics field is littered with various weird proprietary protocols that are _almost_ the same as open standards in other industries, but not quite. Examples include:
- NMEA0183, which is electrically RS-422 (similar to the ubiquitous RS-232, but only sometimes)
- NMEA2000, which is basically CAN
- Seatalk, which looks like NMEA0183 but is electrically inverted (1 is 0 and vice versa) and also uses weird byte lengths (9-bit?)
- Seatalk-ng, which is basically NMEA2000 with a few more message types
A $4 device that can translate arbitrary weird PHY protocols into a bitstream on a USB port is awesome in this world.
I think CAN is the special case here, since it more or less requires hard real time feedback within a bit cell. Almost all of the other weird protocols don't do that, so you can have the simple scan in/out handling the phy like you said and are no longer dedicating a full core 80% of your time to bit twiddling.
That’s fair enough. CAN is pretty complex. But still, I’m seeing a lot of ability to mimic waveforms being passed off as “custom hardware protocols”. It’s a cool peripheral, but IDK about any type of “game changer”.
If we look at Cypress’s PSOC, that’s real FPGA fabric on their micros and it’s barely capable of making some hardware protocols. I’m pretty sure there isn’t enough there for CAN going back to that example.
Comments
PHY level support, yes. But nothing higher than that. You would still need to implement the protocol in software for the most part. So at 133Mhz, it’s probably fast enough to toggle a CAN transceiver correctly, but would have very little comprehension of bus arbitration or CRC or what makes a message valid (RTR, IDE, DLC, etc).
It’s very cool, but the example they used of making a simple waveform for the serial driven LEDs is more what they were going for.
That example is pretty much already taken care of with an SPI or PWM that runs off DMA though. You can easily make a waveform for those LEDs. I’ve never understood why the enthusiasts use bit banging and special hardware.
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.
Yes. 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.
And a 120 ohm termination at the end of the bus.
This 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.
CAN 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.
No, 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”.
In 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.
I 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.
Yes. 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.
Single 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.
Agreed. 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.
It's a game-changer in the hobbyist marine-electronics world. The marine electronics field is littered with various weird proprietary protocols that are _almost_ the same as open standards in other industries, but not quite. Examples include:
- NMEA0183, which is electrically RS-422 (similar to the ubiquitous RS-232, but only sometimes)
- NMEA2000, which is basically CAN
- Seatalk, which looks like NMEA0183 but is electrically inverted (1 is 0 and vice versa) and also uses weird byte lengths (9-bit?)
- Seatalk-ng, which is basically NMEA2000 with a few more message types
A $4 device that can translate arbitrary weird PHY protocols into a bitstream on a USB port is awesome in this world.
I am beyond skeptical this will be adequate for NMEA/CAN for the very reason myself and others explain in the rest of the thread.
This will get you wiggling output pins, not a replacement for dedicated protocol hardware or a actual programmable logic.
I think CAN is the special case here, since it more or less requires hard real time feedback within a bit cell. Almost all of the other weird protocols don't do that, so you can have the simple scan in/out handling the phy like you said and are no longer dedicating a full core 80% of your time to bit twiddling.
That’s fair enough. CAN is pretty complex. But still, I’m seeing a lot of ability to mimic waveforms being passed off as “custom hardware protocols”. It’s a cool peripheral, but IDK about any type of “game changer”.
If we look at Cypress’s PSOC, that’s real FPGA fabric on their micros and it’s barely capable of making some hardware protocols. I’m pretty sure there isn’t enough there for CAN going back to that example.