[SOLVED] I2C communication not able to recieve data .PIC 16f

Status
Not open for further replies.

deeplearns

Member level 4
Joined
May 19, 2011
Messages
75
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Visit site
Activity points
1,939
Hi I am trying to enable PIC communication for PIC16f886 .

I have simulated the code in proteus and im able to trasmit data to the eeprom .but not recieve it back .

Please help ,I dont want it to be done with the inbuilt libraries but with the control registers .
I have attached the complete project .

Thanks .
 

Attachments

  • I2C_PIC.rar
    68.3 KB · Views: 108

how are you saying that you have copied data to EEPROM ?

You looks quiet ok .
init_Master_write(0x00,0x55); instead try to write the address 0x0000 while sending the msb and lsb it might be causing problems
 

By adding restart after sending address or adding stop and then start before recieving data the code seems to work in Proteus , but when i implement it int h/w recieve does not work . ..
After eneabling recieve the SCL seems to stay low what should i be doing wrong :evil:.
 
Last edited:

check the address of the eeprom , had you given it correctly ?
what eeprom are you using ?
 

Hey I got it working , finally also I actually wanted to implement it with Ar102 touch controller even that works .
I got the problem I was restarting after writing the READ bit code and then recieving data .

It has to be

Send write ,Send dummy address , Restart or Stop and start and then send read code and then read data .

Thanks all
 

I2C communication not able to send and recieve data for PIC 18f4520 and 8051

I have simulated the code for i2c comm in proteus and microC. Im unable to send and receive data to the eeprom

Please help me.
I have written code like that

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
write_data()
{
Soft_I2c_Start();
Soft_I2c_write(0xA0);
Soft_I2c_write(0x00);
Soft_I2c_write(0x30);
Soft_I2c_stop();
write_temp=0x01;
}
read_data()
{
Soft_I2c_write(0xA0);
Soft_I2c_write(0x00);
Soft_I2c_write(0xA1);
take=Soft_I2c_read(0u);
lcd_display();
Soft_I2c_stop();
 }



plz plz help me
 
Last edited by a moderator:

check this file it might work for u .. u might have to play a bit the recieve ...
 

Attachments

  • New Folder.rar
    134.6 KB · Views: 102

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…