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.

External loopback in eCAN module of F28335

Other Parts Discussed in Thread: TMS320F28335, SN65HVD233, TMS320F2812, CONTROLSUITE

Hello to all,

I am working on the eCAN module of the TMS320F28335 microcontroller. It has an internal loopback option (self test mode) which works perfectly. But I would like to implement an external loopback using a CAN transceiver like SN65HVD233 that has a loopback option. The only thing that creates a doubt about this implementation is the following statement in the eCAN reference guide for 2833x:

"It is not possible to achieve a direct digital loopback externally by connecting the CANTX and CANRX pins

together (as is possible with SCI/SPI/McBSP modules). An internal loopback is possible in the self-test

mode (STM)."

While reading the datasheet of the CAN transceiver, I came across an implementation that uses the eCAN module of the TMS320F2812 microcontroller which means an external loopback should be possible for the F2812 eCAN module. But the eCAN reference guide for F2812 has the same statement as mentioned above.

Hence my doubt is whether I will be able to use the external loopback of the SN65HVD233 interfaced to the F28335 microcontroller.

If no, then how does it work with the F2812? Are the eCAN modules implemented differently in the F2812 and the F28335?

If yes, what settings would be required in the code? I think there is a sample code in CCS named ecan_back2back that uses the Self test mode(STM). Will it  work, if ,in this code, I disable the internal loopback (STM) and activate the LBK pin of the 65HVD233 transceiver?

Hoping a quick reply. Thanks in advance.

  • I don't think that the external loopback with the HVD233 will work on a single CAN communication controller (e.g. eCANA) of the 28335. What the HVD233 will do in loopback mode is to copy Tx to Rx and switch CAN_H and CAN_L to high impedance. A CAN controller (eCANA) will always monitor the correct state of a message, which is currently transmitted by this node. However, it will never receive its own message in another mailbox of the same CAN-controller. This is a basic CAN feature.

    What you can do is to use a 2nd HVD233 connected to eCANB and transmit from eCANA to eCANB. There is an example in ControlSuite ("ECANA_to_ECANB_XMIT) with a corresponding code sequence.    

  • Thanks for the reply, Frank.

    I had considered the loopback involving both the eCAN modules, but when I saw the implementation shown in the SN65HVD233 datasheet, I thought that I could try it out if it works. As per your view, a single CAN controller could never help in a loopback implementation. This raises the doubt: Why is the loopback option available on the transceiver chip? The datasheet also shows an implementation involving F2812 in which a GPIO pin has been mapped to the LBK pin of the CAN transceiver as if the F2812 can control the loopback option. I think there must be some way. Maybe TI could help.

  • Amit,

    the F2812 will readback the Tx information into the Rx line, if the transceiver is in loopback mode. This will lead to an 1:1 data stream from Tx to Rx until the data frame reaches the ACK field. What happens then? The transceiver, as a passive device, will not be able to generate the active ACK bit. In consequence, the CAN controller will transmit an ACK - Error with all its consequences of error frames etc.

    What you can do with the 2812 single CAN controller and what's maybe the idea behind the example in the transceiver data sheet, is to switch the CANRx pin into digital GPIO line mode. This way you can monitor the Rx line and compare the bit level against the TX line of the CAN controller as a maintenance routine without disturbing the rest of the bus.

    As mentioned before, forget to play with single CAN nodes, if your plan is to establish a working CAN - system. use at least 2 nodes. If you'd like to stay with a single controller, then the 28335 with its dual CAN system is an ideal toy.

    Regards

     

     

  • Frank,

    That explanation sounds very convincing. Maybe, only at the time of diagnostics, the CAN lines would be configured as GPIO and the link is checked with the loopback enabled in the transceiver. As you are saying, perhaps two nodes will help better in checking the loopback connectivity. Thanks. By the way, any suggestions for good CANbus analyser/tester modules? Also any good links where I could study more about the CAN bus?