2 Replies Latest reply on Nov 23, 2018 7:55 PM by RuDe_666331

    CAN-BUS: 2 controllers in 1 chip => 1 transceiver, how to do it?

    RuDe_666331

      Hi, when I look at the can-bus protocol it is clear to me that there is a way to do this because only the transmitter with the highest priority get's the can bus to transmit something. So, I went looking on the internet who has done this before and I found similar examples that showed that you could even make a short can-bus without transceivers:

      Example 1: Single-Wire CAN Bus Without Transceivers - YouTube

      Example 2: Is a CAN enabled microcontroller sufficient to drive a CAN bus? - Electrical Engineering Stack Exchange

       

      Because only the sender sending a dominant bit is of importance so, I tried to "OR" the 2 CAN-bus components inside the CY8C4247AZ...

      But then I get the error: fit.M0049: The TX port on CAN block "\CAN:CanIP\" must be directly connected to an IO pin.

       

      Then I tried to connect the Tx pins together from the 2 CAN bus controllers hoping that they would go in tri-state when in recessive mode because in example 2 the PIC can do this. But PSoC creator is protesting again with an error: "sbd.M0018: Multiple drivers on signal "Net........

       

      I got also the same errors when I connect the Rx-channels together.

       

      So, my guess is that the only way to solve this is sacrificing the 2 pins and use an external "OR" port or put both Tx pins in "open drain drives high" using a pull-down resistor for the recessive bits.

      And also connecting the 2 receivers externally.

       

      Am I correct?

       

      The most elegant solution would be that the CAN-bus component would have a parameter like the PIC to put the Tx in tri-state when in recessive mode. And also making it able to connect the Rx pins together.

        • 1. Re: CAN-BUS: 2 controllers in 1 chip => 1 transceiver, how to do it?
          XiaoweiZ_71

          I created a PSoC4200-L project,did some tests. The CAN TX/RX pins can only be routed to dedicate fixed-function pins, so we cannot use OR gate or digital Multiplexer/De Multiplexer to realize the combination directly inside PSoC.

           

          I tired some ways to bypass the internal routing limitation, but this consumes additional pins. Below schematic is a example, but it consumes 8 IOs finally, so a bad idea i think, except the unused pins are sufficient.

          1.JPG

          • 2. Re: CAN-BUS: 2 controllers in 1 chip => 1 transceiver, how to do it?
            RuDe_666331

            Sorry, it's a bad idea to use multiplexers because the CAN-bus component is fully autonomous, so what about the timing of the control register, also the Rx side needs to listen to both busses at the same time.

            I just made an example of how I think it should work:

            2x CAN-bus to 1 Transceiver.png

            If one of the Tx lines is TTL low the combined Tx line will be low or '0'. According to the can_bus protocol, the CAN-controller with the highest priority-ID will win the conversation when they collide and the other CAN-Tx will stop talking, so a possible conflict between the CAN-bus controllers is automatically solved.

            I just ordered some CY8CKIT-043 because I don't own any kits with CAN-bus. The CY8C4247AZI-M485 chip in this cheap kit has 2 CAN-bus controllers and the above scheme I could build with it. I will try to make 2 kits communicate without a transceiver, then I need to connect the Rx with Tx lines also otherwise the automatic CAN-conflict-solving won't work. So in a few days, I can report if it is working or not.

            It's ideal for me to start debugging my project without the need for CAN-bus transceivers or expensive kits, the distance is limited though.

             

            I also ordered 32kHz crystals for this kit because I figured out that this option is needed for the CAN-bus to be in sync according to the max. clock deviation.

            The CY8CKIT-043 seems to have already the capacitors to cooperate with the optional WCO crystal.