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-Q1: TCAN4550 loopback test register configuration

Part Number: TCAN4550-Q1
Other Parts Discussed in Thread: TCAN4550,

Hi ,

We are trying to bring up CAN interface in our custom board with TCAN4550 chip. 

So far, we are able to succesfully read the device ID register over SPI from the processor.

We wanted to test Internal and External Loop back mode .

like one in Figure 29 ,30 and 31 of the datasheet.

Could you please provide the  register setting to put TCAN4550 in  this test mode and how to test internal and external loop back,

Also the hadrware connection required for it.

We have create our linux driver code based on demo software

implemented Init_CAN  and Fill TX Fifo buffer with 123 can id and sending it.

we also took code from opensource for this tcan4550 chip and integrated it ,

code in drivers/net/can/spi/tcan4x5x.c .....

and compile cansend and candump  binaries and configuring can0 with ip link commands.

Please provide the register settings require to set tcan4550 in internal and external loopback mode and how to test it.

Regards

Raghu DP

Regards

Raghu DP

  • Raghu,

    Thanks for bringing this to our attention on E2E.

    For figures 30 and 31, the test mode register, 0x1010 can be used to enable loop back mode. For external loop back mode, where the device will transmit to the bus but not receive, all you need to do is enable loop back mode in register 0x1010. For internal loop back mode, you must enable loop back mode in register 0x1010, and set MON (bit 5 in register 0x1018) to 1. Setting MON to 1 disables the ability to transmit to the bus. 

    From there you will only need to connect to SPI as with loopback mode, since you are essentially using the device as normal, but disconnected from the CAN bus receiving data or receiving and transmitting data. Is this what is needed?

    Regards,

  • Hi Eric,

       Thanks for the reply.

    We wanted to test only software in the demo code.

    Internal loopback mode.

    Q1:

    As you mentioned, I will try setting the register.

    1.Init_CAN function in demo code.

    2. Setting 0x1010 register for Mon bit , enable loopback mode.

    3. Fill can message in txfifo 0 and enable txfifo 0 transfer.

    Do I get the data which I sent back in txfifo?

    Any interrupt generated or I need to read fifo registers.

    Q2:

    Next level is external loopback.

    Any connection recommendations and register setting for this?

    Q3:

    For fig 29.

    Setting bit 21 in 0x0800 register and bit 1 for m_core test config.

    How do I test transfer and recv from gpio2 txd and goio1 pin rxd.

    For data transfer is it same like filling txfifo with header ,payload then transfer?

    Can I connect txd to rxd .. gpio2 to goio1 to recv back transmitted data?

    Please let me know my understanding is correct and your suggestions.

    Thanks

    RaghuDP

  • Raghu,

    Q1: Yes, this should work. Typically in a CAN network, the controller must see an ACK bit at the end of the frame to receive the message in its memory. With loopback test mode enabled, this requirement doesn't need to happen and the controller should be able to receive the same message it transmitted.

    Q2:The only difference in configuration between external and internal loopback mode is the MON bit setting. For external loopback, the MON bit should be set to 0, for internal the MON bit should be set to 1.

    Q3: Figure 29 is meant to circumvent the integrated transceiver on the TCAN4550-Q1 and only utilize the MCAN controller that is integrated. So the idea is you connect GPO2 to the TXD of a CAN transceiver, and GPIO1 to the RXD of the CAN transceiver. This way you can configure messages in the TX FIFO to be transmitted from the GPO2 pin, to an external CAN transceiver, to the CAN bus. And the GPIO1 will receive messages from the RXD pin of the external CAN transceiver, storing the messages in the memory space. I would not recommend connecting RXD to TXD unless you only want to receive messages that you transmitted, but since there is no other node in this case to ACK the message, the CAN controller will send the message over and over until it errors out, due to never receiving an ACK for the transmitted message.

    Please let me know if this makes sense.

    Regards,

  • Hi Eric,

    I tried internal loopback as mentioned in Question 1.

    But I didn't recv any interrupt after sending data thru tx. I tried force full reading of interrupt register,that also didn't help.

    Could you please provide the code to test this internal loopback.

    Hope you are testing with msp controller connected to tcan4550 evm board in this case.

    Regards

    RaghuDP

  • Hi Eric ,

     I have configured TCAN4550 in loopback mode .

    Tried setting LOOPBACK and MON bit set for internal loop.  After writing data to txfifo am able to read it back in rxfifo.

    After this  i kept LOOPBACK mode  and cleared MON bit .  with is am able to send data to txfifo and read it back in rxfifo  and I can see data in CAN H/L line.

    Now i connected to TCAN4550 and flashed same software and tried to send from one device and recv from other device.

    but this is not working . 

    Any idea why am not able to recv data  on the other device ...

    How do i debug  this ?  i have 2 TCAN4550 device connected each other.

    Regards

    Raghu DP

  • Raghu,

    Now I'd recommend reading the TCAN4550-Q1 Software User's Guide, which instructs how to transmit and receive messages, and how to configure all the registers to do so on the TCAN4550-Q1. 

    Can you elaborate on it not working? What kind of issue are you seeing? Is there any data being transmitted on the CAN bus or is it just not sending anything at all?

    Regards,