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.

SafeTI-HSK CAN communication problem [URGENT]

Other Parts Discussed in Thread: TMS570LS3137, SN65HVDA541-Q1

Hello,

I'm trying to establish a CAN-communication between my pc and SafeTI-HSK with TMS570LS3137. I am sending can messages from my safeti-HSK to my pc. As a receiver i am using a PCAN-usb adapter connected to my pc in combination with the PCAN-view. I am sending the messages through the DCAN2 module of the SafeTI-HSK with the canTransmit function:

To check if the message is transmitted, i check the returned value of this function. And it returns a 1, this means the function succesfully sends the messages.

This is the part of my main code where i call the canTransmit function, I just send 8 bytes. each byte is one char from the canSendValue struct.

When debugging this function, I can see that this function is working properly and writes the data in it's corresponding dataregisters.



How can I solve this..? is there any example code for implementing can communication in the safeTI-HSK kit?


Any solutions, examples, or information about implementing CAN communication in the SafeTI-HSK kit with TMS570LS3137 would be very helpful.

I think there's a problem with the can-driver, this is a SN65HVDA541-Q1. Is there somekind of an "enable" that I have to set to activate the can driver chip? because the the outputs of the can driver are always in the "recessive" state.

Regards,

Jonas

  • Hello:

    We have received your post and will get back to you soon.

    Regards.

  • Jonas,

    you probably misunderstand function "canTransmit". 

    If this function is called, it first checks, if there is still a pending message in that Mailbox. If yes, it returns "success = 0" and does not copy the new message in that Mailbox.

    If there is no (older) pending message in that mailbox, canTransmit copies the new data into the Mailbox and returns with "success = 1" and tries to start a transmission. However, this is no prove that the new message actually has been transmitted. Success = 1 just indicates that the new data are in the Mailbox. If CAN is busy or there is an electrical problem with your CAN, the message will not leave the Mailbox.

    To check if a message hasreally  been transmitted over CAN,  you can use (a) Function "canIsTxMessagePending" or (b) an Interrupt request from your tranmsmit mailbox.

    Regards

     

  • Hello:

    Can you make sure the STB pin in the transceiver is set to low?

    Regards.

  • Yes,

    at my boards pin STB of the SN65HVDA541 is pulled down to GND by a 10k Ohm resistor.

  • thanks already for the responses!

    I have now finally some action on the CAN_Tx output of my tms570. But the CAN transceiver is still doing nothing.
    The STB pin of the can tranceiver is the whole time at 3,3V. What means that the CAN tranceiver is not active.


    I am now also using the "canIsTxMessagePending", This function does not return a "0", but "0x00010000" (hex) when checking the messagebox used for transmitting messages.
    The function "canTransmit" only returns a 1 at the first message, after that it returns always a zero..
    this is because there is no response from the can transceiver when DCAN2 is sending the data frame on Tx i assume?

    The TPS is all the time in the safety state because I am not using the specific firmware delivered with the SafeTI-HSK. I don't use this firmware because it's OS is safeRTOS.

    And is it okay to remove R826 to force the level of the STB pin to low?
    Because i don't really have an idea how to get the TPS chip (safety companion) permanent out of his safe state when you are not using the specific firmware.

    Regards,
    JL

  • Jonas,

    I do not have the schematics of the hitex-board, so I cannot comment on that. Pin STB of the transceiver is an Input-pin. If the pin is low, the transceiver is in normal op-mode; 1 means standby mode.

    Regarding function canTransmit:  On the first call after reset, it will return a 1, because on entry there is no message in the Mailbox. On a 2nd call, if the first message is still inside the Mailbox (because it could not be transmitted), the function will return a 0.  In your case the nor working transceiver, will prevent that the ACK - bit can be read back correctly. Thus the CAN communication Controller will repeatedly try to send the same message again and again - without success.