Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Problem with interfacing pic18f4550 with i2c EEPROM (24AA1025)

Status
Not open for further replies.

Quds4us

New Member
Hi all, i am working on university project that include interfacing pic18f4550 with i2c EEPROM, I read many codes and saw many projects on this topic, after that write sample code from MPLAB C18 ( and i tried many codes also) but no one work with me i dont where is the problem, evrey thing is ok with my code and with my circuit, but the sck did not genrate clk for writing and nothing has been wriiten to eeprom. so if any one can help me plz :S:S
i will attach the code and the circuit schematic.
 

Attachments

  • PIC18F4550_EEPROM.PNG
    PIC18F4550_EEPROM.PNG
    41.5 KB · Views: 324
  • project.c
    738 bytes · Views: 184
You need to start() the I2C and write to it like the example I have attached.

(sorry i should have read the code first )

BTW keep the resistors on... It works better
 

Attachments

  • i2c_example.c
    3.2 KB · Views: 191
You did what? The code you posted will not work.

Been playing with your code.... The routines you are using.. are for byte size addresses.. you need to use int size addresses.

I have I2C routines for 16 bit chips... You need to set the pins for YOUR chip

I haven't included a sequential read BUT!! in my C tutorials I have... see my signature.
 

Attachments

  • Myi2c.c
    3.4 KB · Views: 152
  • MYi2c.h
    667 bytes · Views: 173
Last edited:
yaaa . i didnt notice that !!!!
i will try your code but if you can give me a small example for writing on any address and reading from this address !?!
 
If you look at the C code tutorial 6.. There is a function that could easily be used... The same function will read a byte or an array from a small or large eeprom.
Like said there is a link in my signature
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top