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.

LP-AM263: LP-AM263 MCAN1 Signal Question

Part Number: LP-AM263
Other Parts Discussed in Thread: SYSCONFIG, TCAN1044V

Hi expert,

    Have we measure the waveform from LP-AM263x MCAN1. We got report that the signals doesn't look correct.

We tested MCAN1 on CC board, so MCAN1 module should be no problem.

However, the signal emit from LP-AM263x is wrong. Please refer to capture. We measure the TX signal from J7-64 pin on LP-AM263x.

Basically, we import loopback demo from SDK8.5. Change from MCAN0 to MCAN1. Enable MUX and SEL to route MCAN1_TX, MCAN1_RX to J7 header.  And change loopback mode from internal loopback to external loopback so we can get signal on TX pin. Loopback test pass but waveform is wrong. the baud rate is set to 1Mbps/5Mbps.

 1. From the measurement,  we send 10 64bytes CAN-FD frame, we only got 10 pulses on TX pin. The signal low level can only reach around 1V. Waveform also miss the detail of data.

2. If we connect to external CAN transceiver like TCAN1042/1462EVM ,  by using 5V and 3.3C on LP-AM263x, we get no signal on TX by the same test software.

3. If we use external power to supply TCAN transceiver VCC and VIO, we can get something on TX and CAN-H, CAN-L.  However, the frequency is wrong, TX signal only show 5.5KHZ only.

 

Question, 

1. Is there any limitation regarding LP-AM263x 5V and 3.3V supply? What is the max current it can support?

2. It look like MUX can not drive signal correctly. Can you please check?

Regards

