DS1307 - RTC Time Keeper

A forum where Flowcode v6 user created components can be shared, discussed and reviewed.

Moderator: Benj

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by acestu »

Hi Jordy,

You say that the "check timer bit" tells you if the particular timer is Enabled, but the macro that was needed was one to tell you if a particular timer was not just Enabled but it was actually ON, this would allow me to create a BOOST button, would this be possible at all ?

Sorry for being a pain Jordy :oops:

cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Jordy101091 »

In need to dissapoint you om that.
There is no feedback from the output pin to any kind of input that I can use in flowcode.
Really crude to say but you just need to hope your output is high or low.

There no other way, without feedback I cannot realise what you are after.

With that of the table, for you application is absolutely critical that you need to know if the actual output is high or not.
If so you could you (simple words) just connect the output to a input so if you want to know the output is high then the input must also be high.

Ore sounds this to simple :)

Regards Jordy
the will to learn, should not be stopped by any price

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Jordy101091 »

I have updated the component to version 1.64

in this version the communication pins SDA / SCL are stored and do not default back when re-opening you code.
Also I have added a new variable to each timer "Output Enable" with this variable you can choose if you want to use the timer output ore not.
This lets you compile you program with all timers enabled but not outputs used.

I hope you like these changes.

Regards Jordy

You can download the program here: http://www.matrixmultimedia.com/mmforum ... 58&t=12882
the will to learn, should not be stopped by any price

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Jordy101091 »

Hi Everybody,

In the past I have decided to leave out the automatic calculation of the day of week.
Today I spend a little bit of time at another project, and discovered that the automatic calculation of the day of the week would be really handy.

So I went back to my previous version of the DS1307 component (V1.4) and looked at the formula and how to simplify it so it would actually fit inside a PIC16F877A with some other code as well. The first formula that I created in Flowcode uses different array to hold data for the month and stuff, I figured well If im going to work again on this formula, I might as well do it wright the "second time".

So I started from scratch, and reinvented the Gregorian Formula.
After 2 Hours of flowcoding I finally had it all working and it uses hardly any extra space on the target device.

So my question to all the DS1307 Component users is: Do you want a new update of the component with a automatic Day Of Week solution.

Regards Jordy
the will to learn, should not be stopped by any price

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Crenwick »

Hi Jordy,

Should be really nice :wink:

Wich algorithm are you using ?

Regards,

Bernard
Bernard

Flowcode 6 / EB006-V9

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Jordy101091 »

Hi

Im using a gregorian formula to calculate the day of week.
I have used this website to get me going: http://www.millersville.edu/~bikenaga/n ... endar.html

I will add this option as soon as I get time for it.

Regards Jordy
the will to learn, should not be stopped by any price

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Jordy101091 »

Crenwick wrote:Hi Jordy,

Should be really nice :wink:

Wich algorithm are you using ?

Regards,

Bernard
I have updated the component to version 1.65 which includes the Day of week calculation.
From now on you don't have to enter this value.
If you used version 1.64 and lower then you need to re-enter the macro WriteDate. Because when you compile you program with the new version 1.65,
you will get a error message from the compiler saying "To many Arguments" you will have to adjust this by re-entering the WriteDate Macro.

Regards Jordy
the will to learn, should not be stopped by any price

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Crenwick »

Hi,

Thanks Jordy !
Bernard

Flowcode 6 / EB006-V9

teemadej
Posts: 2
Joined: Tue Apr 01, 2014 9:38 am
Contact:

Re: DS1307 - RTC Time Keeper

Post by teemadej »

I have problem with this, i have latest version of Flowcode V6 and have tried 1.6.5 and 1.6.4 versions of this component, and i get this when adding it to project: Failed to add the component: DS1307 RTC

Hope someone answers and helps me !

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Jordy101091 »

If you can share your flowcode program, trough a sharing site I can have a look for you.
Also and don't quote me on this, but if you have a trail version of flowcode it won't let you use the I2C component
I think. I could be wrong, if so please correct me.

Regards jordy
the will to learn, should not be stopped by any price

teemadej
Posts: 2
Joined: Tue Apr 01, 2014 9:38 am
Contact:

Re: DS1307 - RTC Time Keeper

Post by teemadej »

Actually i have trial version, downloaded V6 just for testing this! Thank you for information.

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Emanuel Lourenco »

Good afternoon,

I wonder if with this component can use a DS1338.

I leave the link

http://www.ebay.co.uk/itm/3-3V-5V-I2C-R ... 4179022677

Thank you

