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.

Can Baudrate configuration

Other Parts Discussed in Thread: HALCOGEN

Hello

I am trying to interface a sensor with my TMS57004 board. The sensor operates via CAN 2.0A or 2.0B at a baudrate of 1Mbps at an emission frequency of 100Hz. 

Can someone please tell me what my can settings like btrate, propogation delay etc be. 

Also the sensor sends two packets of data each 6 bytes in length.

Thanks

Saharsh Bansal

  • Hi Saharsh,

     Please use the HalCoGen to setup the CAN bit timing as shown.

  • Hello Charles

    This is the exact configuration for the CAN bus that i had set. However no data packet is being received by the board.
    The code is getting stuck at canIsRxMessageArrived().

    I have verified that is sensor is working properly.

    Thanks
    Saharsh
  • Hi Saharsh,
    I think you want to first check what ID are you expecting for the maibox you are receiving. Also check if you might have the acceptable mask somehow masking out the ID. Also do you see any flag set in the NWDAT12, NWDAT34, NWDAT56 and NWDAT78 registers starting at address offset 0x9C of the DCAN module you are using?
  • Hi Charles

    I have verified that the ID being received by the board is the same as that being transmitted by the sensor. Also i do not see any flags that are set in the specified registers.
  • Hi Saharsh,

      A couple of things to check:

      1. Is the Init bit in the DCAN CTL register is reset to 0 after you finish the DCAN initialization?

      2. check if canIsMessageBoxValid() is indicating the message object is valid.

      3. check the DCAN ES (Error and Status Register) and see if you are getting any error. Is the RxOK is set?

      4. Use scope to check the CANRX pin and see if there is any activities.

  • Hi Charles

    Sorry for the late reply.

    1. Yes the Init bit is resetting to zero

    2. The can message box is valid

    3. the ES register has a value of 7

    4. Yes there is a signal coming from the RX pin.

    It could be possible that the baudrate or other initial settings may not be correct, because we can see that even though the controller is receiving a signal it is unable to read it.

    Thanks

    Saharsh

  • How many nodes on the network? If you can limit the network to the transmitter and the TMS57004 board, then you should be able to see on an oscilloscope if the CAN message is being properly acknowledged by the 570. If it is, then the problem is not likely baud rate. Also make sure that the 570 is configured to use the same type of ID as the transmitter, extended or standard. If using extended ID, make sure you have the mask properly set, (I think HALCoGen defaults to an 11 bit mask even with extended IDs.)
  • Hi Bob

    There is only the one transmitter and my 570 board on the bus. The sensor is transmitting at CAN2.0A at an adress of 5FE and 5FF
    These are my HALCOGEN settings-

  • If the transmitter is transmitting ID's 0x5FE and 0x5FF, and you want to receive the data from the transmitter, then the ID for message 1 should be 0x5FE and the mask should be 0x7FF. Also, you should not have RTR checked. (Remote response is if you want to automatically respond to a remote request from the transmitter.) Same for message 2. The ID should be 0x5FF and the mask should be 0x7FF, RTR not checked.