This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TCAN4550: TCAN4550 Passive mode for autobaud detection

Part Number: TCAN4550

Hello,

I am using the TCAN4550 to communicate on a CAN BUS with other CAN devices.

I have already developed a driver, which is working very well. But now, I want to implement an autobaud detection.

This autobaud detection should detect the baudrate of the CAN bus automatically to use the hardware on CAN Bus-systems with different Baudrates (50kB/s, 100kB/s, 250kB/s, 500kB/s).

My Approach is, to configure the TCAN to a specific baudrate and then "listen" to can messages. If i receive valid can messages in a specific amount of time, then i have found the correct Baudrate of the bus.

For this Approach, I need a passive mode of the TCAN, where the TCAN does not acknowledge or set the error bits of messages, if my baudrate configuration at the first try does not match the baudrate of the bus.

I Assume, I Have to set the MON-Bit in the CCR Register to 1 and the MODE_SEL to Normal. I Have tried this already, but the TCAN does still set the error bits, if there is a message with the wrong baudrate on the can bus.

I would need a configuration for the TCAN, where I can listen to messages, without writing anything (errors or NAK) to the tcan (Read_Only-Mode).

Could anybody help me to solve this problem?

Many Thanks in advance,

Flo

  • Hi Flo,

    Thank you for your interest in the TCAN4550.  I'm glad to hear you have been able to get a driver successfully developed and working well.  Your autobaud detection sounds like an interesting idea and I think your approach is correct.  But I have not personally tried this, or know of anybody else who has, so we may have to work through this a little bit.

    First off, if you are not aware already, the TCAN4550 uses the Bosch M_CAN IP for the CAN-FD controller.  You can find the User's Guide for this IP on Bosch's website here which contains more detailed information on some of the controller features that were not duplicated in the TCAN4550 datasheet.  I recommend referencing the M_CAN User's Guide as a supplemental document to the TCAN4550 datasheet.

    You are correct that setting the MON bit in the CCCR register and placing the device into Normal mode should allow you to receive data on the bus through the RXD but prevent the device from transmitting any Dominant bits on the bus such as ACK or error frames.  However, you can't set the MON bit unless the CCE and INIT bits are also set to 1.  Therefore you will need to have multiple writes to this register to first set CCE and INIT, then set the MON bit along with any other bits, and then a final write to clear the CCE and INIT bits. 

    Are you saying that the TCAN4550 is still transmitting dominant bits on the bus while it should be in Monitor mode?  Have you verified the MON bit is set in the register properly.  Sometimes people try to set the bit in the same transaction with the CCE and INIT bits and it results in the bit not actually getting set.  I always like to ask for verification.

    If you are talking about internal error bits on the message that was received but not acknowledged on the bus due to the monitor mode, then I don't know if there is anything we can do with that.  While I have not personally tried this in practice, If the device is internally reporting error on received messages, then any time the bit rate configuration settings are incorrect, the device will set errors for the message.  This might actually be useful in determining whether the settings are correct for the bus since there are a variety of status and error registers for various aspects of the CAN protocol.

    Before I dig deeper, I would like to know if you are seeing the device transmit on the bus when it should be in monitor mode.

    Regards,

    Jonathan

  • Hi Jonathan,

    thank you for your detailed answer and for your interest in my approach.

    I knew already, that the Transceiver is a MCAN Boch transceiver, but i did not have the Idea before, to analyse the Bosch userguide. That's a great Idea. Thank you for that.

    I'm afraid to tell you, that your link to the userguide is not working properly, but I found the Userguide on my own, so it's no problem.

    You was right. I tried to set the MON Bit in the CCR-Reg without setting the INIT bit in a previous spi transfer.

    Now, I am able to listen on the bus without sending some dominant bits to the can bus.

    I am also able to receive messages, without sending an acknowledge, if my assumption of the baudrate does correlate with the baudrate of the bus.

    If my assumption of the baudrate is wrong (BUS has 250kB/s and my configuration is 500kB/s) i will get errors (PED and PEA bits set in the Interrupt register). This Information can be used, to determine, that my baudrate configuration  is not correct.

    If there are valid messages on the bus, the Baudrate of the bus is one of my assumed baudrates. So I am able now to determine the baudrate.

    ButI have a second Problem:

    If there is no message on the bus, I have to determine, if there is either no active Bus, or if the other Nodes on the Bus are not sending anything at the moment.

    My approach is:

    1.) Listen to all baudrates. (If there are messages on the bus, I have already determined, which baudrate it is)

    2.) Send a Message with an assumed baudrate and wait for an acknowledges or errors.

    3.) If I get errors, I know this was the wrong baudrate. If I get nothing, there is no active Can bus with other nodes, If I get an acknowledge, thi is the correct baudrate.

    To determine, if another node is also active on the Bus, I want to read out the LEC "Protocol status register" (0x1044).

    If the LEC is 3, Nobody aknowledged my message and there is no active Bus.

    I have tried this already, configuring the TCAN to normal mode where it is able to send Data (without MON) and I disconnected the TCAN from the other nodes in my Test configuration.

    The Message will be sent by the TCAN, but there is no LEC set in the Protocol status register.

    Do you have an Idea, why the LEC is not set?

    Thank you in advance,

    Flo

  • Hi Flo,

    I'm not sure why the LEC is not getting set and from the documentation I would be of the same opinion that it should be set.  I will have to look into this more.

    I did have another idea that you could try as an alternative.  Each successful transmission should be logged in the TX Buffer Transmission Occurred (TXBTO) register 0x10D8.  My idea is that if there is not an active node on the bus to acknowledge the message, then the corresponding bit in the TXBTO register will not be set.  However if there is another node on the bus that acknowledges the message, then the corresponding bit should be set to signify a successful transmission of the message to another node.  You might consider trying to monitor this register instead of the LEC for this part of your procedure.

    Regards,

    Jonathan

  • Hello again,

    i have finished the autobaud detection-project now and it is working very well.

    The LEC Ack-Error Bits are set now, if there is no active node on the bus.

    My problem with the missing "acknowledge error bits" was once again, a wrong configuration of the tcan in combination with a wrong hardware setup.

    Thank you for your help.

    Best regards,

    Flo

  • Hi Flo,

    Great!  I'm glad I could help you get it working. Feel free to reach back out if you have any additional questions.

    Regards,

    Jonathan