cancel
Showing results for 
Search instead for 
Did you mean: 

I2C doesn't send data and...

rozehtiyan
Associate II
Posted on September 26, 2014 at 15:16

 

 

The original post was too long to process during our migration. Please click on the attachment to read the original post.
2 REPLIES 2
chen
Associate II
Posted on September 29, 2014 at 13:44

Hi

''I'm newbie to work with I2C. What's the problem? Why isn't there an acknowledge at the end of the address?'' ''

I2C_Send7bitAddress(I2C1, 0x12, I2C_Direction_Transmitter);

'' ''

I2C_InitStructure.I2C_OwnAddress1 = 0x08;

'' Assuming that you are using the same init code in the slave device as in the host. You have not understood the 7 bit addressing of I2C I think - with own address = 0x08 (on the slave) The host should be sending address 0x10 for the slave to respond.
rozehtiyan
Associate II
Posted on October 01, 2014 at 19:51

Hi

Thanks friend. I solved the problem and as you said the problem was addressing. also it doesn't work correctly still(but I have acknowledge now). If I would just connect the debugger to the slave board and start to working, it would work correctly but if the both board would be free(I mean without debugger), I have acknowledge but the master doesn't send the data(I mean

0xA1

). note that I have changed the both programs at the first post of the topic. it seems that it's halt again on this line in the master:

while
(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)){}