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.

CCS/TMS570LC4357: TMS570LC4357

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

hello

i've  been trying to send a can msg from canREG1 using halcogen & ccs. i included them in the ccs also . the main code in my ccs is given below :

#include "HL_sys_common.h"
#include "HL_can.h"
#include "HL_system.h"
#include "HL_sci.h"
#include "HL_esm.h"


#define CAN canREG1
#define D_COUNT 9

uint8_t tx_data1[D_COUNT] = {'h','e','l','l','o','o','o','o','\0'};
uint32_t checkPackets(uint8_t *src_packet,uint8_t *dst_packet,uint32_t psize);

void main(void)
{

canInit();

canTransmit(CAN, canMESSAGE_BOX1, tx_data1);


while(1)               /* continious display */
{
 canIoTxGetBit(CAN);
}


}

uint32_t checkPackets(uint8_t *src_packet,uint8_t *dst_packet,uint32_t psize)
{
uint32_t err=0;
uint32_t cnt=psize;

while(cnt--)
{
if((*src_packet++) != (*dst_packet++))
{
err++; /* data error */
}
}
return (err);
}
void canMessageNotification(canBASE_t *node, uint32_t messageBOX)
{
return;
}
void canErrorNotification(canBASE_t *node, uint32_t notification)
{
return;
}
void esmGroup1Notification(esmBASE_t *esm, uint32 channel)
{
return;
}
void esmGroup2Notification(esmBASE_t *esm, uint32 channel)
{
return;
}

but i still don't know why i'm not able to see the msg in the terminal which i'm sending from the canREG1  TX pin(i.e J10 - 45) using the  canIoTxGetBit(CAN) function .

Also i'm completely sure there is nothing wrong in my halcogen program.

plz help me where i am going wrong.

thank you ...

  • Hi Manidepp,

    You transmits message from CAN1 to the CAN bus, what is your another CAN node? Is it the CAN2 of this LC4357 or another device?

    What does canIoTxGetBit(CAN) do? I need to know the details regarding your CAN network setup.
  • Hi Manidepp,

    Have you solved the problem?
  • The other node is to the arduino uno using mcp2515 on the can bus. But i need to know why i can’t see the msg at the terminal which i’m transmitting using the canIoTxGetBit function generated by halcogen.
  • Hello Manideep,

    The CAN_RX pin of the DCAN module can be used as general-purpose IO pin. The register DCAN RIOC is used to enable or disable the DCAN functionality of RX pin. The register DCAN TIOC is used to enable or disable the DCAN functionality of TX pin.

    canIoTxGetBit() is to return the value of TX pin if t is in GIO mode.
  • hello Q J Wang,

    does that mean that i can't  use the canIoTxGetBit()  function when i'm using it as a dcan module and not as GPIO pin mode. if so , then how will i be able to see the output which i'm getting. also plz specify the function used to see the o/p in the CCS terminal.

  • Hi Manideep,

    No, this function is only used to return TX pin level when TX pin is in GIO mode. If you want to see the DCAN message, you can use another CAN node to receive the message, or you can use loopback mode. In loopback mode, the CAN Core uses internal feedback from Tx output to Rx input. Transmitted messages are treated as received messages, and can be stored into message objects if they pass acceptance filtering. The actual value of the CAN_RX input pin is disregarded by the CAN Core. Transmitted messages still can be monitored at the CAN_TX pin.
  • Hi Wang,

    So,is there any function which display the DCAN(not GPIO mode) message on the CCS terminal which i'm sending. And how will we know if the message is getting transmitted from the canTX & canRX of the  TMS570 to the ARDUINO bus which i wanna sent to. i wanna check everything on the CCS not on ARDUINO IDE.

  • Hi Manideep,

    The TxOK bit in ES register shows if the message has been transferred successfully. If you want to see the txed data, but you don't use test mode (loopback, etc), you have to probe the CAN bus or check another node to see.