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.

DCAN transmit

Other Parts Discussed in Thread: TMS570LS3137

Hi all,

I'm using TMS570LS3137. I'm woking with DCAN with Automatic Retransmission mode disabled.

In TRM of DCAN section:

That described above, which register does it refer? In IFxCMD register (bit 18 TxRqst/NewDat) or in IFxMCTL register (bit 8 TxRqst and bit 15 NewDat)?

And how could my transmission function be?

uint32_t canTransmitAdvanced(canBASE_t *node, uint16_t messageBox, uint16_t messageId, const uint8_t *data)

{

uint32_t i;

uint32_t success = 0U;

uint32_t regIndex = (messageBox - 1U) >> 5U;

uint32_t bitIndex = 1U << ((messageBox - 1U) & 0x1FU);

if ( node->TXRQx[regIndex] & bitIndex )

{

success = 0U;

}

else

{

while (node->IF1STAT & 0x80);

for (i = 0U; i < 8U; i++)

{

#ifdef __little_endian__

node->IF1DATx[i] = *data++;

#else

node->IF1DATx[s_canByteOrder[i]] = *data++;

#endif

}

node->IF1ARB = ( ( ( ( uint32_t ) messageId << 18 ) & CAN_IFARB_11ID_M ) | ( CAN_IFARB_DIR | CAN_IFARB_MSGVAL ) );

node->IF1CMD = ( 0x87 | CAN_IFCMD_ARB );

node->IF1NO = (uint8) messageBox;

success = 1U;

}

return success;

}

Thanks