Andre

  • Update test code

    6443.mcan_loopback_interrupt.c
    /*
     *  Copyright (C) 2021 Texas Instruments Incorporated
     *
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions
     *  are met:
     *
     *    Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     *    Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the
     *    distribution.
     *
     *    Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /* This example demonstrates the CAN message transmission and reception in
     * digital loop back mode with the following configuration.
     *
     * CAN FD Message Format.
     * Message ID Type is Standard, Msg Id 0xC0.
     * MCAN is configured in Interrupt Mode.
     * MCAN Interrupt Line Number 0.
     * Arbitration Bit Rate 1Mbps.
     * Data Bit Rate 5Mbps.
     * Buffer mode is used for Tx and RX to store message in message RAM.
     *
     * Message is transmitted and received back internally using internal loopback
     * mode. When the received message id and the data matches with the transmitted
     * one, then the example is completed.
     *
     */
    
    #include <stdio.h>
    #include <kernel/dpl/DebugP.h>
    #include <kernel/dpl/AddrTranslateP.h>
    #include <kernel/dpl/SemaphoreP.h>
    #include <drivers/mcan.h>
    #include "ti_drivers_config.h"
    #include "ti_drivers_open_close.h"
    #include "ti_board_open_close.h"
    
    #define APP_MCAN_BASE_ADDR                       (CONFIG_MCAN1_BASE_ADDR)
    #define APP_MCAN_INTR_NUM                        (CONFIG_MCAN1_INTR)
    #define APP_MCAN_MSG_LOOP_COUNT                  (10U)
    
    /* Allocate Message RAM memory section to filter elements, buffers, FIFO */
    /* Maximum STD Filter Element can be configured is 128 */
    #define APP_MCAN_STD_ID_FILTER_CNT               (1U)
    /* Maximum EXT Filter Element can be configured is 64 */
    #define APP_MCAN_EXT_ID_FILTER_CNT               (0U)
    /* Maximum TX Buffer + TX FIFO, combined can be configured is 32 */
    #define APP_MCAN_TX_BUFF_CNT                     (1U)
    #define APP_MCAN_TX_FIFO_CNT                     (0U)
    /* Maximum TX Event FIFO can be configured is 32 */
    #define APP_MCAN_TX_EVENT_FIFO_CNT               (0U)
    /* Maximum RX FIFO 0 can be configured is 64 */
    #define APP_MCAN_FIFO_0_CNT                      (0U)
    /* Maximum RX FIFO 1 can be configured is 64 and
     * rest of the memory is allocated to RX buffer which is again of max size 64 */
    #define APP_MCAN_FIFO_1_CNT                      (0U)
    
    /* Standard Id configured in this app */
    #define APP_MCAN_STD_ID                          (0xC0U)
    #define APP_MCAN_STD_ID_MASK                     (0x7FFU)
    #define APP_MCAN_STD_ID_SHIFT                    (18U)
    
    #define APP_MCAN_EXT_ID_MASK                     (0x1FFFFFFFU)
    
    /* In the CAN FD format, the Data length coding differs from the standard CAN.
     * In case of standard CAN it is 8 bytes */
    static const uint8_t gMcanDataSize[16U] = {0U,  1U,  2U,  3U,
                                               4U,  5U,  6U,  7U,
                                               8U,  12U, 16U, 20U,
                                               24U, 32U, 48U, 64U};
    
    /* Semaphore to indicate transfer completion */
    static SemaphoreP_Object gMcanTxDoneSem, gMcanRxDoneSem;
    static HwiP_Object       gMcanHwiObject;
    static uint32_t          gMcanBaseAddr;
    
    /* Static Function Declarations */
    
    static void    App_mcanMuxSelect(void);
    static void    App_mcanEnableTransceiver(void);
    static void    App_mcanIntrISR(void *arg);
    static void    App_mcanConfig(Bool enableInternalLpbk);
    static void    App_mcanInitMsgRamConfigParams(
                   MCAN_MsgRAMConfigParams *msgRAMConfigParams);
    static void    App_mcanEnableIntr(void);
    static void    APP_MCAN_initSetBitTimeParams(MCAN_BitTimingParams *bitTimes);
    static void    App_mcanConfigTxMsg(MCAN_TxBufElement *txMsg);
    static void    App_mcanCompareMsg(MCAN_TxBufElement *txMsg,
                                      MCAN_RxBufElement *rxMsg);
    static void    App_mcanInitStdFilterElemParams(
                                      MCAN_StdMsgIDFilterElement *stdFiltElem,
                                      uint32_t bufNum);
    
    void mcan_loopback_interrupt_main(void *args)
    {
        int32_t                 status = SystemP_SUCCESS;
        HwiP_Params             hwiPrms;
        MCAN_TxBufElement       txMsg;
        MCAN_ProtocolStatus     protStatus;
        MCAN_RxBufElement       rxMsg;
        MCAN_RxNewDataStatus    newDataStatus;
        MCAN_ErrCntStatus       errCounter;
        uint32_t                i, bufNum, fifoNum, bitPos = 0U;
    
        /* Open drivers to open the UART driver for console */
        Drivers_open();
        Board_driversOpen();
    
        App_mcanMuxSelect();
        App_mcanEnableTransceiver();
    
        DebugP_log("[MCAN] Loopback Interrupt mode, application started ...\r\n");
    
        /* Construct Tx/Rx Semaphore objects */
        status = SemaphoreP_constructBinary(&gMcanTxDoneSem, 0);
        DebugP_assert(SystemP_SUCCESS == status);
        status = SemaphoreP_constructBinary(&gMcanRxDoneSem, 0);
        DebugP_assert(SystemP_SUCCESS == status);
    
        /* Register interrupt */
        HwiP_Params_init(&hwiPrms);
        hwiPrms.intNum      = APP_MCAN_INTR_NUM;
        hwiPrms.callback    = &App_mcanIntrISR;
        status              = HwiP_construct(&gMcanHwiObject, &hwiPrms);
        DebugP_assert(status == SystemP_SUCCESS);
    
        /* Assign MCAN instance address */
        gMcanBaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(APP_MCAN_BASE_ADDR);
    
        /* Configure MCAN module, Enable LoopBack Mode */
        App_mcanConfig(TRUE);
    
        /* Enable Interrupts */
        App_mcanEnableIntr();
    
        /* Transmit And Receive Message */
        for (i = 0U; i < APP_MCAN_MSG_LOOP_COUNT; i++)
        {
            /* Configure Tx Msg to transmit */
            App_mcanConfigTxMsg(&txMsg);
    
            /* Select buffer number, 32 buffers available */
            bufNum = 0U;
            /* Enable Transmission interrupt for the selected buf num,
             * If FIFO is used, then need to send FIFO start index until FIFO count */
            status = MCAN_txBufTransIntrEnable(gMcanBaseAddr, bufNum, (uint32_t)TRUE);
            DebugP_assert(status == CSL_PASS);
    
            /* Write message to Msg RAM */
            MCAN_writeMsgRam(gMcanBaseAddr, MCAN_MEM_TYPE_BUF, bufNum, &txMsg);
    
            /* Add request for transmission, This function will trigger transmission */
            status = MCAN_txBufAddReq(gMcanBaseAddr, bufNum);
            DebugP_assert(status == CSL_PASS);
    
            /* Wait for Tx completion */
            SemaphoreP_pend(&gMcanTxDoneSem, SystemP_WAIT_FOREVER);
    
            MCAN_getProtocolStatus(gMcanBaseAddr, &protStatus);
            /* Checking for Tx Errors */
            if (((MCAN_ERR_CODE_NO_ERROR != protStatus.lastErrCode) ||
                 (MCAN_ERR_CODE_NO_CHANGE != protStatus.lastErrCode)) &&
                ((MCAN_ERR_CODE_NO_ERROR != protStatus.dlec) ||
                 (MCAN_ERR_CODE_NO_CHANGE != protStatus.dlec)) &&
                (0U != protStatus.pxe))
            {
                 DebugP_assert(FALSE);
            }
    
            /* Wait for Rx completion */
            SemaphoreP_pend(&gMcanRxDoneSem, SystemP_WAIT_FOREVER);
    
            /* Checking for Rx Errors */
            MCAN_getErrCounters(gMcanBaseAddr, &errCounter);
            DebugP_assert((0U == errCounter.recErrCnt) &&
                          (0U == errCounter.canErrLogCnt));
    
            /* Get the new data staus, indicates buffer num which received message */
            MCAN_getNewDataStatus(gMcanBaseAddr, &newDataStatus);
            MCAN_clearNewDataStatus(gMcanBaseAddr, &newDataStatus);
    
            /* Select buffer and fifo number, Buffer is used in this app */
            bufNum = 0U;
            fifoNum = MCAN_RX_FIFO_NUM_0;
    
            bitPos = (1U << bufNum);
            if (bitPos == (newDataStatus.statusLow & bitPos))
            {
                MCAN_readMsgRam(gMcanBaseAddr, MCAN_MEM_TYPE_BUF, bufNum, fifoNum, &rxMsg);
            }
            else
            {
                DebugP_assert(FALSE);
            }
    
            /* Compare Tx/Rx data */
            App_mcanCompareMsg(&txMsg, &rxMsg);
        }
        /* De-Construct Tx/Rx Semaphore objects */
        HwiP_destruct(&gMcanHwiObject);
        SemaphoreP_destruct(&gMcanTxDoneSem);
        SemaphoreP_destruct(&gMcanRxDoneSem);
    
        DebugP_log("All tests have passed!!\r\n");
    
        Board_driversClose();
        Drivers_close();
    
        return;
    }
    
    static void App_mcanConfig(Bool enableInternalLpbk)
    {
        MCAN_StdMsgIDFilterElement stdFiltElem[APP_MCAN_STD_ID_FILTER_CNT] = {0U};
        MCAN_InitParams            initParams = {0U};
        MCAN_ConfigParams          configParams = {0U};
        MCAN_MsgRAMConfigParams    msgRAMConfigParams = {0U};
        MCAN_BitTimingParams       bitTimes = {0U};
        uint32_t                   i;
    
        /* Initialize MCAN module initParams */
        MCAN_initOperModeParams(&initParams);
        /* CAN FD Mode and Bit Rate Switch Enabled */
        initParams.fdMode          = TRUE;
        initParams.brsEnable       = TRUE;
    
        /* Initialize MCAN module Global Filter Params */
        MCAN_initGlobalFilterConfigParams(&configParams);
    
        /* Initialize MCAN module Bit Time Params */
        /* Configuring default 1Mbps and 5Mbps as nominal and data bit-rate resp */
        APP_MCAN_initSetBitTimeParams(&bitTimes);
    
        /* Initialize MCAN module Message Ram Params */
        App_mcanInitMsgRamConfigParams(&msgRAMConfigParams);
    
        /* Initialize Filter element to receive msg, should be same as tx msg id */
        for (i = 0U; i < APP_MCAN_STD_ID_FILTER_CNT; i++)
        {
            App_mcanInitStdFilterElemParams(&stdFiltElem[i], i);
        }
        /* wait for memory initialization to happen */
        while (FALSE == MCAN_isMemInitDone(gMcanBaseAddr))
        {}
    
        /* Put MCAN in SW initialization mode */
        MCAN_setOpMode(gMcanBaseAddr, MCAN_OPERATION_MODE_SW_INIT);
        while (MCAN_OPERATION_MODE_SW_INIT != MCAN_getOpMode(gMcanBaseAddr))
        {}
    
        /* Initialize MCAN module */
        MCAN_init(gMcanBaseAddr, &initParams);
        /* Configure MCAN module Gloabal Filter */
        MCAN_config(gMcanBaseAddr, &configParams);
        /* Configure Bit timings */
        MCAN_setBitTime(gMcanBaseAddr, &bitTimes);
        /* Configure Message RAM Sections */
        MCAN_msgRAMConfig(gMcanBaseAddr, &msgRAMConfigParams);
        /* Set Extended ID Mask */
        MCAN_setExtIDAndMask(gMcanBaseAddr, APP_MCAN_EXT_ID_MASK);
    
        /* Configure Standard ID filter element */
        for (i = 0U; i < APP_MCAN_STD_ID_FILTER_CNT; i++)
        {
            MCAN_addStdMsgIDFilter(gMcanBaseAddr, i, &stdFiltElem[i]);
        }
        if (TRUE == enableInternalLpbk)
        {
            MCAN_lpbkModeEnable(gMcanBaseAddr, MCAN_LPBK_MODE_EXTERNAL, TRUE);
        }
    
        /* Take MCAN out of the SW initialization mode */
        MCAN_setOpMode(gMcanBaseAddr, MCAN_OPERATION_MODE_NORMAL);
        while (MCAN_OPERATION_MODE_NORMAL != MCAN_getOpMode(gMcanBaseAddr))
        {}
    
        return;
    }
    
    static void App_mcanConfigTxMsg(MCAN_TxBufElement *txMsg)
    {
        uint32_t i;
    
        /* Initialize message to transmit */
        MCAN_initTxBufElement(txMsg);
        /* Standard message identifier 11 bit, stored into ID[28-18] */
        txMsg->id  = ((APP_MCAN_STD_ID & MCAN_STD_ID_MASK) << MCAN_STD_ID_SHIFT);
        txMsg->dlc = MCAN_DATA_SIZE_64BYTES; /* Payload size is 64 bytes */
        txMsg->fdf = TRUE; /* CAN FD Frame Format */
        txMsg->xtd = FALSE; /* Extended id not configured */
        for (i = 0U; i < gMcanDataSize[MCAN_DATA_SIZE_64BYTES]; i++)
        {
            txMsg->data[i] = i;
        }
    
        return;
    }
    
    static void App_mcanInitStdFilterElemParams(MCAN_StdMsgIDFilterElement *stdFiltElem,
                                                uint32_t bufNum)
    {
        /* sfid1 defines the ID of the standard message to be stored. */
        stdFiltElem->sfid1 = APP_MCAN_STD_ID;
        /* As buffer mode is selected, sfid2 should be bufNum[0 - 63] */
        stdFiltElem->sfid2 = bufNum;
        /* Store message in buffer */
        stdFiltElem->sfec  = MCAN_STD_FILT_ELEM_BUFFER;
        /* Below configuration is ignored if message is stored in buffer */
        stdFiltElem->sft   = MCAN_STD_FILT_TYPE_RANGE;
    
        return;
    }
    
    static void App_mcanEnableIntr(void)
    {
        MCAN_enableIntr(gMcanBaseAddr, MCAN_INTR_MASK_ALL, (uint32_t)TRUE);
        MCAN_enableIntr(gMcanBaseAddr,
                        MCAN_INTR_SRC_RES_ADDR_ACCESS, (uint32_t)FALSE);
        /* Select Interrupt Line 0 */
        MCAN_selectIntrLine(gMcanBaseAddr, MCAN_INTR_MASK_ALL, MCAN_INTR_LINE_NUM_0);
        /* Enable Interrupt Line */
        MCAN_enableIntrLine(gMcanBaseAddr, MCAN_INTR_LINE_NUM_0, (uint32_t)TRUE);
    
        return;
    }
    
    static void App_mcanInitMsgRamConfigParams(MCAN_MsgRAMConfigParams
                                               *msgRAMConfigParams)
    {
        int32_t status;
    
        MCAN_initMsgRamConfigParams(msgRAMConfigParams);
    
        /* Configure the user required msg ram params */
        msgRAMConfigParams->lss = APP_MCAN_STD_ID_FILTER_CNT;
        msgRAMConfigParams->lse = APP_MCAN_EXT_ID_FILTER_CNT;
        msgRAMConfigParams->txBufCnt = APP_MCAN_TX_BUFF_CNT;
        msgRAMConfigParams->txFIFOCnt = APP_MCAN_TX_FIFO_CNT;
        /* Buffer/FIFO mode is selected */
        msgRAMConfigParams->txBufMode = MCAN_TX_MEM_TYPE_BUF;
        msgRAMConfigParams->txEventFIFOCnt = APP_MCAN_TX_EVENT_FIFO_CNT;
        msgRAMConfigParams->rxFIFO0Cnt = APP_MCAN_FIFO_0_CNT;
        msgRAMConfigParams->rxFIFO1Cnt = APP_MCAN_FIFO_1_CNT;
        /* FIFO blocking mode is selected */
        msgRAMConfigParams->rxFIFO0OpMode = MCAN_RX_FIFO_OPERATION_MODE_BLOCKING;
        msgRAMConfigParams->rxFIFO1OpMode = MCAN_RX_FIFO_OPERATION_MODE_BLOCKING;
    
        status = MCAN_calcMsgRamParamsStartAddr(msgRAMConfigParams);
        DebugP_assert(status == CSL_PASS);
    
        return;
    }
    
    static void App_mcanCompareMsg(MCAN_TxBufElement *txMsg,
                                   MCAN_RxBufElement *rxMsg)
    {
        uint32_t i;
    
        if (((txMsg->id >> APP_MCAN_STD_ID_SHIFT) & APP_MCAN_STD_ID_MASK) ==
                ((rxMsg->id >> APP_MCAN_STD_ID_SHIFT) & APP_MCAN_STD_ID_MASK))
        {
            for (i = 0U; i < gMcanDataSize[MCAN_DATA_SIZE_64BYTES]; i++)
            {
                if (txMsg->data[i] != rxMsg->data[i])
                {
                    DebugP_logError("Data mismatch !!!\r\n");
                    DebugP_assert(FALSE);
                }
            }
        }
        else
        {
            DebugP_logError("Message ID mismatch !!!\r\n");
            DebugP_assert(FALSE);
        }
    
        return;
    }
    
    static void App_mcanIntrISR(void *arg)
    {
        uint32_t intrStatus;
    
        intrStatus = MCAN_getIntrStatus(gMcanBaseAddr);
        MCAN_clearIntrStatus(gMcanBaseAddr, intrStatus);
    
        if (MCAN_INTR_SRC_TRANS_COMPLETE ==
            (intrStatus & MCAN_INTR_SRC_TRANS_COMPLETE))
        {
            SemaphoreP_post(&gMcanTxDoneSem);
        }
    
        /* If FIFO0/FIFO1 is used, then MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG macro
         * needs to be replaced by MCAN_INTR_SRC_RX_FIFO0_NEW_MSG/
         * MCAN_INTR_SRC_RX_FIFO1_NEW_MSG respectively */
        if (MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG ==
            (intrStatus & MCAN_INTR_SRC_DEDICATED_RX_BUFF_MSG))
        {
            SemaphoreP_post(&gMcanRxDoneSem);
        }
    
        return;
    }
    
    static void App_mcanMuxSelect(void)
    {
        uint32_t    gpioBaseAddr_en, pinNum_en;
        uint32_t    gpioBaseAddr_sel, pinNum_sel;
        /* Get address after translation translate */
        gpioBaseAddr_en = (uint32_t) AddrTranslateP_getLocalAddr(AM263_U52_MUX_EN_GPIO58_BASE_ADDR);
        pinNum_en      = AM263_U52_MUX_EN_GPIO58_PIN;
    
        GPIO_setDirMode(gpioBaseAddr_en, pinNum_en, AM263_U52_MUX_EN_GPIO58_DIR);
        GPIO_pinWriteHigh(gpioBaseAddr_en, pinNum_en);
        ClockP_sleep(1); /* just make sure MUX route is stable */
    
        gpioBaseAddr_sel = (uint32_t) AddrTranslateP_getLocalAddr(AM263_U52_MUX_SEL_GPIO63_BASE_ADDR);
        pinNum_sel      = AM263_U52_MUX_SEL_GPIO63_PIN;
    
        GPIO_setDirMode(gpioBaseAddr_sel, pinNum_sel,AM263_U52_MUX_SEL_GPIO63_DIR);
        GPIO_pinWriteHigh(gpioBaseAddr_sel, pinNum_sel);
    
    
    }
    
    
    static void App_mcanEnableTransceiver(void)
    {
     /*
      * Do nothing
      * We use HW setting to pull low STB directly
      */
    
    }
    
    
    static void APP_MCAN_initSetBitTimeParams(MCAN_BitTimingParams *bitTimes)
    {
        /* Arbitrary bitrate to 1Mbps, sample point @75%
         * Data bit rate to 5Mbps sample point @75%
         *
         * ip link set can0 up type can tq 125 prop-seg 33 phase-seg1 26 phase-seg2 20 sjw 20 \
         * dtq 125 dprop-seg 6 dphase-seg1 5 dphase-seg2 4 dsjw 4 restart-ms 1000 berr-reporting on fd on
         *
         */
    
        if (bitTimes != NULL)
        {
            /* Initialize bit timings */
            bitTimes->nomRatePrescalar   = 0;
            bitTimes->nomTimeSeg1        = 58;
            bitTimes->nomTimeSeg2        = 19;
            bitTimes->nomSynchJumpWidth  = 19;
            bitTimes->dataRatePrescalar  = 0;
            bitTimes->dataTimeSeg1       = 10;
            bitTimes->dataTimeSeg2       = 3;
            bitTimes->dataSynchJumpWidth = 3;
        }
    
        return;
    }
    
    
    

  • Removing U14 ESD protection doesn't help. Bus behavior is still wrong. Only MUX U52 in between MCAN1_TX and AM263x.

    Regards

    Andre

  • Hello Andre,

    Sorry for the delay in getting to your questions here. I haven't quite gotten the same example going but I was able to get my hands on a couple CAN BoosterPacks earlier today to investigate with further in the coming days.

    1. Is there any limitation regarding LP-AM263x 5V and 3.3V supply? What is the max current it can support?

    When powered from a proper USB-C adapter, the LaunchPad would support 5V at 3A.

    2. It look like MUX can not drive signal correctly. Can you please check?

    I am setting up my LP-AM263 with a BoosterPack to test this but in the meantime some initial thoughts:

    Getting a 5V supply from a breadboard may be injecting notable noise into the system. The 5V rail going to the EVM should be checked to see how clean it is when coming from the breadboard. Our recommendation would be to use 5V from the LaunchPad by taking it from one of the BoosterPack 5V rails. I don't see an image where that connection is being made, but the LaunchPad 5V line from a BoosterPack rail should not be a root cause for why the MCAN1 signals are not seen as long they are connected properly.

    Best Regards,

    Ralph Jacobi

  • Ralph,

        Let's focus on signal emit on J7-64 pin first. You can just connect probe to MCAN1_TX pin and measure the signal.

    like picture as below. No external power and I use 65W type-c power adapter to provide power.

    The signal capture by scope shows  as below.  I don't think it is correct digital signal and "0", "1" content can't match the program. 

    ESD protection also be removed. The result is the same. 

    Let's clarify this first.

    Regards

    Andre

  • Hello Andre,

    The mux negatively influencing the signal to the extent shown is unlikely which is why my initial comments focused elsewhere.

    I don't have an identical Saleae to measure with and while looking at the specs my initial takeaway is that it should be able to produce a proper clean signal, it isn't a fully calibrated oscilloscope.

    Would it be possible to repeat the measurement with the the MCAN0 signal that does not pass through the Mux? That would give us an equivalent baseline with the exact same probe of if there is a difference in signal quality when a CAN signal passes through the Mux or not.

    Best Regards,

    Ralph Jacobi

  • Ralph,

         I use two LP-AM263x with different scopes and get identical waveform.  

    MCAN0 can send correct signals, it doesn't have mux in between TX/RX signals and CAN transcier.

    Should you measure MCAN1_TX on the LP-AM263x first?

        

    Regards

    Andre

  • Hello Andre,

    I am aiming to make a series of measurements of the MCAN1 signals on the LP-AM263 LaunchPad while using the mux with the ESD diode in place on Monday and will report back my findings including if I was able to make any of the same observations you have posted here.

    After the measurements, I will also be testing communicating between LaunchPad's using CAN transceivers on a BoosterPack form factor which will minimize potential signal issues and leverage the 5V rail on the LaunchPad.

    Ahead of those tests, I reviewed the mux datasheet and it is designed to support DDR3 and LAN applications so CAN signaling should not be negatively impacted by the mux alone. If there is indeed an issue with the MCAN1 signal on the LP-AM263 it may be more complicated than just the introduction of the mux itself.

    Best Regards,

    Ralph Jacobi

  • Hello Andre,

    Short update - I was able to re-create your observations as well. The role the mux plays is unclear right now but after doing numerous measurements what I can say is that the signal quality does not notably get impacted after passing through the mux. Given the mux is rated for DDR and the signal is no better when measuring at R168 near the AM263, while I won't rule it the possibility it has no impact, the issue is not exclusively caused by the mux as the signal quality is already poor before entering it.

    Given what I've reproduced so far, I'm foregoing any tests with the BoosterPacks and will focus on investigating why the MCAN1 TX signal quality is poor throughout the LaunchPad.

    Best Regards,

    Ralph Jacobi

  • Hello Andre,

    Wanted to leave another reply to let you know this is still open on my end and I am hoping to have more to share early next week if all goes well.

    Best Regards,

    Ralph Jacobi

  • Hello Andre,

    To fully test the MCAN1 interface on the AM263 LP, I need to get it running through a CAN transceiver so it can translate the TX/RX signals into CAN_H/CAN_L signals. I was delayed initially to get the right hardware in hand to do this, and now I am working through getting that setup running as expected on known good paths between two EVMs. Once I have a working setup validated then I can get it running on the MCAN1 of the AM263 LP to see if the signal quality is what's expected when loopback mode is not used or if there is another hardware issue at hand.

    Best Regards,

    Ralph Jacobi

  • Hello Andre,

    Regarding the prior status update, I am going to switch from an internal dev board with a CAN transceiver on it to the same EVM used above. I will have that EVM in hand after the holiday and will provide an update on the test status after getting it setup.

    Best Regards,

    Ralph Jacobi

  • Hello Andre,

    Latest status update on my end is that with the new EVM I still was not able to get these boards talking together and believe the issue is currently more of a software issue than hardware issue as we have limited examples for board-to-board CAN communication. To that end, I have a pending request to our software team to provide a more robust board-to-board CAN example that has been fully tested for this use case.

    Best Regards,

    Ralph Jacobi

  • Ralph Jacobi,

        Disagree this conclusion. The CC-am263x has demo code for MCAN1. The differences between LP-AM263x are just the way to enable CAN transceiver and multiplexer setting to route signals out.   CC-AM263x MCAN1 work well using the almost identical demo codes.

    Anyway, need you help to investigate in this issue, One of our target customer still wait for our answer.

    Regards

    Andre  

  • Hi Andre,

    All the demo codes you've referenced are focused on loopback mode. Using an external CAN transceiver to talk with another board is a separate type of example. There were AM243x demos related to this which I attempted to use for AM263x and it works when I am talking with the CAN1 from AM263CC to CAN0 of AM263LP, but when I change the SysConfig to use MCAN1 on the AM263LP along with the Mux Select then the demo stops functioning. Furthermore when I tried to switch from MCAN1 to MCAN0 on the AM263CC which has no mux, I did not observe any CAN data being output.

    None of this is to say that I think this is purely a software issue, but simply that I cannot attempt to debug the hardware root cause further until the software piece is resolved so I can go from no CAN signals to CAN signals I can actually analyze on the AM263 LP MCAN1 bus.

    Best Regards,

    Ralph Jacobi

  • Ralpha,

        At the beginning, I got wrong waveform from external TCAN transceiver,  TX by MCAN1. The tests are done in normal TX mode (not loopback mode and send to external TX pin.)  Both CAN sniffer and RX boards(TDA4, AM24 or AM26) can not get correct packet. The waveform form CAN transceiver exactly represents signal from MCAN1_TX.    That's why I look into this issue and step by step narrow down to wrong signal from MCAN TX signals.  But anyway, please check SW team to provide code so you can double check what we found. 

    Regards

    Andre

  • Hello Andre,

    The tests are done in normal TX mode (not loopback mode and send to external TX pin.) 

    Can you share the code which is operating like this then?

    The code I received from you had loopback enabled:

        /* Configure MCAN module, Enable LoopBack Mode */
        App_mcanConfig(TRUE);

    Best Regards,

    Ralph Jacobi

  • Ralph 

     Check this one. I used TCAN1642 and connect transceiver enable pin to ground directly. 

     You can also reference the HW connection in my 1st report and the waveform capture.

    Ch1  MCA1_TX pin Ch2/ch3 CAN-H/CAN-L

    4478.mcan_tx_only_interrupt_am263x-lp_r5fss0-0_freertos_ti-arm-clang.zip

    Regards

    Andre

  • Hi Andre,

    Thanks, I've verified I can build that one properly and will use it to try and same tests on Monday. I have the same CAN transceiver EVM as well so I can mimic that portion of the setup as well. I will use a bench top power supply for the EVM if the LaunchPad power shows the same 'no signal' results with the on-board supplies.

    Best Regards,

    Ralph Jacobi

  • Hi Andre,

    What revision of the AM263 LaunchPad do you have?

    I tried using your exact project without any changes today and I was not observing any output on the TX pin even when using the AM263 isolated from anything else.

    Best Regards,

    Ralph Jacobi

  • Ralph,

       I'm using E2  version. 

    Please note this is TX only code. The other end of RX will be CAN Sniffer like PCAN or another EVM.

    Since wrong signal from MCAN1_TX pin, the signals translate by CAN transceiver will be wrong. RX will not recognize this package and won't send any response. So you can only see only one pulse from MCAN1_TX pin like picture below.

      

    That's why I use external lookback to observe signals from MCAN_TX1 in the later tests.

    To enable external loopback, just change in TX only mode. You still can see signal emit to CAN-H/CAN-L pin.

    /* Configure MCAN module, disable LoopBack Mode */
    App_mcanConfig(TRUE);

    if (TRUE == enableInternalLpbk)
    {
    MCAN_lpbkModeEnable(gMcanBaseAddr, MCAN_LPBK_MODE_EXTERNAL, TRUE);

    }

    Regards

    Andre

  • Hi Andre,

    I agree that only a limited pulse would be seen but I don't even get that much - the signal never changes at all for my case. I seem to have the E2 version as well which makes it all the more puzzling why I don't get even the pulse on my end with either a Saleae or a full on oscilloscope.

    Best Regards,

    Ralph Jacobi

  • Ralph,

        I use the same code test. The only different I can think is that, I already took out ESD protection on TX& RX path on my EVM during previous test. 

    Anyway, may be you can have SW AE to help to generate qualify code which can move from CC-am263x. It use MCAN1 already. The only thing it needs to do is setup mux.

    Regards

    Andre

  • Hello Andre,

    I reverted back to using my prior tested examples and was able to replicate your results again with them. After doing a lot more debugging on two boards and analyzing the CAN signals from multiple pathways, the current lean for myself and another expert on our team is there is some sort of issue with communicating with the TCAN1462 transceiver. I am going to see about getting a TCAN1044V EVM which is identical to what we use for the built in CAN on our EVMs on Monday to see if the LaunchPad MCAN1 interface works properly with that.

    The logic behind this is that we tested repeatedly that transmitting CAN through a TCAN1044V worked even without a receiver hooked up as the CAN bus just out the preample and first data without needing an acknowledgement back. However we are never seeing the same when using the TCAN1462. If we use a TCAN1044V and the same issue occurs then the only explanation would be a hardware issue with the AM263 LaunchPad. But if that transceiver works as expected, then the issue would be some sort of compatibility issue with the TCAN1462 at which point we'd need to consult with a CAN TRX expert to ascertain what could be the root cause.

    Best Regards,

    Ralph Jacobi

  • Hi Andre,

    Just a quick update that the CAN TRX expert was not available today, but should be meeting with them tomorrow to review what I mentioned previously.

    Best Regards,

    Ralph Jacobi

  • Hello Andre,

    I would be more happy to share I've managed to pin down the root cause if it didn't take painfully long to get to this point.

    Following my discussion with a CAN TRX expert and running further tests, I was able to isolate the issue in the signal chain on the AM263 LaunchPad. It was neither the Mux nor the ESD diode that was the guilty culprit, though the latter was very close to the smoking gun.

    Those two capacitors which are present for all ADC channels are the root cause. With those caps installed, high speed signals are getting influenced by an RC constant from the impendence of the traces of the PCB and possibly other components like the mux coupling with the cap. That signal distortion was enough to throw off the timing and prevent the CAN transceiver from being able to communicate properly.

    After removing both tests I was able to get the TCAN1462 EVM transmitting across boards. I was using a bench supply to do so, but based on the current draw I was seeing I doubt you'd have an issue with using the LaunchPad to power it as well.

    While the mux hardware played no influence, the usage of it in the system was a factor because it's only due to the ADC channel that was muxed with the MCAN signals that such a cap would be installed.

    These findings will be sent to the EVM owners so we can make adjustments to future revisions of the EVM.

    Best Regards,

    Ralph Jacobi

  • Ralph,

         Thanks for your update. This make sense.

    Regards

    Andre