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: Problems writing to control register.

Part Number: TCAN4550-Q1
Other Parts Discussed in Thread: EK-TM4C123GXL, BOOSTXL-CANFD-LIN, TCAN4550

setup:

    EK-TM4C123GXL connected to a BOOSTXL-CANFD-LIN

    SPI:

        mosi - B7, miso-B6, CLK-B4, and CS-A4. I am using SSI_FRF_MOTO_MODE_0 with a bit rate of 2000000.

I am trying to spi write 0x00000003 to set the CCCR.CCE and CCCR.INIT bits under the Control Register however, but my write doesn't seem to do anything as the CCE bit doesn't set, every time I read from that register after I attempt to set it, I get 0x00000019 back which is the reset according to the documentation. Wondering why that would be the case?

  • Hi Brendan,

    Thanks for bringing your question to E2E. 

    Have you been able to verify that other SPI transactions are successful between the MCU and the TCAN4550? A good way to test this is by use of the scratchpad register (h0808) to ensure the MCU is able to write and read back the expected value correctly. This will also ensure that the crystal oscillator is working properly as all register higher than h000C require this clock source to be active and stable. 

    It is possible an attempt to unlock the protected registers to fail the MCAN is busy during the request. It is common to have the software attempt the unlock multiple times before reporting a failure in the configuration attempt. Please see the TCAN4x5x_MCAN_EnableProtectedRegisters() function in the TCAN4550 DEMO drivers available on the store page for the device for reference on how the unlock these fields. The TCAN4x5x_MCAN_ConfigureCCCRRegister() function can then be used to test the desired configuration bits. 

    Let me know if either of these help with your testing and if you have any other questions in the meantime. 

    Regards, 
    Eric Schott

  • Hi Eric,

    Thanks for the help.

    I tested the scratchpad register, I got an initial read of 0x00000000, which appears to be correct however I wrote 0xFFFFFFFF to the register and my read after that returned a 0xFFFFFF29, so I was off by the last byte with spi. Changing my logic for where I check for the transmit to complete after the last byte is sent seemed to fix that. Also, I have been following the TCAN4550 DEMO from the store page, just configuring it for my specific MCU.

    Thank you,

    Brendan