Discussion in "Project Help" started by    CheV    Aug 1, 2007.
Wed Aug 01 2007, 07:28 AM
hello everyone, i'm having huge trouble with my project, i need to implement a ds"mf"1307, and it doesn't work as expected, i use proteus for simulation, i will attach the file i've worked, during debugging, the file doesn't read correct data from the "mf"1307. and i was wondering if anyone could help me with this. seriously all i need is a working example just to read data from the DS"mf"1307, i've seen several projects with this RTC but i get lost with all the non relevant code, really only read the ds1307, the rest leave it to me, i'm just having trouble with getting the data

[ Edited Tue Aug 07 2007, 03:51 PM ]
Wed Aug 01 2007, 08:41 AM
if you're using proteus... then try debugging your project using I2C debugger... see what you're getting on the I2C bus. i mean is your data coming the way you want.. check for any false triggering of the signals..
Wed Aug 01 2007, 09:29 AM

i'm using the I2C debugger, yet i'm not getting the data in the RTC, i'm getting junk data + all my mcu ram gets filled with junk.
Wed Aug 01 2007, 11:02 AM
are you getting something like this "ΓΏ" in your ram?
Wed Aug 01 2007, 04:28 PM
well no, it's filled up with random stuff, first time it's full with "2C", then it starts again filled up with "52", then another thing, it's puzzling. in my project there were many components, to each one i had the same approach, first i find simple code, start building up, except this DS1307, it's giving me huge trouble, all i need is a head start code, something that gets data from the RTC, then i'll be on my own.

Wed Aug 01 2007, 07:19 PM
I2C libraries to read from I2C bus is there.. if you want to have idea regarding I2C.
for reading.. there is something that you might need to know..
when you read from I2C device the order of reading must be this way.. First you send a dummy write byte to set the address from where you want to read. and then send a simple read cycle without stopping the previous comunication.
In coding you do like this..

[Start condition] [send write with address from where you want to read] [Start Condition] [send read with address] [stop condition]

i hope you are reading this way. Also.. please check you might overwriting some variable because.. you just need to read 7 bytes why you reading and how come filling up the whole ram.
If you ask me.. you are getting the data but something messed up in the code which is overwriting and filling up the whole ram. Maybe i am wrong but this happen sometimes... because you are using assembly..
Suggestion is.. change the stack pointer so u must have enough ram area for stack.
Wed Aug 01 2007, 07:38 PM
Hmmm look at the code of digital clock, there ds1307 is implemented succesfully. u will get it in rickeys world.
implementing I2C logic is difficult, first u have to go throught the details.........
Wed Aug 01 2007, 08:32 PM
i did work with I2C before, with eeprom, actually i used the same code that worked with the eeprom, with some changes, like the access code of the DS1307 instead of the 24LC265, which is in my code here:
i'll try changing the stack pointer, see what happens, but seriously, why isn't there any simple code to just retrieve data from the DS1307, i haven't seen any small sized project with decent descriptions that could guide me on this, i'm losing a lot of project hours rotating around the DS1307, i just want to rid of it and get going.
Wed Aug 01 2007, 09:36 PM
well if you do the things right way.. then code can be very small..
do this way.. download my I2C library and write a simple reading code. according to the steps i told in my previous post write the code. Please read only the data which is needed.. or if u want to read the whole ram, that won't take more than 40 bytes so be careful how and where you are storing the data. Because one wrong mistake does everything wrong.
Mon Aug 06 2007, 01:15 PM
it worked, it finally worked, i was able to get what i want from the DS1307 without the junk, i had to initiate the rtc, then to use the stop communication, now i'll try to write to the DS1307, i guess it won't be as hard, if you think it would help others, can you add this to the code area, if it's good enough?

[ Edited Mon Aug 06 2007, 01:19 PM ]

Get Social


Powered by e107 Forum System


Thu May 06 2021, 01:11 PM
Hello, constantly i used to check blog posts here in the early hours in the morning, since i like to find out more and more. Local Dating https://datingsitesww.com
Thu May 06 2021, 12:33 PM
It's an remarkable article in support of all the web people; they will get benefit from it I am sure. senior dating sites http://onlinedatingdd.com/
Thu May 06 2021, 10:24 AM
What's Taking place i am new to this, I stumbled upon this I have discovered It absolutely useful and it has aided me out loads. I hope to contribute & help other users like its helped me. Good job. match dating https://onlinedatingtind.com/
Tue May 04 2021, 08:34 PM
Hi there! I could have sworn I've been to this site before but after browsing through some of the post I realized it's new to me. Anyways, I'm definitely glad I found it and I'll be book-marking and checking back frequently! check my score https://creditscorecheckn.com
Tue May 04 2021, 06:39 PM
What's up everyone, it's my first go to see at this web page, and post is really fruitful in support of me, keep up posting these types of articles. Best Credit Score https://creditscoresids.com



Thu Jun 25 2020, 03:46 PM
Mon Jun 22 2020, 03:03 PM
Tue Jun 16 2020, 05:10 PM
Sat Jun 13 2020, 09:43 PM
Thu May 21 2020, 12:44 PM
Thu May 21 2020, 01:28 AM
Wed May 20 2020, 07:05 PM
Wed May 20 2020, 11:52 AM


Guests: 117, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123