User avatar
Crenwick
Posts: 127
Joined: Sun Aug 07, 2011 1:40 pm
Location: Belgium
Has thanked: 7 times
Been thanked: 21 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Crenwick »

Hi,

Yes, it's pin/register compatible and works also on 3v3.

Regards,
Bernard

Flowcode 6 / EB006-V9

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Emanuel Lourenco »

Hi

I have a problem.
In simulation of this component is ok.
When I move the program to the chip it shows me
00:00:00
00/00/00

Have tried for a pull-up resistance on SDA and SCL pins in but gave the same thing.

Does the chip configuration? If you can confirm that the error is not setting thanked
Attachments
RTD_DataLogger_Experiencia.fcfx
(11.58 KiB) Downloaded 863 times

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by hyperion007 »

Have you programmed the chip with a time and date?

Do you have a battery backup for the chip? Otherwise you would need to program the time and date every time you power up the system.

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Emanuel Lourenco »

Hi

Who can tell me how to shoot the variable minutes and seconds to use for another purpose?

I want 30 seconds in 30 seconds do a particular function, but do not know how to do this without a variable seconds.

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Emanuel Lourenco »

Emanuel Lourenco wrote:Hi

Who can tell me how to shoot the variable minutes and seconds to use for another purpose?

I want 30 seconds in 30 seconds do a particular function, but do not know how to do this without a variable seconds.
Hi
Anyone know how I can do this?

greetings

siwo278
Posts: 39
Joined: Tue Feb 12, 2013 9:07 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by siwo278 »

Hello

I'm working on a similar clock, with the possibility of downloading time with DCF77. Decoding the information I have more or less an refined. I only have a problem communicating with RTC DS1307, which in your project is used. My processor is a PIC16F876A clocked at 19.66 MHz, RTC1307 hooked into RC4 SDA and SCL RC3 (of course podciądnięte at 5V using resistors 3300 ohm). In my system it looks so bad that the processor reads data from the RTC by writing such information 45:85:85 45/25/165. Can I ask for help?
Attachments
rtctest.fcf
(86.21 KiB) Downloaded 918 times

siwo278
Posts: 39
Joined: Tue Feb 12, 2013 9:07 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by siwo278 »

siwo278 wrote:Hello

I'm working on a similar clock, with the possibility of downloading time with DCF77. Decoding the information I have more or less an refined. I only have a problem communicating with RTC DS1307, which in your project is used. My processor is a PIC16F876A clocked at 19.66 MHz, RTC1307 hooked into RC4 SDA and SCL RC3 (of course podciądnięte at 5V using resistors 3300 ohm). In my system it looks so bad that the processor reads data from the RTC by writing such information 45:85:85 45/25/165. Can I ask for help?
I'm sorry I was wrong threads.

maharadga
Posts: 71
Joined: Mon Dec 01, 2014 1:38 pm
Location: Bulgaria
Has thanked: 17 times
Been thanked: 12 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by maharadga »

Hi all. Maybe I found bug in DS1307 component /or not/. When I choose day of week to be displaying as number, for example 5 /Friday/, the day is true. When I choose day to be displaying as word /first 3 or all/, it's false- displaying "Thursday".
Also I try example with PIC16F876A and found that if I connect DS1307 to RC3 and RC4 /it's default/ circuit not work.
The time says 45:85 and the date is 45/25/165, the day is 255. When I change pins, as an example RC2 and RC5 - it work correct.
I try with simple timer but it's not work. Maybe I didn't do something right?
I have question: can I adjust the timers from software and if I can, how make it?
I upload my example and be happy if somebody explain where's my mistakes.
Attachments
DS1307.rar
(24.59 KiB) Downloaded 943 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by medelec35 »

Hi Jordy,
We all appreciate you sharing the user component you developed, so thank you. :)
If you are interested, I have created a fairly simple way to calculate the dates (from years 2000 - 2099) that BST and GMT come into force.
Then these dates are used to adjust BST and GMT times, so hours are automatically adjusted +1 or -1 at the correct times.
Tried on hardware and is fully working.
If you wish to implement it within your DS1307 component then I can help you with the two basic formula's (unless you already know/or implemented already).
I could also post the formula's on this thread if its of some interest.
Martin

Pactor
Posts: 61
Joined: Sat Apr 11, 2015 12:07 pm
Has thanked: 20 times
Been thanked: 14 times
Contact:

Re: DS1307 - RTC Time Keeper

Post by Pactor »

What a great piece of work, its working great so far on the Arduino UNO, the only strange thing is the date is coming back as a day behind, I expect I'm doing something wrong somewhere.

Thanks very much for your work

Post Reply