Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

astronomical clock and weather station

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1162
Location: France

france.gif
PostPosted: Thu Sep 10, 2015 5:33 pm    Post subject: astronomical clock and weather station Reply with quote

hello all,

this is a monster, a little bit more than 1 year of work, but now it work fine.

see the" Astro II astronomical clock.docx" summarizing all

I try to explain everything but my english is not good.
2 arduino mega2560 + 2display 5'' with SDcard and touch control
1 atmega 168
1 attiny 45
1 ds3234 RTC
1 bmp180
1 hyt221

and now I have to finish the box !

Bonne lecture !

I will very proud if you like it.
JP Wink
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5915
Location: Holland

blank.gif
PostPosted: Thu Sep 10, 2015 9:12 pm    Post subject: Reply with quote

Wow JP. that is something else !
First of all congratulations with finishing your project. And second, thanks for sharing this BIG project.
This is a big step up compared to clockeng.bas which is in the bascom samples.

You certainly must put it in a nice case , and make a demo video. From the screens and description, it must be spectacular.
For me an astronomical clock is new. I have never seen something like this before.
I appreciate the beauty of it. The way the sun is shown, the planet sphere, and the watch and gauges.
There are a lot of atmels inside. Good that you used standard boards for the most.
I do not know if the provided info is enough for other users to reproduce your project, but i did not read all files yet, and here at the forum we can ask Very Happy

About your questions :
The 256 bytes of ram have battery backup. So i think that some important program variables, could be placed there so they can survive a reset or power off.
But it would requires writing an reading memory. So you can best see it as an extra EEPROM memory.

I do not know what you mean with aging?

The links in the doc do not work, they open a translator, at least on my PC.

Again, thanks for taking the time to document and share.

_________________
Mark
Back to top
View user's profile Visit poster's website
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Fri Sep 11, 2015 2:55 am    Post subject: Reply with quote

Hello Duval JP

The word astronomical nearly covers it Very Happy

What a great work of art.

Regards Paul
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Fri Sep 11, 2015 7:11 am    Post subject: Great work! Reply with quote

Great work and great documentation!!!

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
W4GNS

Bascom Member



Joined: 03 Dec 2009
Posts: 11
Location: (Virginia)

usa.gif
PostPosted: Mon Sep 21, 2015 3:01 pm    Post subject: Reply with quote

WOW!! Very Happy Great and thanks for sharing!!
_________________
Bascom-AVR 2.0.7.6

Programmer USBASP (China Version)
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1162
Location: France

france.gif
PostPosted: Mon Oct 05, 2015 4:01 pm    Post subject: Reply with quote

I add a video of the main possibilities :

http://www.dailymotion.com/video/x38n591_astro-ii-astronomical-clock_tech

bon voyage in the stars Wink

JP
Back to top
View user's profile Visit poster's website
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 168
Location: Brazil

brazil.gif
PostPosted: Mon Oct 05, 2015 5:49 pm    Post subject: Reply with quote

Duval,

I'm without words to express my surprise and admiration for your Astronomical Clock !

Thanks a lot for share all this beautiful things with us !

Paulo
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5915
Location: Holland

blank.gif
PostPosted: Mon Oct 05, 2015 9:12 pm    Post subject: Reply with quote

Hello JP

Great that you found the time to make a video. I love it. Very Happy
Thanks again for sharing!

_________________
Mark
Back to top
View user's profile Visit poster's website
rsavas

Bascom Member



Joined: 10 Aug 2010
Posts: 197
Location: Baldwin, Ontario

canada.gif
PostPosted: Sat Nov 07, 2015 4:18 pm    Post subject: Reply with quote

Hi guys,

to answer your ? JP about DS3234 SRAM access
This is what I see in the DS
1) Address pointer operation when accessing the 256-byte SRAM data is covered in the description of the SRAM address and data registers.
2) SPI Address 18h is used as the address pointer (0-FFh) for reading the SRAM data array
3) SPI Address 98h is used as the address pointer (0-FFh) for writing the SRAM data array
4) SPI Address 19h is used as the address to read the SRAM data as was pointed to by the address that was loaded into 18h
5) SPI Address 99h is used as the address to write the SRAM data as was pointed to by the address that was loaded into 98h

SRAM Address Register (18h/98h)
The SRAM address register provides the 8-bit address of the 256-byte memory array. The desired memory address should be written to this register before the data register is accessed. The contents of this register are incremented automatically if the data register is accessed more than once during a single transfer. When the contents of the address register reach 0FFh, the next access causes the register to roll over to 00h.

SRAM Data Register (19h/99h)
The SRAM data register provides the data to be written to or the data read from the 256-byte memory array. During a read cycle, the data in this register is that found in the memory location in the SRAM address register (18h/98h). During a write cycle, the data in this register is placed in the memory location in the SRAM address register (18h/98h). When the SRAM data register is read or written, the internal register pointer remains at 19h/99h and the SRAM address register increments after each byte that is read or written, allowing multibyte transfers.

As for the other 2 ?'s

