View previous topic :: View next topic |
Author |
Message |
misel0019
Joined: 04 Oct 2010 Posts: 53 Location: Dhaka
|
ds1307+external eeprom |
Posted: Mon Oct 18, 2010 5:10 am |
|
|
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
|
Re: ds1307+external eeprom |
Posted: Mon Oct 18, 2010 10:50 am |
|
|
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
|
|
Posted: Mon Oct 18, 2010 11:25 am |
|
|
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:
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. |
|
|
|