infineon4engi@twitter infineon4engineers infineon@linkedin infineon@youtube
twitter Facebook Linkedin Youtube

+ Reply to Thread
Page 6 of 6 FirstFirst ... 2 3 4 5 6
Results 51 to 52 of 52

Thread: FAQ for XMC4800 EtherCAT

  1. #51
    Beginner Beginner omeo is on a distinguished road
    Join Date
    Jul 2020
    Posts
    4
    Points
    75
    Hi
    I have post a new thread but cannot see it. I guess i can post the question at here?

    I want to know how to make a non-blocking I2C communication. I have make some code to fix WHILE Loop problem, But I think thats not good.

    The following is my original post:


    Hi
    I have try to use XMC4300 work with PCF8574T, Use EtherCAT and I2C communication.
    In my project, I have created EtherCAT And I2C App Instance. And use this code to update I/O state:
    Code:
    I2C_MASTER_Receive(&I2C_MASTER_0,true,0x41,&input_1,2,true,true);
    i2c_wait();
    But the red error led on the circuit board is often lit.After checking the code, I found that xmc4300 fall into an infinite loop at the following locations: (Dave\Generated\I2C_MASTER\I2C_Master.C)
    Code:
    Line 323:    while (!XMC_USIC_CH_TXFIFO_IsEmpty(handle->channel)){}
    Line 445:    while (XMC_USIC_CH_GetTransmitBufferStatus(handle->channel) == XMC_USIC_CH_TBUF_STATUS_BUSY){}
    Line 1052:    while (XMC_USIC_CH_GetTransmitBufferStatus(handle->channel) == XMC_USIC_CH_TBUF_STATUS_BUSY){}
    I made a patch at these three loop points, the patch content is as follows:
    Code:
          uint32_t count = 0;
            while (!XMC_USIC_CH_TXFIFO_IsEmpty(handle->channel)){
            	count++;
            	if (count > 1000){
            		return;
            	}
            }
    Currently, it is working normally, but occasionally I2C read data incorrect at emc test.
    I am wondering if there is a better way to solve this problem?

    Thanks.

  2. #52
    It enables the most compact designs, eliminating the need for a dedicated EtherCAT ASIC, external memory and crystal. Designers benefit from BOM cost and PCB space savings. 40 yard dumpster rental

+ Reply to 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.