Standard Communication Interfaces: CANBUS, USB, ETHERNET
flxint
Posts: 11
in Propeller 2
I am interested in the Propeller 2 for commercial robotics/automation applications. I am familiar with the architecture and spent time developing with the Propeller 1.
I am having trouble finding standard communication interface, ie. CANBUS, USB, and ethernet, examples. The reason I would use a multicore chip like this is to NOT require external interfaces for managing the protocols.
Are there any examples available?
Is Parallax supporting these efforts?
Thank you all for your time.
Comments
CANBUS is serial bus with differential signals and should be doable with pure P2.
USB and Ethernet, as far as I know, is work in progress. USB1 can be available; high speed USB2 at 480 Mbps seems to be too much for a P2. Maybe a 100 Mbps ethernet can be done.
I am doing a scientific/commercial robotics project now, using a P2 which is the main brain (all sensors and controls except a depth camera) connected to a Raspberry Pi which processes data from the L515 depth camera. Raspberry Pi can do USB and ethh better than a P2 and it can talk to a P2 via UART (which I am using now) or anything else (i2s, smi, which may be faster but I didn't test it yet). The robot uses a SBUS remote control - this is already done for P2 and works without any problems.
Useful for P2, may be the work on long distance or simpler cabling Ethernet, a couple of recent chip releases covering 10BASE-T1L and 10BASE-T1S are
https://training.ti.com/long-distance-connectivity-10base-t1l-single-pair-ethernet-phy-demo
https://www.ti.com/product/DP83TD510E
and
https://www.microchip.com/en-us/about/news-releases/products/new-ethernet-phys-enable-multidrop-bus-architecture--enhancing-i
@pik33 and @jmg Thank you for your insight.
I don't mind using an ic at the physical layer for CAN and 100 Mbps ethernet. It appears USB can be handled with the smart pins.
If there are drivers in development with respect to the software protocol layers for these interfaces it would be beneficial to have a status?
I respect the flexibility of the Propeller 2 and would be happy to contribute.
For USB, there's some code that handles the basics of the protocol and reads USB keyboards: https://forums.parallax.com/discussion/170149/p2-hosted-usb-keyboard-mouse/p1
Thank you @Wuerfel_21 I will review it.
Is anyone working on a native CAN implementation?
The CAN bus would be a good addition to the set of P2 capabilities, and I'm interested in it too as I have an automotive application in mind, although I've never used CAN before and don't yet know much about it. Its protocol appears to require some arbitration/timing control, error handling, bit stuffing and a CRC, amongst several other things. These should be things the P2 software can do. A PHY (like MCP2551) is still required for proper electrical connectivity into a CAN bus.
https://www.kvaser.com/about-can/the-can-protocol/can-error-handling/
A search finds these, tho the obex links seem lost in time...
https://forums.parallax.com/discussion/158752/will-this-can-object-work-for-me
https://forums.parallax.com/discussion/151284/schematic-to-use-with-chris-gadds-obdii-object
https://forums.parallax.com/discussion/92523/can-bus
Since then, CAN BUS has faster CAN FD which has many vendors offering 5Mbps transceivers and I see ADI have 12Mbps parts
https://www.analog.com/en/parametricsearch/11427#/ps6=CAN FD
Obex has moved to here: https://github.com/parallaxinc/propeller/tree/master/libraries/community/p1
Selection the **All ** folder and doing a search on CAN you can find amongst others:
https://github.com/parallaxinc/propeller/tree/master/libraries/community/p1/All/CANbus objects
https://github.com/parallaxinc/propeller/tree/master/libraries/community/p1/All/MCP2515 CANbus controller driver
I've ported my P1 CAN driver to the P2, and made significant improvements. Single-cog, communicates at 1Mbps with 80MHz clock--tested up to 3Mbps (way beyond spec) with 320MHz, user-defined number of receive buffers/filters. I've tested it against other copies of the driver in other cogs, against a mcp2515, and on my car, all with no problems. It does require a transceiver such as the mcp2551.
Haven't added it to the obex yet, there still seemed to be some problems with the process last time I tried.
I'm currently working on a CAN-FD driver, already got a mcp2517 driver worked out.
Sounds great Chris. Thanks for posting your work.
Thank you @rogloh @jmg @rosco_pc for your contributions and @ChrisGadd for sharing your work!
@ChrisGadd are you willing to share your FD driver at this point? I have several projects I can test it on.
I should have said 'mostly worked out'; it's still very much a work in progress. The legacy CAN-2.0 seems to be good, and I can send CAN-FD frames with up to 64 bytes in the payload, but something's up with the bit-rate switch. The 2517 is supposedly capable of speeds up to 8Mbps, yet it fails at ~2.3Mbps.
@ChrisGadd Thank you for the 2517 driver. Are you working on the FD capability to interface directly to a transceiver without going through a controller like the 2517/18?
That's the plan. Gotta make sure I understand the 2517 first though, so's to have something to test the CAN-FD driver against. My logic analyzer, unfortunately, doesn't understand the FD protocol, only the 2.0 protocol.
@ChrisGadd ok, great! I have a 2517 connected to a Raspberry PI 4 if you need me to test anything for you.