And how to manage the aging ?
I guess i need to understand if you are compensating for accuracy or drift? The two are not the same.
The way i am to understand it is that you write to the aging register to warp the crystal ( select loading capacitance) for accuracy at your operating temperature or at predetermined temps.
How to do it, well I guess you monitor the 32,768KHz output (enabled by default) and compare against your very accurate reference (xtal oven or atomic std, like we all have one) and then increment or decrement the aging register to compensate for accuracy.
So one way is to hook your very accurate freq ref (10MHz) to a synthesized sig gen ext ref input, set synth for 32,768KHz. Apply DS3234 osc o/p to "x" input on scope and synth 32,768KHz to "y" on scope, adjust for the lissajous pattern on oscilloscope. Adjust aging register (+/-) for no or minimal rotation. This will be the cal data for that particular op temp. If the device is to operated at other temps then the data will have to be determined at those temps as well. I guess this is why they have a temp sensor, so you can apply different compensation values. They could have done a better job at documenting how to do thsi compensation.

Aging Offset Register (10h/90h)
The aging offset register takes a user-provided value to add to or subtract from the oscillator capacitor array. The data is encoded in two’s complement, with bit 7 representing the SIGN bit. One LSB represents the smallest capacitor to be switched in or out of the capacitance array at the crystal pins. The aging offset register capacitance value is added or subtracted from the capacitance value that the device calculates for each temperature compensation. The offset register is added to the capacitance array during a normal temperature conversion, if the temperature changes from the previous conversion, or during a manual user conversion (setting the CONV bit). To see the effects of the aging register on the 32kHz output frequency immediately, a manual conversion should be performed after each aging offset register change. Positive aging values add capacitance to the array, slowing the oscillator frequency. Negative values remove capacitance from the array, increasing the oscillator frequency. The change in ppm per LSB is different at different temperatures. The frequency vs. temperature curve is shifted by the values used in this register. At +25°C, one LSB typically provides about 0.1ppm change in frequency. These bits are all set to logic 0 when power is first applied. Use of the aging register is not needed to achieve the accuracy as defined in the EC tables, but could be used to help compensate for aging at a given temperature. See the Typical Operating Characteristics section for a graph showing the effect of the register on accuracy over temperature.

Can someone tell me how do sound like bell ?
HW: Make a pwm then low pass filter
SW: Read the data out of memory in fixed time intervals, then apply to PWM DAC. The memory contains the pcm data that represents the analog equivalent. I do not know how to create the pcm data!
This thread should help
http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=8714
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1162
Location: France

france.gif
PostPosted: Sat Nov 07, 2015 5:12 pm    Post subject: Reply with quote

Thanks for your comments,
I will use for ASTRO 2.1

The DS3234 is remarkably accurate, I did not lose more than 3 seconds since the month of June also I do not correction (Aging) for the moment.
I wanted to write to ram a flag to mark wintertime or summertime, in fact I used the EEPROM knowing that this flag changes twice a year, the life expectancy of the EEPROM of the µ-controller is sufficient. Wink

Are you interrested to do an clock as it ?

best regards

JP
----------------------------------------------------------------------------------------
I've eliminated a small bug in the time change: this year it did not work !

the good sub:

Sub Summertime()
If Jmonth = 3 And Flag_st = 1 Then
If Dow = 7 Then ' dimanche
Jbyte = Jday + 7
If Jbyte => 31 Then 'bug here I forgot the >
If Jhour = 2 Then
Jhour = Jhour + 1
Flag_st = 2 ' summertime
Summerflag = Flag_st ' mise en mémoire eram du flag de changement d'heure
Wst = Wst + 1
Call Regnow() 'Gosub Settime: refaire le réglage de l'heure
Call Reading()

End If
End If
End If
End If
' Locate 3 , 1 : Lcd " dow" ; Dow ; " j;" ; Jbyte
If Jmonth = 10 And Flag_st = 2 Then
If Dow = 7 Then 'dimanche
Jbyte = Jday + 7
If Jbyte => 31 Then ' 'bug here I forgot the >
If Jhour = 3 Then
Jhour = Jhour - 1
Flag_st = 1 'wintertime
Summerflag = Flag_st ' mise en mémoire eram du flag de changement d'heure
Wst = Wst + 1
Call Regnow() ' Gosub Settime:
Call Reading()
End If
End If
End If
End If
End Sub
Back to top
View user's profile Visit poster's website
rsavas

Bascom Member



Joined: 10 Aug 2010
Posts: 197
Location: Baldwin, Ontario

canada.gif
PostPosted: Sat Nov 07, 2015 9:06 pm    Post subject: Reply with quote

I am not sure if I was going to make a astro II at this point in time. I am just trying to figure out how you put it all together. A picture of all the hardware wired up would help me.
One reason for looking at your project, was that I am looking at making a new intelligent thermostat for the house heating system. It would be nice to have a touch screen graphics display, as you have done.
For the thermostat, I only want/need one display, to save space, but it would be cool to add your analog type graphics display stuff instead of just a bunch of numbers on a old character type display Smile I have no experience with graphics displays. I know there is also FT800, which Mark A. informed me about awhile back.
I do have the BMP180 and a Honeywell HIH6130 humidity sensors running on a xmega in my radio project.
You have neatly cleaned up and put code into .inc files, so it is well organized.
I was wonder how much work it would be to take your code and get it going on a xmega?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum