infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

Dave

+ Reply to Thread
Results 1 to 4 of 4

Thread: XMC 2Go

  1. #1
    Intermediate Intermediate persike is on a distinguished road
    Join Date
    Sep 2017
    Location
    Austria
    Posts
    27
    Points
    440

    XMC 2Go

    Hello,

    I've been trying to use an I2C sensor on XMC 2Go board but I'm having difficult to do it. It stucks on a while that means nothing happened (no end of transmission, receive, nack or some error).
    Click image for larger version

Name:	while.png
Views:	6
Size:	12.6 KB
ID:	3107

    The I2C App is configured as the following (I'm using DAVE 4):
    Click image for larger version

Name:	i2cpin.png
Views:	0
Size:	45.8 KB
ID:	3109
    Click image for larger version

Name:	interrupt.png
Views:	0
Size:	15.7 KB
ID:	3108

    The main code can be seen below:
    main.txt

    Does anybody have idea of what's happening?
    Thanks in advance,
    Best regards.

  2. #2
    Intermediate Intermediate persike is on a distinguished road
    Join Date
    Sep 2017
    Location
    Austria
    Posts
    27
    Points
    440
    Heres the full project that I've been developing and trying to run.
    The I2C pins doesn't even change the level. I had sucess coding it into DAVE 3, but I can't do it on DAVE 4.
    ?????

  3. #3
    Intermediate Intermediate persike is on a distinguished road
    Join Date
    Sep 2017
    Location
    Austria
    Posts
    27
    Points
    440
    I'm pretty sure that I have discovered the problem but I still don't know how to solve it.

    I was checking with an oscilloscope and noticed that the I2C stop working when it receives a Nack. The fact is when it receives a nack or some error it does nothing, but it should call the respective handler configured on the App.
    I also checked on debug and the I2C handlers were configured.

    Click image for larger version

Name:	handlers.png
Views:	2
Size:	34.5 KB
ID:	3112

    If i don't received a nack or some error the I2C works, at the moment it receives a nack or an error I2C get stucked in a infinite loop.

  4. #4
    Intermediate Intermediate persike is on a distinguished road
    Join Date
    Sep 2017
    Location
    Austria
    Posts
    27
    Points
    440
    Hello guys,

    I deleted the all project and created again and I2C now is kind of "working". I noticed a bug that it is necessary to force a re-initialization everytime that a communication is necessary as shown in the picture:

    Click image for larger version

Name:	bug.jpg
Views:	3
Size:	127.1 KB
ID:	3115

    That's bad because it tooks arround 9ms to init the peripheral, so it's a big waste of processing time. Since the code is to read a sensor periodically, it means that the uc loose 9ms everytime that it needs to read data, which means a maximum reading frequency of 110Hz (if it's only reading and don't doing anything else).

    I hope I can get some help from Infineon team because it seems to be a bug on DAvE 4 (since on DAvE 3 works well). I also read all the I2C documentation and examples and didn't find the answer of this problem.

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