Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

communication between 16F877a and 24LC04B (external EEPROM) use i2c protocol??

Status
Not open for further replies.

slurp

Newbie level 6
Joined
Apr 19, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,491
Hello to all edaboard-ians,

Would like to ask some questions with regards to the above topic.
I am trying my hands on connecting and write/read between the PIC16F877a and the External EEPROM 24LC04B.

However, I DO NOT how to starts its I2C program/protocol.

Q1) To communicate between the PIC16F877a and the 24LC04B.
Is it necessary to have i2c protocol? [YES/NO]

Q2) I2C protocol refers to pulling HIGH/LOW the pins SDA and SCL? [YES/NO]

Q3) Is ti advisable to use Assembly Language (asm) or CCS (c-programming)?

Q4) any helpful sites?

I know, some may advise me to do more research and read-up. I did and still am doing then now...
I believe EDABOARD-ians would be another great source of information and help.

Thanking you in advance.

cheers,
slurp
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,149
Reputation
4,304
Reaction score
2,089
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
A1. For any external eeprom communication I2c is required unless it supports SPI or any other protocol.
A2. Its not only pulling of the lines but the protocol has to be understood properly.
A3. Better to write it in C as it can be easy for tracing and understanding.. but you can also do it in asm..

Tutorial 10 - EEPROM Demo

---------- Post added at 12:16 ---------- Previous post was at 12:16 ----------

Here are some inforation from Micochip website

http://ww1.microchip.com/downloads/e...tes/00976A.pdf

Here is the assembler code example

http://ww1.microchip.com/downloads/e...otes/AN976.zip

And here is more information from Microchip website about i2c

http://ww1.microchip.com/downloads/en/DeviceDoc/i2c.pdf
 

slurp

Newbie level 6
Joined
Apr 19, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,491
Good-day ckshivaram,
Thank you for the detailed answers.

However, I tried to open your shared Tutorial 10 file, but i could not using MPLAB IDE.
Should I instead open it with the CCS?

What would you suggest for me to verify/see the External EEPROM's memory? Else How am I able to know it is successfully written and read correctly?

cheers.
Slurp
 

kandhu26

Member level 5
Joined
Sep 7, 2009
Messages
93
Helped
13
Reputation
26
Reaction score
12
Trophy points
1,288
Location
chennai / bangalore
Activity points
1,856
This tutorial help you to understand I2C [Generic {Whatever the slave devices}] clearly...
 

Attachments


slurp

Newbie level 6
Joined
Apr 19, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,491
This tutorial help you to understand I2C [Generic {Whatever the slave devices}] clearly...

Hi kandhu... What tutorial are you referring to? the one shared by CK?


cheers,
slurp
 

kandhu26

Member level 5
Joined
Sep 7, 2009
Messages
93
Helped
13
Reputation
26
Reaction score
12
Trophy points
1,288
Location
chennai / bangalore
Activity points
1,856
That also useful... I am telling which is attached by me [I2C.pdf]... Both You can refer.... What i have attached is Generic I2C protocol..[Not specific to any particular slave devices..]
 

slurp

Newbie level 6
Joined
Apr 19, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,491
That also useful... I am telling which is attached by me [I2C.pdf]... Both You can refer.... What i have attached is Generic I2C protocol..[Not specific to any particular slave devices..]

I am sorry Kandhu,

But I do not see any attachments of yours.

Anyhow, I would like to ask.
What are the CONFIG for 16F877 and 16F877a?
I am sure they are different, but I do not seem to get it from the datasheet.

cheers,
slurp
 

slurp

Newbie level 6
Joined
Apr 19, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,491
http://ww1.microchip.com/downloads/e...tes/00976A.pdf

Here is the assembler code example

http://ww1.microchip.com/downloads/e...otes/AN976.zip

And here is more information from Microchip website about i2c

http://ww1.microchip.com/downloads/en/DeviceDoc/i2c.pdf[/QUOTE]

Hi,
I want to thank you for sharing with me the above links.

I read the presentation by Microchip on the EEPROM AND THE pic INTERLINKING. (I2C)

I noticed that they only provide an example that write and read a ADDRESS AND DATA/..

i AM TRYING OUT TO write and read SEVERAL DATAsss.....by editing from the example given by microchip and added into it some looping.

Could you be of great help and assitance pleasE?

thanking you in advance.

cheers,
Natasha
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,220
Helped
1,147
Reputation
2,313
Reaction score
1,123
Trophy points
1,403
Location
Brazil
Activity points
53,676
dear slurp


CCS have a lot of helpfull examples ready-to-use concerning I2C memories ( 24Cxx ) once you had installed it to your PC.
Make a search on Help and examples folder.

+++
 

dayanpad

Advanced Member level 4
Joined
Mar 23, 2009
Messages
114
Helped
17
Reputation
34
Reaction score
17
Trophy points
1,298
Location
Colombo
Activity points
1,921
you will be easy to do it while you are doing it, therefore please install mikroC PRO for PIC and then you can see library Manager
and click I2C you will see lot of easy guide with cct
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top