infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 3 of 3

Thread: XMC4700 Relax Kit CANbus Transmissions

  1. #1
    New Member New Member bsalmi is on a distinguished road
    Join Date
    Jan 2019
    Location
    Los Angeles, CA
    Posts
    3
    Points
    47.5

    XMC4700 Relax Kit CANbus Transmissions

    Hi all,

    I'm trying to use the XMC4700 Relax Kit to send transmissions onto the external CANbus via the X2 connector and can't figure out how to properly configure and send this data. The only non-loopback example I can find is in the XMCLibs examples for the XMC4500:

    Code:
    XMCLib\examples\XMC4500_series\CAN\CAN_TRANSMITTER
    I've tried modifying the example for the XMC4700 Relax Kit including:
    • Changing LED1 to P5_9
    • Changing TXD to P1_12
    • Changing RXD to P1_13
    • Using CAN_node1 (P1_12 and P1_13 are CAN_node1 pins ALT2)
    • Use XMC_CAN_CANCLKSRC_FOHP (also tried XMC_CAN_CANCLKSRC_FPERI) in XMC_CAN_Init due to Multican+ in XMC4700


    When compiled and loaded I see the LED blink as expected but I see no data on the Relax kit CANbus using an oscilloscope. I have several Relax Kits available to me and it does this on multiple boards so it doesn't appear to be an isolated hardware issue. Here's my latest code modified from the CAN_TRANSMITTER example.

    canbus.zip

    I haven't found a good example for DAVE applications using CANbus transmissions (non-loopback) either. Overall, anyone have any suggestions? Been really stumped and feel like I'm missing something obvious!

  2. #2

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    559
    Hi,

    Find attached the projects.

    Regards,
    Jesus
    ?????
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

  3. #3
    New Member New Member bsalmi is on a distinguished road
    Join Date
    Jan 2019
    Location
    Los Angeles, CA
    Posts
    3
    Points
    47.5
    @jferreira thanks for the response! Your example code above worked! Here are some of the larger items I realized were key to getting good code.

    CANbus frequency
    I originally used 120MHz, your code uses 144MHz. I presume this wasn't the main issue as it likely only affect bit timing. Any elaboration would be helpful.

    Arbitration Mode
    Your code uses "XMC_CAN_ARBITRATION_MODE_IDE_DIR_BASED_PRIO_2 " whereas the original example code in XMClib uses "XMC_CAN_ARBITRATION_MODE_IDE_DIR_BASED_PRIO_1 ", why is that?

    CAN Node Receive Bit Set
    Your XMC4700 code uses "CAN_NODE1_RXD_P1_13" whereas the XMClib example uses "XMC_CAN_NODE_RECEIVE_INPUT_RXDCA". Unlikely to be the cause of the no transmissions but I'd love to know what causes the difference.

    XMC GPIO Setmode
    Whoa! This is the most unexpected difference. The following line in your XMC4700 code caught me off-guard:

    XMC_GPIO_SetMode(CAN_TXD, XMC_GPIO_MODE_OUTPUT_PUSH_PULL | P1_12_AF_CAN_N1_TXD);

    I have NEVER seen an example OR "P1_12_AF_CAN_N1_TXD" with the push/pull setting. Where is this documented. I can't find it explained anywhere. I think this was likely what was causing my problem.

    Thanks again for the help and I'd love to have a little direction to help answer these questions. Obviously will share what I learn so it helps others.

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.