Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

[SOLVED] soft_I2c with DS1307,24c64 and 18f452

Status
Not open for further replies.

buddhikaneel

Member level 1
Joined
Jul 27, 2011
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,542
Hi my dear friends.
I want to attach ds1307 RTC ic and 24c64 eeprom with 18f452 MCU. i can already access DS1307 with 18f452. but i don't know how to use RTC and eeprom together. because both are use same SCL(RC3) and SDA(RC4). I used Mikroc Pro and Soft_I2c Library. I want to Store some data when i want to store in EEPRom. when i want to know time i want to access DS1307. this is my requirement. Please help me.

Thanks
 

Before you start sending/receiving data to/from them, you send their address byte (2 bytes for 24C64). This address is different for each of them, so the ACK will come from the peripheral which read its address.

Please see page 12 of the following datasheet:
**broken link removed**

and page 6 from this one:
http://ww1.microchip.com/downloads/en/DeviceDoc/21189f.pdf
 
thank you very much for reply. I'll try with it and tell you what will happened

---------- Post added at 16:44 ---------- Previous post was at 16:34 ----------

I Read what you suggest. Is that's mean there are different different Address for Different Device like RTC, Eprom... etc by those devices are manufacturing. and when we use sda,scl they fined Addresses connected to mcu what we given address and if there are several device found it will use acknowledge bit to select which device is what we called..? am i correct..?
 

Here is an example of access multiple I2C devices using MikroC:

Lab 14: Inter-Integrated Circuit (I2C) communication

The above tutorial/lab should get you started in the right direction.

BigDog

---------- Post added at 13:39 ---------- Previous post was at 13:31 ----------

Is that's mean there are different different Address for Different Device like RTC, Eprom... etc by those devices are manufacturing. and when we use sda,scl they fined Addresses connected to mcu what we given address and if there are several device found it will use acknowledge bit to select which device is what we called..? am i correct..?

Yes, you are correct. There are a few exceptions, for instance all DS1337 RTCs share a common fixed address of 1101000, therefore you can have only one DS1337 per I2C bus. Most RTCs share this limitation.

BigDog
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top