Sep 11, 2017
04:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 11, 2017
04:52 AM
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).
The I2C App is configured as the following (I'm using DAVE 4):
The main code can be seen below:
Does anybody have idea of what's happening?
Thanks in advance,
Best regards.
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).
The I2C App is configured as the following (I'm using DAVE 4):
The main code can be seen below:
Does anybody have idea of what's happening?
Thanks in advance,
Best regards.
3 Replies
Attachments are accessible only for community members.
Sep 12, 2017
07:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 12, 2017
07:14 AM
Sep 13, 2017
12:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 13, 2017
12:56 AM
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.
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.
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.
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.
Sep 14, 2017
12:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 14, 2017
12:21 AM
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:
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.
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:
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.