Page 3 of 6

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 17, 2013 7:51 pm
by Jordy101091
JonnyW wrote:Hi Jordy.

That error may be because the pins are not connected.

The properties behave like pre-processor when converted to C. This means if you have a property called 'connection' and it is assigned to pin A 5 then what Flowcode does is take the line:
connection = 1
And replace it with:
$PORTA.5 = 1

However, if the pin is not connected Flowcode can not replace it with anything meaningful, so it sticks a zero in there instead:
0 = 1
Which is a syntax error. This is fudged during simulation and calculation entry so you can enter calculations even with unconnected pins.

If all your pins are connected OK this should work OK. If not, Flowcode should throw a warning (which you can disable via an event in each component). If the pins are connected OK and Flowcode is still producing this error you may have to PM me the source (in confidence of course) and I can see if there is an obscure bug we have not seen yet.

Jonny
Hi jonny,

I have found the fault myself it was the following:

Image

I have checked the third check box with the pull-down arrow.
After I had unchecked this it compiled fine.

As for the outputs I disable the outputs of which the timers are not enabled. So this will hopefully remove the changes of wrong errors from Flowcode.
If not we need to figure out another solution.

Anyway thanks again for your quick reply.

Regards Jordy

Re: DS1307 - RTC Time Keeper

Posted: Thu Nov 21, 2013 9:15 pm
by Jordy101091
DS1307 Component has been updated to version V1.5

In this version the Auto Day Of week calculation has been removed because this the algorithm used was to complex and eats up allot of program memory.
especially for small uC this is a huge disadvantage.

I have added the ability to read time in 12Hr and 24Hr format and also configure the timers in 12Hr and 24Hr mode.

Hope you enjoy this component.

Regards Jordy

PS. the help file will be updated as soon as possible (ASAP)

Re: DS1307 - RTC Time Keeper

Posted: Sat Nov 23, 2013 8:45 pm
by acestu
Hi,

If anyone has used Jordys DS1307 component in a project could you write a post and tell us how you got on with it please, the information would be useful to others.

Thanks In Advance
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Sat Nov 23, 2013 11:32 pm
by JonnyW
Hi Jordy.
In this version the Auto Day Of week calculation has been removed because this the algorithm used was to complex and eats up allot of program memory.
especially for small uC this is a huge disadvantage.
I don't know the details of your component, but if you create a property when it is downloaded to chip it becomes a constant.

This means that if you have a property called, say, 'complex_enable' and set it as a true/false property then you can do (in a flowchart):

Code: Select all

If (complex_enable) then
  ... complicated code ...
endif
And Flowcode will convert this to a #if:

Code: Select all

#if 0 // (complex_enable) then
  ... complicated code ...
endif
Meaning the user can turn off any memory- or uC-hungry code if it is not vital.

Jonny

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 12:22 am
by Jordy101091
Ok thanks Johnny I will look in to this.

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 12:29 pm
by JohnCrow
Hi
I've tested Jordy's DS1307 component on PIC, AVR and dsPIC

Works fine on all platforms (Will try on Arduino and ARM later) but I expect the rest will work the same.

Timer 1 switches on/off as expected.
Would it be possible, instead of entering the on / off times in the flowchart to use a variable, that would make it much more flexible.
DS1307-TimeSwitch.zip
(7.74 KiB) Downloaded 3133 times

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 1:08 pm
by Jordy101091
Hi John,

This can be made, the only problem is that you're going to get 10 extra macro for every timer that you want to use.
I don't now if that is such a good Idea, Maybe if more people think that your suggestion should be implemented I will do so, but for now I don't think, for the component that I would be easer to use.

Instead of 8 component macros you would have 18 macros and that's a lot.
But your suggestion is noted, And I'm thanking you for this.

Regards Jordy

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 2:43 pm
by JohnCrow
Hi Jordy

Just a thought, but that's a lot of macros.
If someone needs to build a circuit using the timers they can always have add an ICP port and reprogram using a pickit or something.

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 3:02 pm
by acestu
Hi John,

Thanks for your input, can you elaborate on "ICP Port" a bit , been a newbie I,m not sure what you mean.... :oops:

cheers
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 3:14 pm
by acestu
Hi John,

Just a quick question, I have downloaded your files but when I open the pic version, nothing is select-able in the system panel is it locked or something ?

cheers
Acestu

EDIT: Which version of the component are you using ?

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 3:25 pm
by JohnCrow
Hi Stu

That's strange, just tried it here and its all ok.
I'm using V1.5
I've uploaded the PIC file again
DS1307-TimeSwitch-PIC.fcfx
(12.65 KiB) Downloaded 3087 times

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 3:36 pm
by acestu
Hi John,

