RTC clock setting

Post Reply
WingNut
Posts: 51
http://meble-kuchenne.info.pl
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 1 time
Been thanked: 2 times

RTC clock setting

Post by WingNut »

Help!
I can't figure out why the clock won't set in the first file yet I can get it to set in the simpler second file. Its a very meesy file I know but I'm still a novice at flowcode. Also it is really slow to run. It reads bytes from a file CFG_DAT.DAT. The first bytes are basically a value to set a sample rate - works fine. I've it set to 1 second but it takes about 4 minutes to run through a 5 stage loop. My main concern is not being able to set the clock on the rtc module yet I can produce a basic clock with what I see as the same procedure

Probably dead obvious but I jst cant see what the problem is

N
Attachments
Flowcode1.fcfx
(36.39 KiB) Downloaded 31 times
LCD RTC Flowcode test.fcfx
(14.25 KiB) Downloaded 33 times

WingNut
Posts: 51
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 1 time
Been thanked: 2 times

Re: RTC clock setting

Post by WingNut »

Update. Not sure whats going on with the delay function this current file takes 20+ seconds instead of 3 to get beyond the decision :o


N
Attachments
LCD RTC Flowcode test.fcfx
(15.92 KiB) Downloaded 35 times

medelec35
Matrix Staff
Posts: 491
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 154 times
Been thanked: 184 times

Re: RTC clock setting

Post by medelec35 »

Can you try the one-second flasher test on your hardware to make sure the hardware is running at the correct speed?
I have just tried your flowchart and it is 3 seconds for me.
Martin

WingNut
Posts: 51
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 1 time
Been thanked: 2 times

Re: RTC clock setting

Post by WingNut »

Hi Medelec. Oddly when I tried later it was running at 3 secs and this morning

WingNut
Posts: 51
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 1 time
Been thanked: 2 times

Re: RTC clock setting

Post by WingNut »

The initial problem above i.e. clock setting appears to be related to variables. But I'm not sure how or why.

WingNut
Posts: 51
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 1 time
Been thanked: 2 times

Re: RTC clock setting

Post by WingNut »

For info.
So after a lot of adjusting, tweaking and twiddling i have it working of sorts. Since I originally used channel 1 for the sd card and changed by advice from stefan.erni, Ive managed to get the rtc clock to display data from the rtc and not some generic data the like of the simulation. Yes I know it wont simulate. However I chopped an changed and have settled on channel 1 for the i2c component of the rtc. What I did notice though is that chopping and changing to try to figure things out, I was caught out by flowcode always defaulting to a different pin configuration on the microcontroller. Its definitely something to watch out for as you cant remap pins unless you select software channel first - maybe its a bug but either way it kept me mind boggled for a week. I guess its due to the fact that I have 2 devices using either sdi or i2c.

Now just the time delay function to figure out before I can continue the deveolpment
Anyway onwards and upwards

Post Reply