i2c communication master and slave

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
        i received code from dtata sheet .to transmit data from master to slave and again receive data rom slave.   
but when i trans mit data to slave . slave receive data.   
but master have next instruction to check whether write is complete. there is while loop to check staus of write. and my master controller stuck in that loop.   
0 Likes
3 Replies
Anonymous
Not applicable
        There is a mistake in the I2CHW code, which misses a pair of parentheses. The code to check if the write is complete is:   
   
while(!(I2CHW_1_bReadI2CStatus() & I2CHW_WR_COMPLETE));   
   
Check with this modified code and see if it works.   
0 Likes
Anonymous
Not applicable

I am new user of PSOC 5,Trying example codes of Psoc creator.I am not getting O/P of EZI2C example.

   

I have just connected P0(1) to sw1 and P1(2) to sw2, according to instruction.(Refer EZi2c Design Example)

   

On LCD display the result shown as "sw1 to write","Sw2 to read",But if i press any switch its not reading or writing any data.

   

Do i need to make any more connections?any changes has to be made in code?

   

Thank you

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

It is always easier for us to check what you have done when you post your complete project here.

   

Do do so,

   

1st. Clean Project

   

2nd. Create minimal archive

   

3rd. Attach the archive to your post right here.

   

 

   

We'll have a look at it.

   

Bob

0 Likes