DS1307 RTC Problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
mervinm
Flowcode v5 User
Posts: 21
Joined: Thu Oct 30, 2008 4:01 pm
Been thanked: 3 times

DS1307 RTC Problem

Post by mervinm »

Hi,

I connected up a DS1307 RTC to a 16F8ffA as per the following discussion thread:
viewtopic.php?f=29&t=8607&p=46788&hilit=rtc#p46788

I am managing to download the code to the 16F887A and I get the LCD displaying "DS1307 programmed", but when I do a read to obtain the date, I just get zero's displayed for the date. I am not sure if the DS1307 is actually being programmed. How can test if the pic is actually communicating with the DS1307.
DS1307 is connected to PORTC, LCD to PORTB. I am running the DS1307 RTC Programmer code by John, and using his read routine to read from the DS1307. I am also running the Keypad version of the code by Enamul and getting the same result.

I am using the DT-26 oscillator. Is this the correct one for the RTC? Can somebody perhaps suggest the correct oscillator to use (part number).

Thanks.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: DS1307 RTC Problem

Post by dazz »

Hi
A quick way would be to connect an led to the sqw out pin on the 1307 and set it to work so you will see if its enabled, for the 1307 to keep time you need a back up battery as if theres not one there it will lose its settings, the crystal you have is fine

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

mervinm
Flowcode v5 User
Posts: 21
Joined: Thu Oct 30, 2008 4:01 pm
Been thanked: 3 times

Re: DS1307 RTC Problem

Post by mervinm »

Hi Dazz,

Thanks for the response. I figured out what the problem was; I was using the home edition of Flowcode 5, so when I compiled the code, FC5 did not generate the C code for the I2C component. Okay, I feel like an idiot, because I spent a few hours trying to find out what was causing the problem!! I bought the professional version and everything worked perfectly after I downloaded to the chip.

I have decided to use the DS1305 instead of the DS1307, because it has two programmable alarms. I have picked up a small problem using SPI, so I will post another call for help!

Thanks
Mervin

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: DS1307 RTC Problem

Post by dazz »

Hi mervin

We've all been caught out for days at one time or another, glad you sorted it

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

Post Reply