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: Initialization and Send/Receive code

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

I am using TCAN4550-Q1 to use CAN communication.

However, I did initialization of IC and made send function, but there is no output signal CANL/CANH.

I am using 25Mhz external oscillator so I expected baud rate 500kbps(normal)/1.25Mhz(FD)

CAN you give me below?

1. register setting of the IC and MRAM

2. Sending / Receiving IC

If you have full code to run TCAN4550, then please send me via below mail

jungyong.kim@hyundai-autron.com

  • Please send the reply to jinnan.jung@hyundai-autron.com also.
  • Hi Jungyong,

    Thank you for your questions.  I will follow up with you via an email and CC the alternate email address that you have mentioned.

    For starters, you may want to refer to the Software Users Guide for the TCAN4550-Q1.

    Best Regards,

    Max Megee

    TI Transceiver Interface

  • We followed the SW user guide and we obeyed all mandatory things.
    The email which has detail information was sent by jinnan.jung@hyundai-autron.com.
    Please reply the email, it is already 10days passed .
  • We found one thing about this issue.
    We tried to change CSR to 0, because we do not want to use clock stop request.
    However, it sticks to 1 and CSA is stuck to 1 successively. Even it we write 0 to CSR, but it does not change.
    I think it is the key to solve our problem.
    Let me know how to handle this bit.

    Thanks.
    JY
  • Hello Junyong,

    Many apologies for my delay in response.  I conferred with our software support for the TCAN4550 to walk through the configuration sequence that you sent. 

    To start, the fact that you are always seeing a 1 on the CSR bit may indicate that the device is still in Standby Mode.  In your configuration sequence, your final step is to put the TCAN4550 into Normal Mode.  Do you perform a read of the mode control register (0x0800) in order to verify that you are indeed in Normal Mode?  There may be some flag set that could be preventing your transition to Normal Mode.  If that is the case, then we will want to focus our debug there.  

    If you are indeed in Normal Mode, then have you implemented any code that would initiate a CAN message, following section 4.3.1 of the Software User's Guide (Writing a CAN Message to the TX Buffer)?  The initialization sequence that you sent me stops after putting the device into Normal Mode.  Is there any code that programs the TX buffer with a CAN message and initiates the transmission of the CAN bus?

    Best Regards,

    Max 

  • Hello Max,

    Thanks for replying a comment on this issue.

    I post the sequence i did for initialization

    For each write action, I checked the value written(which is "Read the value")

    Please check this sequence table, and let me know your opinion.

    Thanks.

    JY

  • Hi Jungyong, 

    Did you mean to attach something to the previous response?  All that came through is a symbol: 

    I am not able to click on a link or see any code sequence from what you sent.

    Also, were you able to verify that the TCAN4550 device did in fact enter Normal Mode after your initialization sequence?  I just want to double check this step since you mentioned above that the CSR bit was still logic '1'.

    Thanks,
    Max

  • Hello, Max

    I post the whole sequence for initialization and sending the message.

    ------------------------------------------------------------------------------------------------

    *Initialization 

    Command        Address        Written Value        Read Value

    0. Reset IC and MRAM
    Write&Read        0x0800        0x00000004        0xC8000468
    Write            0x8000~0x9000        0x00000000

    1. Make IC Standby
    Write&Read 0x0800 0x30000242 0x30000242

    2. Unlock protected Register
    Write&Read 0x1018 0x00000063 0x0000001B

    3. Set FD mode
    Write&Read 0x1018 0x00000363 0x00000363

    4. Set Baudrate
    Write&Read 0x101C 0x02050702 0x02050702
    Write&Read 0x100C 0x00820721 0x00820721

    5. Set Interrupt Register
    Write&Read 0x1054 0x000000FF 0x000000FF

    6. Set MRAM
    Write&Read 0x8000 0x90000000 0x90000000
    Write&Read 0x1084 0x00018000 0x00018000
    Write&Read 0x8008 0x40000000 0x40000000
    Write&Read 0x1088 0x00018008 0x00018008
    Write&Read 0x10A0 0x00048010 0x00048010
    Write&Read 0x10AC 0x00008540 0x00008540
    Write&Read 0x10B0 0x000580F0 0x000580F0
    Write&Read 0x10BC 0x00000776 0x00000776
    Write&Read 0x10F0 0x00038258 0x00038258
    Write&Read 0x10C0 0x000A8270 0x000A8270
    Write&Read 0x10C8 0x00000007 0x00000007

    7. Set CCE, INIT
    Write&Read 0x1018 0x00000362 0x00000379

    8. Set Normal Mode
    Write&Read 0x0800 0x30000282 0x30000282

    9. Check 0x1018 state
    Read 0x1018 0x00000360

    *Send function
    Read 0x10C4 0x0000000A
    Write&Read 0x8270 0x00000201 0x00000201
    Write&Read 0x8274 0x01380000 0x01380000
    Write&Read 0x8278 0x44332211 0x44332211
    Write&Read 0x827C 0x88776655 0x88776655
    Read 0x10C4 0x0000000A <- it should be decreased
    Write&Read 0x10D0 0x00000001 <- it does not transmit data

    ------------------------------------------------------------------------------------------------

    I checked it entered to normal mode and CSR = 0

    However, during sending message, I found put index (TFQP of 0x10C4) is not changing even I put tx data int buffer.

    Please help me! 

    Best regards,

    Jungyong Kim

  • Hi Jungyong,

    Thank you for your patience.  I was out-of-office yesterday, but I conferred with our systems support engineer today.  

    We have identified an issue in your initialization sequence that is preventing you from transmitting onto the bus.  In the 0x1018 register (CCCR), you have set bit 5, the MON bit, as a logic '1'.  This happens on Step 2, Step 3, Step 7, and you read it back on Step 9 above.  When the MON bit is set, the TCAN4550 acts as a listen-only monitor of the CAN bus.  Therefore, you will be prevented from transmitting from the bus.  Change your sequence to keep the MON bit set to '0', and let me know if that helps.  

    Also, your assumption about the 0x10C4 register (TXQFS) is incorrect.  In TX FIFO mode, this register will not decrease until a successful transmission occurs.  So you will not be able to read the decrease until after the message is transmitted.

    Best Regards,

    Max 

  • Hello Max,

    I modified the code as you commented.

    ------------------------------------------------------------------------------------------------

    *Initialization 

    Command        Address        Written Value        Read Value

    0. Reset IC and MRAM
    Write&Read        0x0800        0x00000004        0xC8000468
    Write                   0x8000~0x9000        0x00000000

    1. Make IC Standby
    Write&Read         0x0800         0x30000242         0x30000242

    2. Unlock protected Register 
    Write&Read 0x1018 0x00000003 0x0000001B

    3. Set FD mode
    Write&Read 0x1018 0x00000303 0x0000031B

    4. Set Baudrate
    Write&Read 0x101C 0x02050702 0x02050702
    Write&Read 0x100C 0x00820721 0x00820721

    5. Set Interrupt Register
    Write&Read 0x1054 0x000000FF 0x000000FF

    6. Set MRAM
    Write&Read 0x8000 0x90000000 0x90000000
    Write&Read 0x1084 0x00018000 0x00018000
    Write&Read 0x8008 0x40000000 0x40000000
    Write&Read 0x1088 0x00018008 0x00018008
    Write&Read 0x10A0 0x00048010 0x00048010
    Write&Read 0x10AC 0x00008540 0x00008540
    Write&Read 0x10B0 0x000580F0 0x000580F0
    Write&Read 0x10BC 0x00000776 0x00000776
    Write&Read 0x10F0 0x00038258 0x00038258
    Write&Read 0x10C0 0x000A8270 0x000A8270
    Write&Read 0x10C8 0x00000007 0x00000007

    7. Set CCE, INIT
    Write&Read 0x1018 0x00000302 0x0000031A

    8. Set Normal Mode
    Write&Read 0x0800 0x30000282 0x30000282

    9. Check 0x1018 state
    Read 0x1018                                 0x00000300

    *Send function
    Read 0x10C4 0x0000000A
    Write&Read 0x8270 0x00000201 0x00000201 
    Write&Read 0x8274 0x01380000 0x01380000
    Write&Read 0x8278 0x44332211 0x44332211 
    Write&Read 0x827C 0x88776655 0x88776655 
    Read 0x10C4                             0x0000000A 
    Write&Read 0x10D0 0x00000001

    We changed MON bit of 0x1018 to 0, however the transmission was not conducted. 

    Can you give us an example implementation code of TI database?

    It is killing me even it seems not a biggie...

    I hope problem solved as soon as possible.

    Best regards

    JY

      

  • Jungyong,

    Thanks for the update.  We are currently in the process of approving our example code for public release.  I will let you know as soon as that is available when our team approves the release.  

    In the meantime, let's continue to debug.  One thing that may help is to read the PSR register (0x1044).  This will help give a report on what kind of error may be occurring during the transmission request.  Can you follow the following procedure and let me know the results?

    1. Attempt to transmit a message with your code from above.

    2. Wait sufficiently long to allow TCAN4550 time to attempt the transmission (about 0.5 second).

    3. Read the PSR register (0x1044).  

    4. Read the TXBAR register (0x10D0).

    5. Read the TXBTO register (0x10D8).  

    Let me know what you read from the three registers above.  That should help us in debugging the setup code.

    Again, I will let you know when our example software is available for public release.  It's currently in the approval process now.

    Thanks,

    Max