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.

TCAN4550EVM: Can't send frames from SPI to CANFD

Part Number: TCAN4550EVM
Other Parts Discussed in Thread: TCAN4550

Tool/software:

Hi,

I am struggling with sending frames on the CANFD using the SPI. Here is my configuration:

  • Modes of Operation and Pin Configuration (h0800):
    • WAKE_CONFIG = 0b11
    • CLK_REF = 0b1
    • GPO2_CONFIG = 0b00
    • TEST_MODE_EN = 0b0
    • nWKRQ_VOLTAGE = 0b0
    • FAIL_SAFE_EN = 0b1
    • GPO1_GPO_CONFIG = 0b00
    • INH_DIS = 0b0
    • nWKRQ_CONFIG = 0b0
    • MODE_SEL = 0b10
    • DEVICE_RESET = 0b0
    • SWE_DIS = 0b1
    • TEST_MODE_CONFIG = 0b1
  • Nominal Bit Timing & Prescaler (h101C):
    • NSJW = 0b0000011
    • NBRP = 0x00
    • NTSEG1 = 0x0A
    • NTSEG2 = 0b0000011
  • Tx Buffer Configuration (h10C0):
    • TFQM = 0b0
    • TFQS = 0b000001
    • NDTB = 0b000001
    • TBSA = 0x8000
  • Tx Buffer Element Size Configuration (h10C8):
    • TBDS = 0b000
  • Tx Event FIFO Configuration (h10F0):
    • EFWM = 0b000011
    • EFS = 0b000011
    • EFSA = 0x8050
  • Data Bit Timing & Prescaler (h100C):
    • TDC = 0b0
    • DBRP = 0b00000
    • DTSEG1 = 0b01010
    • DTSEG2 = 0b0011
    • DSJW = 0b0011
  • Control Register (h1018):
    • NISO = 0b0
    • TXP = 0b0
    • EFBI = 0b0
    • PXHD = 0b0
    • BRSE = 0b1
    • FDOE = 0b1
    • TEST = 0b0
    • DAR = 0b0
    • MON = 0b1
    • CSR = 0b0
    • CSA = 0b0
    • ASM = 0b0
    • CCE = 0b1
    • INIT = 0b1
  • Tx Buffer Configuration (h10C0):
    • TFQS = 0b00001
    • NDTB = 0b00001
    • TBSA = 0x8000

The Tx start address is 0x8000 (MRAM). I am writing inside the MRAM at 0x8000 one word. Then I activate the Sending Register (h10D0), the Tx Buffer Request Pending should be 1, but the whole register is 0. If I understand well, that means the TCAN doesn't know it has to send the frame.

FWI: I can read a register I previously configured, meaning I can write and read inside the registers. I double-checked every configuration by reading them, everything is fine on this side.

Do you have any idea to what it can be due ?

Thank you by advance !

  • Hi T R,

    I'm not sure what Nominal and Data bit rates and sample point % locations you are trying to configure.  The CAN protocol limits the max Nominal bit rate to 1M, and if I'm calculating the settings correctly, it looks like you are trying to use 2.667M for both the Nominal and Data settings, which is too fast for the Nominal, and also it is not a common Data rate. 

    For the TX Buffer, you will need to wrote more than one word and a TX buffer element requires 2 words of data just for the message header that contains the control and ID bits.  The data bytes will then require additional words.

    I would suggest reviewing the TCAN45xx Software User's Guide (Link) and follow the examples on configuring the bit timing and MRAM.  Then see section 4.2.8 for how to create the TX Buffers for a CAN message and then follow the steps in section 4.3 for sending and receiving CAN messages.

    Additional detailed information on the MCAN Controller IP that was developed by Bosch and used in the TCAN4550 can be found in the M_CAN User's Manual (Link).  The only point I would like to note is that the TCAN4550 has added an offset of 0x1000 to each MCAN register address.  For example the Control Register is listed as 0x18 in the MCAN User's Manual, and it is 0x1018 in the TCAN4550.  Otherwise all information in the MCAN User's Manual is applicable to the TCAN4550.

    Regards,

    Jonathan