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.

TMS570LC4357: DCAN1 through DCAN 4

Part Number: TMS570LC4357
Other Parts Discussed in Thread: TCAN330

ok....

this may seem like a dumb question....

We have Qty 2  TMS570LC4357 Launchpads with  DCAN1 through DCAN 4 wired up to TCAN330 xceivers. (one xceiver per DCAN channel)....(ie.. two identical setups..launchpad with the xceivers). 

The SILENT pin of the TCAN330 is pulled to ground, so we are in full xmit/receive mode

we have a typical 120ohm termination at each transciver..60ohm split with a 4700pF in the center to GND...with the ability to take the terminator in/out of buss.

the code we are running basically sends data on the bus , and the xceivers should send data back and forth.....

We hook up "SetupA", DCAN4 to SetupB DCAN4  (i.e. DCAN4 on one launchpad setup connected directly to the other launchpad set up DCAN4)

we run the code...evertyhing works

Same for DCAN3...DCAN3 to DCAN 3

Same for DCAN 2..DCAN2 to DCAN2

But

When we do this on DCAN1..(i.e.DCAN1 on one launchpad setup connected directly to the other launchpad set up DCAN1)

NOTHING.......see traffic on buss...but the setups never seem to acknowledge that there is a "receiver" on the buss.

THEN, if we attach a Kvaser Leaflite to the buss....it seems to WORK.....(dont have to do this for DCAN2-4)

What am I missing????

checked continuity through entire system, verified xceivers working, swapped launchpad cards,..

????

of note....we have been running all these tests at 500Kbps...up to 750Kbps.....we really want to run the buss (DCAN1 through DCAN4) at 1Mbps ..max speed

Any suggestions?...

would appreciate any insight...

As always...appreciate all your help!!!!

thank you

  • Nothing special to DCAN1. Are CAN1 TX and RX signals connected correctly?

    Your schematics don't have connection for DCAN1.

  • DCAN1 is connected correctly....that schemo  I posted is the "xceiver" board.  verified connectivity from the TCAN330  to the Launch at J10-44,45...

    TX at J10-45 is the data FROM hercules to the BUS (goes to the TCAN330 pin 1......RX  at J10-44 is the data TO hercules from the bus (goes to the TCAN330 pin4).....

    sorry...very very perplexed....

    Q: is there basic code that is available where I can just transmit/RX out of one launchpad DCAN1 (or what ever DCAN) and tx/RX out another....?  example code?...

    again...appreciate the masters response!

  • Hi John,

    I have tested DCAN1 and DCAN2 on TMS570LC43x HDK. The HDK has CAN transceivers for DCAN1 and DCAN2. But I have DCAN loopback project for launchpad. 

    This is the code used for DCAN1 and DCAN2 test on HDK:

    /** @file HL_sys_main.c 
    *   @brief Application main file
    *   @date 11-Dec-2018
    *   @version 04.07.01
    *
    *   This file contains an empty main function,
    *   which can be used for the application.
    */
    
    /* 
    * Copyright (C) 2009-2018 Texas Instruments Incorporated - www.ti.com  
    * 
    * 
    *  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.
    *
    */
    
    
    /* USER CODE BEGIN (0) */
    /* USER CODE END */
    
    /* Include Files */
    
    #include "HL_sys_common.h"
    
    /* USER CODE BEGIN (1) */
    #include "HL_esm.h"
    #include "HL_can.h"
    #include "HL_sys_core.h"
    
    
    #define D_COUNT  8
    
    uint32 cnt=0, error =0, tx_done =0;
    uint8 tx_data[D_COUNT][8] = {0};
    uint8 rx_data[D_COUNT][8] = {0};
    uint8 *tx_ptr = &tx_data[0][0];
    uint8 *rx_ptr = &rx_data[0][0];
    uint8 *dptr=0;
    
    void dumpSomeData();
    /* USER CODE END */
    
    /** @fn void main(void)
    *   @brief Application main function
    *   @note This function is empty by default.
    *
    *   This function is called after startup.
    *   The user can use this function to implement the application.
    */
    
    /* USER CODE BEGIN (2) */
    uint32_t numTXOK=0, numRXOK=0;
    
    
    /* USER CODE END */
    
    int main(void)
    {
    /* USER CODE BEGIN (3) */
        /* enable irq interrupt in Cortex R4 */
        _enable_interrupt_();
    
        /** - writing a random data in RAM - to transmit */
        dumpSomeData();
    
        /** - configuring CAN1 MB1,Msg ID-1 to transmit and CAN2 MB1 to receive */
        canInit();
    
        /** - enabling error interrupts */
        canEnableErrorNotification(canREG1);
        canEnableErrorNotification(canREG2);
        canEnableStatusChangeNotification(canREG1);
        canEnableStatusChangeNotification(canREG2);
    
        /* Enter Test Mode */
        //canREG1->CTL |= (uint32)((uint32)1U << 7U);
    
        /* Configure Silent Mode to confirm that their is no TX interrupt generted in Silend mode*/
        //canREG1->TEST |= 1<<3;
    
    
        /** - starting transmission */
        for(cnt=0;cnt<D_COUNT;cnt++)
        {
              canTransmit(canREG1, canMESSAGE_BOX1, tx_ptr);  /* transmitting 8 different chunks 1 by 1 */
              while(tx_done == 0){};                          /* ... wait until transmit request is through        */
              tx_done=0;
              tx_ptr +=8;    /* next chunk ...*/
        }
    
        /** - check the received data with the one that was transmitted */
        tx_ptr = &tx_data[0][0];
        rx_ptr = &rx_data[0][0];
    
        for(cnt=0;cnt<63;cnt++)
        {
           if(*tx_ptr++ != *rx_ptr++)
           {
               error++; /* data error */
           }
        }
    
        while(1){}; /* wait forever after tx-rx complete. */
    /* USER CODE END */
    
        return 0;
    }
    
    
    /* USER CODE BEGIN (4) */
    /* can interrupt notification */
    /* Note-You need to remove canMessageNotification from notification.c to avoid redefinition */
    void canMessageNotification(canBASE_t *node, uint32 messageBox)
    {
         /* node 1 - transfer request */
         if(node==canREG1)
         {
           tx_done=1; /* confirm transfer request */
         }
         /* node 2 - receive complete */
         if(node==canREG2)
         {
            while(!canIsRxMessageArrived(canREG2, canMESSAGE_BOX1));
            canGetData(canREG2, canMESSAGE_BOX1, rx_ptr); /* copy to RAM */
            rx_ptr +=8;
         }
    }
    
    
    void canStatusChangeNotification(canBASE_t *node, uint32 notification)
    {
        if(node==canREG1)
        {
           numTXOK++;
        }
        /* node 2 - receive complete */
        if(node==canREG2)
        {
           numRXOK++;
        }
    }
    
    /* writing some data to ram  */
    void dumpSomeData()
    {
         uint32 tmp = 0x11;
    
         cnt = (D_COUNT*8)-1;
         dptr = &tx_data[0][0];
         *dptr = tmp;
    
         while(cnt--)
         {
            tmp = *dptr++;
            *dptr = tmp + 0x11;
         }
    }
    
    
    /* USER CODE END */
    
    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/3554.TMS570LC43x_5F00_rtIBlinky.hcghttps://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/908/4442.TMS570LC43x_5F00_rtIBlinky.dil

  • You are the best!

    Thank you very very much!