CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ds1307+external eeprom

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
misel0019



Joined: 04 Oct 2010
Posts: 53
Location: Dhaka

View user's profile Send private message Send e-mail

ds1307+external eeprom
PostPosted: Mon Oct 18, 2010 5:10 am     Reply with quote

hi,
I'm new in ccs. I wanna make a datalogger with pc interface.

Wanna use ds1307 and also external eeprom like 24LCXX though I'm new in the world of programming so need some help of yours .

Q1. it's possible to use ds1307+24LCXX in same SCL/SDA pin so what is your suggestion to do?

Thanking you all.
Misel
sturnfie



Joined: 26 Apr 2010
Posts: 17
Location: Palatine, IL

View user's profile Send private message Visit poster's website

Re: ds1307+external eeprom
PostPosted: Mon Oct 18, 2010 10:50 am     Reply with quote

misel0019 wrote:
hi,
I'm new in ccs. I wanna make a datalogger with pc interface.

Wanna use ds1307 and also external eeprom like 24LCXX though I'm new in the world of programming so need some help of yours .

Q1. it's possible to use ds1307+24LCXX in same SCL/SDA pin so what is your suggestion to do?

Thanking you all.
Misel


The trick is sending the correct slave address. The DS1307 datasheet tells me that its address is (1101000). The 24LCXX slave address is TTL configurable by setting the A0/A1/A2 input voltage levels (address of 1010 A2 A1 A0).

The datasheets will also provide information regarding the necessity of using pull-up resistors on SDA/SCL. Between the two device datasheets, I'd recommend reading the 24LCXX (looks a bit more comprehensive).
_________________
Lucas Sturnfield
Blog - http://www.sturntech.com/blog
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Oct 18, 2010 11:25 am     Reply with quote

You need driver files for each device. A driver is a program that talks
to the i2c chip (ds1307 or 24LC256) and provides an easy-to-use software
interface. In most cases, these driver files already exist and are in the
CCS directory or on the forum.

Use the forum's search page to find a driver. Search the Code Library
forum for ds1307. Example of result:
http://www.ccsinfo.com/forum/viewtopic.php?t=23255

Use a text search engine (or just open a window and look at it) on the CCS drivers directory. Example of result:
Quote:

c:\program files\picc\drivers\24256.c



If you have problems with any of this, you should first read all the posts
in the forum on the topic. For example, use the forum's search page:
http://www.ccsinfo.com/forum/search.php
Search for:
Quote:

ds1307

You will get at least 176 hits. Read all of these, if necessary. These posts
discuss all the problems that you will ever have with the ds1307. They
have the answers.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group