This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CAN bus, SPI or I2C

I am currently about to undertake a project using the C167 infineon. I will be communicating with another processor and a number of FPGA aand need to choose between CAN bus, SPI or I2C. I have a very short time scale to produce this project and am after advice of which would be the best route to take.

Has anyone out there any advice of the easiest route to take????????

  • <i.choose between CAN bus, SPI or I2C

    If you "stay on the board" drop CAN, if you get off the board, use CAN or RS485.

    SPI and IIC for "on board" use (I use IIC between 4 processors and 3 devices on one of mine)
    SPI is somewhat faster but require a separate port pin for every device connected.
    IIC is a bit slower (100/400kHz) but 2 wires is all it takes regardless of no of devices (within reason)

    Erik

  • For on-board communication I would recommend SPI as this is generally the easiest to implement (including on a FPGA). SPI (SSC) has the highest available baudrate of your choices (Master = 10Mbaud and Slave = 5MBaud, CPU clock = 20 MHz) it is also capable of full duplex if using a three wire interface (CLK, D0, and DI). The transmit and receive registers are double buffered and support a data width from 2 to 16-bits.

    Also to be clear the C167 has no concept of a Chip Select and this must be implemented using a GPIO (Software implications).

    The C167 does not have I2C so you would have to bit-bang it in software.

    If you are making a commercial application, you must make a licensing deal with Bosch if you implement on the FPGA.

    You could also use the UART (ASC) in open drain mode.

    Off-board, given your choices I would choose CAN along with a transceiver.

  • "If you are making a commercial application, you must make a licensing deal with Bosch if you implement on the FPGA."

    Bosch?
    That's for CAN, I presume?

    You'd also have to check Philips for I2C: I think the rules are something like, "if you want to call it 'I2C' you need a licence" - which is why many use names like "TWI" etc...

  • That's for CAN, I presume?

    Yes, sorry forgot to include the bus type in my comment.

    Thanks for the correction.

    -Chris