I have just tried the newly uploaded file and it is exactly the same, every time I try and click on anything in the system panel it makes the horrible microsoft Ding noise, I think this could be 1 for Jonny.....?

cheers
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 4:52 pm
by acestu
Hi,

I have just been doing a little experimenting, and if I open any of the charts that I was working on with previous versions of the component, the same thing happens ie. I cannot access anything in the system panel, this is since I updated the component to the latest version, I will load the old version back and see what happens.......


cheers
Acestu

EDIT:

When I tried to close Flowcode after trying the chart I got this error:
1307_Error.png
(10.59 KiB) Downloaded 9609 times

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 6:55 pm
by acestu
Hi,

Well that was weird, I tried opening a chart not using the component and it behaved in the same way, I then removed the component and all charts worked fine again so I put the component back in, and still ok, I will just have to see how I go on, and see if Jonny has any idea what the error code means...

cheers
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Sun Nov 24, 2013 9:46 pm
by acestu
Hi,

I seem to of cured flowcode, so I have programmed the chip with version 1.5 and the timer now works, however RTC still not working so I have ordered some more and they should be here in a couple of days........

thanks
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Mon Nov 25, 2013 10:09 pm
by acestu
Hi Jordy,

I was just wondering if you could tell me what the day of week macro is for, it is not for setting the day as that is in the set date macro, my thoughts were that it returned the day of week number so that you can use it for displaying the day, I have tried putting the return value into a variable but it does not return anything....

Or is this the part that you say has been disabled ?

thanks
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Mon Nov 25, 2013 10:15 pm
by Jordy101091
acestu wrote:Hi Jordy,

I was just wondering if you could tell me what the day of week macro is for, it is not for setting the day as that is in the set date macro, my thoughts were that it returned the day of week number so that you can use it for displaying the day, I have tried putting the return value into a variable but it does not return anything....

thanks
Acestu

Hi acestu,

The day of week macro returns the day of the week value, this is not a number from 1-7, however this value is an ASCII value.
To use this function you must display this on you LCD by using the print ASCII function.

To set the day of week you need to use writeDate macro.

I hope I have informed you enough.

Regards Jordy

Re: DS1307 - RTC Time Keeper

Posted: Mon Nov 25, 2013 10:48 pm
by JohnCrow
Hi Stuart
Thanks for your input, can you elaborate on "ICP Port" a bit , been a newbie I,m not sure what you mean....
Sorry missed your post yesterday

ICP = In Circuit Programming, so you can connect a PICkit or similar to your project and re-program it without having to remove the device.

Re: DS1307 - RTC Time Keeper

Posted: Mon Nov 25, 2013 11:07 pm
by acestu
Hi John,

Oh right, I see what you mean now thanks......

cheers
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Mon Nov 25, 2013 11:12 pm
by acestu
Hi Jordy,

So if you use the Day of week macro, what type of variable would you use for the return value so that you could add it to your LCD ?

cheers
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Tue Nov 26, 2013 1:12 am
by acestu
Hi,

I think I have sussed it, I can get it to return a letter, presumably this stands for the day of the week, if this is right though , T at the moment is for Tuesday, what will Thursday be ?

cheers
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Tue Nov 26, 2013 10:19 pm
by JohnCrow
Also its a single S for Sat and Sun too
I generally know what day of the week it is (unless I've had a few too many beers :lol: )

Id spent quite a while working out how to drive the 1307 chip and I2C in FC5, this component makes it a whole lot easier.

Re: DS1307 - RTC Time Keeper

Posted: Tue Nov 26, 2013 10:31 pm
by acestu
Hi John,

I think if we could have the first 3 letters that would suffice, would that be possible Jordy ?

cheers
Acestu

Re: DS1307 - RTC Time Keeper

Posted: Tue Nov 26, 2013 10:52 pm
by Jordy101091
Yes this would be possible,

At this moment Im busy with a T6963C display component, this is new for me but with the help of Jonny It will be doable.
as for the return value, I can make a new property in the component panel where you can select the fallowing:

- Number
- First Three Chars
- Whole Word

So for each of the options that would be:

- Number = 1, Sunday 2,Monday ... Ect
- First Three Chars = Sun, Mon, Tue ... Ect
- Whole Word = Sunday, Monday Tuesday... Ect

The return value will be a string type, so for you to use the number you first need to convert this string type to a inerter. But I don't think that would be hard to do.

If it all sound OK, then I can probably update the component tomorrow in the evening.

Regards Jordy

Re: DS1307 - RTC Time Keeper

Posted: Tue Nov 26, 2013 11:29 pm
by acestu
Hi Jordy,

That sounds great look forward to it...

cheers
Acestu