- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I'm new on PSoC and I got a problem of communication between a light sensor TSL2561 and my PSoC 5
(here the doc of the sensor : https://cdn-shop.adafruit.com/datasheets/TSL25911_Datasheet_EN_v1.pdf )
I can see the buffer on the debug mode but theres are empty, and my sensor don't write his data inside. The datasheet of the sensor talk about perform a four-byte I2C read operation using the auto-increment in the page 17, but I don't understand what is this.
My code :
#include <project.h>
#define TSL_ADDR 0x29
int main()
{
CyGlobalIntEnable;
uint8 mwbuff1[7];
I2C_Start();
for(;;)
{
I2C_MasterReadBuf(TSL_ADDR,mwbuff1,7,I2C_MODE_COMPLETE_XFER);
CyDelay(500);
}
I2C_Stop();
}
So what I have to add in my code, for read the light sensor's data.
Thanks.
Jacque
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you add the Pull up resistors to your I2C lines. Please post your code so we can check it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look into datasheet how the scl pin should be configured: Open drain, drives low.
Keep in mind that the APIs return a status byte which, when non-zero indicate an error condition.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What version of Psoc Creator are you running? Please upgrade to 4.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Creator 4.1 ??? Where did you get it from? I am running on Creator 4.0 SP1
Bob