Page 1 of 1
RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Mon Apr 06, 2020 4:42 pm
by billduck
Where can I find a description of the component macro, and examples?
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Mon Apr 06, 2020 5:01 pm
by medelec35
After adding component to 2D or 3D panel.
Right click on the panel component, then select Help.
If there are any examples you will see them on the page that will be displayed.
Did you have a particular component in mind?
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Mon Apr 06, 2020 5:21 pm
by billduck
Thanks. I am so glad to get this component macro. Am testing it now.
Going to use it on a 2 axis solar tracker, for which I need a few time variables.
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Mon Apr 06, 2020 5:52 pm
by billduck
It worked. Kudos to the developers. Beats writing code that the macro does.
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Tue Apr 07, 2020 6:08 pm
by billduck
Another question.
I have been using this RTC (DS-3231) on an application - a solar single axis tracker. Sww watt-tracker.com.
As usual, I forgot to document some code segments. The code below code was before the RTC midule was availible.
To Wit:
One subroutine I call PowerFromBattery
It goes like this:
I2C transmit byte 208 - this is a write command
I2C transmit byte 0x0E - I believe this is the control register
I2C transmit byte (0b00011100)
I can not remember what it does exactly, or from where I got it.
Any suggestions?
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Tue Apr 07, 2020 8:10 pm
by medelec35
Have you see
this?
It applies to DS3231
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Wed Apr 08, 2020 12:27 am
by medelec35
Hi billduck,
Did that help or you need further assistance?
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Wed Apr 08, 2020 12:47 am
by billduck
I guess I need to go read this very carefully <
https://datasheets.maximintegrated.com/en/ds/DS3231.pdf>
and see what 00011100 means. I know it's binary, but what it does in the contril register is the key.
My goal is to 1. figure out what it does, 2. See if I can implement it in the RTC component macro.
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Wed Apr 08, 2020 1:20 am
by medelec35
billduck wrote: see what 00011100 means.
Looking at the datasheet its just controlling the frequency of the square wave and only whe the alarm match the time keeping registers.
Does that ring a bell?
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Wed Apr 08, 2020 6:14 pm
by billduck
Well, thanks. I thought it had something to do with the button cell battery. So the code segment was entirely unnecessary. I will supress it and verify that the code performs as expected.
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Fri Apr 10, 2020 12:58 am
by billduck
Mr Medelec35. What is incorrect with this FC example? I ram trying to show passing a variable to a subroutine and returning a variable.
Hope it is well documented.
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Fri Apr 10, 2020 2:08 am
by medelec35
Hi,
What you need to do is double click the Call Subroutine (or right click, select properties) within main.
Add the variable you want to retrieve from the Call Subroutine like this:
If done correctly, you should see the call subroutine change with the required returned variable assigned to it:
Re: RTC upgrade for FC, V8.1.1.11 downloaded 4/6/20
Posted: Fri Apr 10, 2020 4:51 pm
by billduck
Made that change. Thanks. The problem, I discovered was that .Angle in the sub was an integer. My Bad