TCAN1042DEVM: TMS320F28379D

Prodigy 105 points

Replies: 17

Views: 178

Part Number: TCAN1042DEVM

For running the  can_external_transmit on 28379d I am using two TCAN1042DEVM transceivers. The connections are as shown below:

I have configured the GPIOs properly but do not see any receive operation and the errorFlag gets set. What are the configurations that are needed on these TCAN1042DEVM  for this to work?

17 Replies

  • Hi Snambiar,

    Since this is the transceiver forum, I'll focus on supporting and debugging this with a focus on the TCAN1042 transceivers and EVMs. If you have a question regarding the microcontroller, please visit the appropriate forum for expert help.

    For TCAN1042 to interact with the CAN bus normally, it will have to be in normal mode. This is acheived by driving the STB (pin 8) low (this pin has an internal pull-up, so while floating the device is in standby mode). The TCAN1042 EVM has a MODE jumper which can be used to control the state of this pin. While in normal mode, the RXD pin will reflect the state of the CAN bus and CAN driver will drive the bus according to the state of the TXD pin. 
    To identify if the transceivers are working properly, you can use an oscilloscope to view the digital lines (TXD, RXD) and CAN bus (CANH, CANL). This will where the communication is failing if it originates from this part of the system. 

    If you are able to verify that the transceiver is working properly, I can try to recommend debug methods for TMS320F28379D if you share how the system is currently configured. However, my experience with this controller is limited so my advice would likely be general and high-level. 

    Regards,
    Eric Schott

  • In reply to Eric Schott1:

    I am using 2 TCAN1042DEVM for this setup. I needed help with the JMP configurations. The current for both connections are:

    JMP1: PD mode

    I have removed the connections for JMP4, JMP 5 and JMP6.  Will this be causing an issue with the termination?

  • In reply to Snambiar:

    Hi Snambiar,

    JMP4 and JMP5 are used to control the termination used by the board. If two boards are used with CAN lines connected, each board can have one of these termination resistors connected. This emulates a CAN network with 120-ohms of termination at each end. Having no termination on the network could indeed lead to communication issues as the dominant-to-recessive fall time can be quite long. 

    JMP6 controls the voltage at pin 5. In non-V versions of TCAN1042, this pin is a no connect (NC), so the state of this jumper has no effect on the device. For V versions, this pin is Vio and is required for proper operation. Since this device needs to interface with a 3.3V controller, I would recommend use of a V version of this device, supplying Vio with 3.3V Vio. This can be done on the EVM by supplying 'P5' on JMP2 with 3.3V and leaving JMP6 disconnected. 

    Let me know if this works and if you have any more questions.

    Regards,
    Eric Schott

  • In reply to Eric Schott1:

    Hi,

    I am running a standalone test by just transmitting  some bits from the controller to the TCAN1042DEVM. I could see the packets being sent from the controller using a scope but nothing on CANH or CANL.

    I am providing 5V at Vcc.

    JMP6 is disconnected and a 3.3 V is given to pin P5.

    JMP1 is connected to PD

    JMP5 is open

    JMP4 is connected

    Do these connections seem right?

  • In reply to Snambiar:

    Hi Snambiar,

    Yes, these connections are correct and should put the device in a mode that will drive the CAN bus according to the state of the TXD pin. 

    • Is it possible that the device has been damaged prior to these tests?
    • Please confirm that the pull-down used on pin 8 has the appropriate resistor populated (R2 is DNP by default).
    • Have any modifications been made to the EVMs? Or are they in their default configurations (apart from the jumpers).
    • Is it possible to share the scope shots of the TXD line and CAN bus? I would like to ensure that the input voltages and timings are expected and see any activity that may occur on the CAN bus. Please include the location where the probes are connected to the board(s). 

    Regards,
    Eric Schott

  • In reply to Eric Schott1:

    Hi,

    I will get the scope images to you soon. When connecting both the TCAN1042DEVMs will there be an issue if the JMP6 is left open and no 3.3V is provided at P5?

  • In reply to Snambiar:

    Hi,

    I think the issue is no completion of transmission. The code stops working at :

    //
    // Poll TxOk bit in CAN_ES register to check completion of transmission
    //
    while(((HWREGH(CANA_BASE + CAN_O_ES) & CAN_ES_TXOK)) != CAN_ES_TXOK)
    {
    asm(" ESTOP0");

    I put in a counter to check and it stops after the first Transmisson. My setup for the TCAN1042 is the same as I mentioned earlier. 

    COMPLETE CODE

    #include "driverlib.h"
    #include "device.h"

    //
    // Defines
    //
    #define TXCOUNT 10
    #define MSG_DATA_LENGTH 8
    #define TX_MSG_OBJ_ID 1

    //
    // Globals
    //
    volatile unsigned long i;
    volatile uint32_t txMsgCount = 0;
    uint16_t txMsgData[8];

    //
    // Main
    //
    void main(void)
    {
    //
    // Initialize device clock and peripherals
    //
    Device_init();

    //
    // Initialize GPIO and configure GPIO pins for CANTX/CANRX
    // on module A
    //
    Device_initGPIO();
    GPIO_setPinConfig(DEVICE_GPIO_CFG_CANRXA);
    GPIO_setPinConfig(DEVICE_GPIO_CFG_CANTXA);

    //
    // Initialize the CAN controllers
    //
    CAN_initModule(CANA_BASE);

    //
    // Set up the CAN bus bit rate to 500kHz for each module
    // Refer to the Driver Library User Guide for information on how to set
    // tighter timing control. Additionally, consult the device data sheet
    // for more information about the CAN module clocking.
    //
    CAN_setBitRate(CANA_BASE, DEVICE_SYSCLK_FREQ, 500000, 16);

    //
    // Initialize the transmit message object used for sending CAN messages.
    // Message Object Parameters:
    // CAN Module: A
    // Message Object ID Number: 1
    // Message Identifier: 0x95555555
    // Message Frame: Extended
    // Message Type: Transmit
    // Message ID Mask: 0x0
    // Message Object Flags: None
    // Message Data Length: 4 Bytes
    //
    CAN_setupMessageObject(CANA_BASE, TX_MSG_OBJ_ID, 0x95555555,
    CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_TX, 0,
    CAN_MSG_OBJ_NO_FLAGS, MSG_DATA_LENGTH);

    //
    // Initialize the transmit message object data buffer to be sent
    //

    txMsgData[0] = 0x01;

    txMsgData[1] = 0x23;

    txMsgData[2] = 0x45;

    txMsgData[3] = 0x67;

    txMsgData[4] = 0x89;

    txMsgData[5] = 0xAB;

    txMsgData[6] = 0xCD;

    txMsgData[7] = 0xEF;

    //
    // Start CAN module A operations
    //
    CAN_startModule(CANA_BASE);

    //
    //Transmit messages from CAN-A
    //
    // while(1)

    //

    // Comment for infinite transmissions
    //
    for(i = 0; i < TXCOUNT; i++)
    //
    {
    CAN_sendMessage(CANA_BASE, TX_MSG_OBJ_ID, MSG_DATA_LENGTH, txMsgData);
    // CAN_disableController(CANA_BASE);
    txMsgCount++;

    //
    // Poll TxOk bit in CAN_ES register to check completion of transmission
    //
    while(((HWREGH(CANA_BASE + CAN_O_ES) & CAN_ES_TXOK)) != CAN_ES_TXOK)
    {
    asm(" ESTOP0");
    }}


    //
    // Stop application
    //
    //asm(" ESTOP0");
    }

  • In reply to Snambiar:

    Hi Snambiar,

    Both transceivers will need to be supplied with 3.3V to operate properly. The Vio supply is used to drive the RXD pin and is used as reference for the TXD input. The receiving device will need to be fully operational in order to translate the message back to the controller and send the corresponding acknowledgement. 

    Based on the code, I agree that it seems the transmission is never completed. Reading the full status of the Error and Status register (CAN_ES), particularly the Last Error Code (LEC, bits 2-0) will let us know what errors the controller has identified, if any. Could you share what the state of this register is after the message is sent? Viewing the waveforms will also help identify if there are any irregularities on the analog level. 

    Regards,
    Eric Schott

  • In reply to Eric Schott1:

    Hi,

    For a simple test using the above code I am using 1 TCAN1042 with the following configurations:

    5V VCC

    JMP1: PD , JMP2: 3.3 V at P5, Tx connected to Rx of MCU, Rx connected to TX 

    JMP4 : Connected ,JMP5: Open ,JMP6: Open

    CAN_ES 0x000000E5 Error and Status Register [Memory Mapped]
    PDA 0 Power down mode acknowledge
    WakeUpPnd 0 Wake Up Pending
    PER 0 Parity Error Detected
    BOff 1 Bus-Off State
    EWarn 1 Warning State
    EPass 1 Error Passive State
    RxOk 0 Reception status
    TxOk 0 Transmission status
    LEC 101 Last Error Code

  • In reply to Snambiar:

    Hi Snambiar,

    Thanks for providing the error status register state and confirming the board configuration. 

    I believe the problem is the TX and RX connections with the MCU. The CANx RX pin (MCU input) should be connected with TCAN1042's RXD signal (pin 4 output). The CANx TX pin (MCU output) should be connected with TCAN1042's TXD signal (pin 1 input). 

    The Last Error Code 0x5 is consistent with an incorrect connection. This code indicates that the RX input did not register dominant (logic low) when the TX output was driven dominant. In a proper system, a driven dominant should always appear on the RX line (it is possible that a dominant also appears on RX when TX is not driven). 

    With only one transceiver connected, another error is likely to be reported because the signal will not receive an acknowledgement. For the setup you describe with the correct TX/RX connections, I would expect the Last Error Code to be 0x3, indicating an Ack Error. 

    Let me know if this resolves the issue. 

    Regards,
    Eric Schott