- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
Am using CYBLE 012012-00
I have DS1307 Tiny RTC module which I2C based from which i want get data.
Below is code snippet of my code:-
while(I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterStatus())
{
I2CM_I2CMasterClearStatus();
}
while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendStart(0x68u, 0x00u));
CyDelay(10);
while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterWriteByte(0x00u));
CyDelay(10);
while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendRestart(0x68u, 0x1u));
CyDelay(10);
d1 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);
d2 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);
d3 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);
d4 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);
d5 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);
d6 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);
d7 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA);
d8 = I2CM_I2CMasterReadByte(I2CM_I2C_NAK_DATA);
I2CM_I2CMasterSendStop();
i am not able to go forward beyond below line:-
while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendStart(0x68u, 0x00u));
not sure what to do?
i am using PSOC 4 creator
I have connected pins as below:-
RTC---proc side
vcc--3.3v
gnd--gnd
scl-scl(P3[5])
sda-sda(P3[4])
have anyone configured this before please help me out
Thanks
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try with I2C address 0x34. The compponent adds the R/W bit itself.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
I tried all combinations like (0x68,0x68u,104,0x32,0x32u,52) as a slave address
and for write bit (I2CM_I2C_WRITE_XFER_MODE,0,0x0,0x0u)
but it wont go past
while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendStart(104, 0));
any idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
0x34 is not in your list. How many ohms are your pull-up resistors?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi bob
Actually its 0×34 by mistake i written 0×32 here in post.
Have used tiny rtc ds1307 module who's schematics shows 3.3k pull-up resistor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Last chance: Use a logic analyzer or a scope to check the signals. When the start command fails something with the signals is wrong.
Just came to my mind: could it be you forgot the I2C_Start() command?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I2C_start() function is already called.
Yes i have to probe the signals.
Thanks for the help.