This is an idea I have been toying with for a while and wanted to get an opinion. When I first heard about CAN-FD I thought it was going to be the answer to this problem. However most mid range microcontrollers do not have support for CAN-FD (LPC546 excluded). The STM32H7 does have support, but the cost of that microcontroller is far too high for most applications. There are some devices like the TCAN4550 and the Microchip version which are quite good, but not as flexible.

With an RS-485 transceiver and an iCE40 or other FPGA one can make a custom transceiver system. The idea would be to interface a microcontroller over SPI or UART to the FPGA. The FPGA would handle the actual protocol, which would be similar to CAN.

The advantages of such a system are:

  • Flexible system speed and cost (up to 48 Mbit/s)
  • Many settable addresses per device
  • Option for a multi-cast system
  • Not restricted to a particular architecture

My questions are:

  • Is the cost really worth it or am I just trying to reinvent the wheel here?
  • Can arbitration still occur at high speeds or are very accurate clocks needed?
  • Is there already a project like this out there that I just missed?

It might make for a great open source protocol that I would certainly be willing to put some effort into developing.

  • 1
    \$\begingroup\$ You miss the cost of FPGA and development. You would need to make thousands or tens of thousands of such device to earn the cost back. And the FPGA will easily cost 5$ with enough gates to support CAN. \$\endgroup\$ – Jan Dorniak Aug 8 '18 at 18:40
  • 1
    \$\begingroup\$ Also take a look at the STM32H750 - a recently launched "cheap" version of the H7 - going as low as 3.5 USD \$\endgroup\$ – Jan Dorniak Aug 8 '18 at 18:41
  • \$\begingroup\$ @janDorniak You are right the cost to develop and test would be high. I guess if the whole system cost is going to be ~10$ for transceiver, fpga and support it might not be worth it. \$\endgroup\$ – Meozaa Aug 8 '18 at 18:50
  • \$\begingroup\$ @JanDorniak I took a look at the H750. That looks like an excellent controller. At 10$ for a 400Mhz MCU with CAN-FD I think there is no contest. It looks like they are also working support into the ST tool-chain for these devices. \$\endgroup\$ – Meozaa Aug 8 '18 at 18:56
  • \$\begingroup\$ ask your distributor - the H750 has listed budget prices under 5 USD. There is a competitor - I.MX RT, which actually was earlier on the market and has that extra feature of in-bus encryption for QSPI. But way less RAM. \$\endgroup\$ – Jan Dorniak Aug 8 '18 at 19:37

I am cooking up an RS485 based protocol for building automation; single master, 250kbps. Nothing else quite fits my needs. It lets me create the tiny, low cost sensor/actuators I need. Reinventing the wheel can be OK IMO.

The CAN bus physical layer supports collisions which is essential to its support for multiple masters. The RS485 physical layer was not meant to handle collisions but more recent drivers and receivers behave gracefully in fault conditions, so you could make it work. But have you considered using a CAN-FD transceiver for your custom protocol?

You might be able to create something similar to your FPGA concept by dedicating a reasonably fast ARM Cortex MCU. Might be easier to develop, could well be cheaper in production. The result may be easier for others to work on.

Finally, you mention 48Mbps. I was under the impression that both CAN-FD and RS485 top out at about 10Mbps?

  • \$\begingroup\$ 7k gate FPGA and a good MCU cost about the same. And an MCU won't handle the same data rate for the money \$\endgroup\$ – Jan Dorniak Aug 8 '18 at 22:04
  • \$\begingroup\$ I think it depends on cable length. Maxim has some ICs that will give you RS485 at 100Mbps. My biggest issue was figuring out how to manage collision. @JanDorniak I still think the 750 might be the answer to my problem. \$\endgroup\$ – Meozaa Aug 9 '18 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.