New Raspberry Pi Zero 2W
-
@zapta said in New Raspberry Pi Zero 2W:
@dc42 said in New Raspberry Pi Zero 2W:
While the PIO state machines look very useful, the amount of instruction memory (32 instructions) and scratchpad memory (2x 32 bits) are nothing like enough to implement a protocol with the complexity of CAN-FD.
@dc42, I am not familiar with CAN bus. What does the PIO need to do other than serializing bits in/out or detect collisions? Those PIO instructions are very capable (they have multiple fields and can do a few things in one instructions) and work well with the the hardware FIFOs, DMAs, and MCU interrupts.
Lots of things. When receiving it has to generate a local clock that can handle variation and jitter in the received clock. It has to decode the initial ID byte format to determine whether it uses an 11-bit or 29-bit address, whether the node is interested in that ID, whether it is a CAN-FD or plain CAN packet, and whether bit rate switching is enabled (I guess you could avoid some of that by restricting the types of packet supported). It has to handle bit stuffing, and it has to calculate the CRC of the received message in real time so that it knows whether to assert the ACK bit at the end of the message.
-
@dc42, yes, it sounds a lot of things. As you say, some could be addressed by focusing on message types that exist in a duet system but I am not sure about the CRC, how complex it is or what is the time to respond. On the other hand, the PIO provide room for creative solutions and possibly may be able to use a few state machines in parallel to divide the work, and there is also the second MCU core that is sitting idle and can be dedicated for the CAN decoding, and then there is an official API to overclock everything ...
-
-
@o_lampe said in New Raspberry Pi Zero 2W:
@zapta @dc42
It would be interesting to know: are all of these functions hardwired in a Sammy-C21?Yes.
-
@o_lampe said in New Raspberry Pi Zero 2W:
To set the record straight, I know almost nothing about CANBUS and the little I know is mostly from this thread.
BTW, I do have some experience with another automotive bus call LINBUS that you can find in modern cars but is seldom mentioned. This product for example is based on a public domain design that I published on github http://t-design9.com/memory_module_porsche.html .
-
-
-
-