Skip to main content
sompong1990
Associate II
August 5, 2009
Question

Use CAN in STM32

  • August 5, 2009
  • 3 replies
  • 1130 views
Posted on August 05, 2009 at 23:43

Use CAN in STM32

    This topic has been closed for replies.

    3 replies

    sompong1990
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:19

    Hi All,

    I am new for STM32 and CAN bus.

    How to connect for test CAN between two of STM32 without CAN tranceiver ?.

    1. Direct connect STM32#1 CAN_TX -> STM32#2 CAN_TX

    or

    2. Cross connect like USART, STM32#1 CAN_TX -> STM32#2 CAN_RX.

    Thanks for advance

    SJ

    ;)

    sompong1990
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:19

    Thanks Miles.

    My subject are test and learn CAN bus protocol.

    I use two of STM32 only.

    :D

    [ This message was edited by: sompong1990 on 06-08-2009 03:16 ]

    miles
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:19

    Neither of those schemes would work. CAN is a bus, where all the devices' Tx lines can drive the bus, and all the devices' Rx lines read the bus. However, the CAN Tx line on microcontrollers doesn't float (the transceiver handles that), so you'll have the multiple devices fighting each other whenever one wants it high and the other wants it low.

    If you don't want to use a transceiver, I've seen it done by putting a diode in series with the Tx line for each device (so that the Tx line can only pull the bus low, not drive it high), and then putting a pullup on the bus. Then connect all devices Rx lines directly to the bus. Note this is not compatible with the normal CAN physical layer (which uses a pair of wires for noise immunity). I'm not sure how many devices you can have, what distance the bus can be, what pullup value to use, etc.

    Good luck,

    Miles