RTC board

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

RTC board

Postby Sorgelig » Fri Sep 22, 2017 12:40 pm

New board for MiSTer - RTC
It's optional. For those who want their MISTer have the real time any time.

There will be be Linux and some cores update to utilize this board.

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 988
Joined: Fri Sep 19, 2014 8:40 am

Re: RTC board

Postby Newsdee » Fri Sep 22, 2017 4:21 pm

I knew it :) I guessed from some of your renders.

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Fri Sep 22, 2017 8:27 pm

yeah, it wasn't a secret.
It's strange that DE10-nano includes useless I2C accelerometer chip which is like 5th leg for dog. How they supposed to use accelerometer on board full of connected wires - it's pretty stationary device. They should include RTC instead which is pretty natural chip for such board.

TorsteinP
Atariator
Atariator
Posts: 21
Joined: Tue Sep 05, 2017 5:34 pm
Location: Norway

Re: RTC board

Postby TorsteinP » Fri Sep 22, 2017 8:48 pm

Sorgelig wrote:It's strange that DE10-nano includes useless I2C accelerometer chip which is like 5th leg for dog. How they supposed to use accelerometer on board full of connected wires - it's pretty stationary device. They should include RTC instead which is pretty natural chip for such board.

Since DE10-nano is so small, it can be used in drones and robots. Accelerometer makes more sence then :)

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Fri Sep 22, 2017 9:39 pm

Since DE10-nano is so small, it can be used in drones and robots. Accelerometer makes more sence then :)

especially if you check the power consumption and heat dissipation ;)

User avatar
Newsdee
Atari Super Hero
Atari Super Hero
Posts: 988
Joined: Fri Sep 19, 2014 8:40 am

Re: RTC board

Postby Newsdee » Sat Sep 23, 2017 1:31 am

Maybe it was just a matter of space utilization on the board / cost reduction? The RPi doesn't have an RTC either.
The DE10 is small enough for mobile devices, maybe the accelerometer could be used as controller?

TorsteinP
Atariator
Atariator
Posts: 21
Joined: Tue Sep 05, 2017 5:34 pm
Location: Norway

Re: RTC board

Postby TorsteinP » Sat Oct 14, 2017 12:17 pm

Question. Why are there 18 pins on the board connector when there are only 14 pins on DE10-nano? It looks like there are space on both sides so it probably doesn't matter. I'm just wondering..

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Sat Oct 14, 2017 3:17 pm

TorsteinP wrote:Question. Why are there 18 pins on the board connector when there are only 14 pins on DE10-nano? It looks like there are space on both sides so it probably doesn't matter. I'm just wondering..

It's a good question!
I've found that if i would use 14 pin connector then it's easy to shift the connector while connecting RTC board to the main board due to large space on both sides inside the boxed connector. That's why i've decided to use 18pin connector which perfectly fits inside and doesn't allow shifting.
But you may use 14pin connector if you cannot find 18pin. Then be careful when you connect the board - it's pretty hard to see the alignment.

THaase
Atarian
Atarian
Posts: 7
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: RTC board

Postby THaase » Mon Oct 16, 2017 8:53 am

Hi Sorgelig,

I'm finding your MiSTer Project very interesting and will try to go for it in the near future.

As the Option boards are (more or less) needed I've alreay ordered 10pcs of each board by PCBWay.
While they are on shipment I'm trying to already get the needed parts.

As the SDRAM Board is clear, I've started with the RTC Board.

Can you confirm that the following parts should fit for the RTC Board?

X1 https://www.digikey.com/products/en?key ... 37-1-ND%20
B1 https://www.digikey.com/products/en?key ... 6-CT-ND%20
U1 https://www.digikey.com/products/en?key ... 2FMS-ND%20
R1,R2 https://www.digikey.com/products/en?key ... CRCT-ND%20
C1 https://www.digikey.com/products/en?key ... 25-1-ND%20
P1 https://www.aliexpress.com/item/10-pcs- ... a0a86f5ef1

Thanks a lot in advance.

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Mon Oct 16, 2017 11:13 am

I cannot confirm first two parts as they are not the same i've used. Battery holder has other positions of legs so i don't know if it will fit. Same goes for XTal.

THaase
Atarian
Atarian
Posts: 7
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: RTC board

Postby THaase » Mon Oct 16, 2017 11:15 am

Thanks a lot - may I know which components you've used?

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Mon Oct 16, 2017 11:21 am

THaase wrote:Thanks a lot - may I know which components you've used?

i wrote the part numbers in schematics. See the PDF file.

THaase
Atarian
Atarian
Posts: 7
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: RTC board

Postby THaase » Mon Oct 16, 2017 11:24 am

Stupid me -I'll check.

Thanks

TorsteinP
Atariator
Atariator
Posts: 21
Joined: Tue Sep 05, 2017 5:34 pm
Location: Norway

Re: RTC board

Postby TorsteinP » Thu Oct 19, 2017 5:56 pm

How do I adjust DST? My minimigs clock is 2 hours late :?

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Thu Oct 19, 2017 8:51 pm

TorsteinP wrote:How do I adjust DST? My minimigs clock is 2 hours late :?

https://github.com/MiSTer-devel/Main_Mi ... /RTC-board

TorsteinP
Atariator
Atariator
Posts: 21
Joined: Tue Sep 05, 2017 5:34 pm
Location: Norway

Re: RTC board

Postby TorsteinP » Thu Oct 19, 2017 9:09 pm

Sorgelig wrote:
TorsteinP wrote:How do I adjust DST? My minimigs clock is 2 hours late :?

https://github.com/MiSTer-devel/Main_Mi ... /RTC-board

Ahh! Thanks :D

TorsteinP
Atariator
Atariator
Posts: 21
Joined: Tue Sep 05, 2017 5:34 pm
Location: Norway

Re: RTC board

Postby TorsteinP » Wed Oct 25, 2017 7:53 am

Are time and date supposed to be saved when powered off and be restored when powered on without internet connection?
If so, it isn't working. Made 2 boards so far and none of them saves the time.

When network cable is plugged in and I turn on power, date and time shows up in menu after a few seconds. I've left it running for 30+ minutes then turned it off, unplugged network cable, turned it on and date time never shows unless network cable is plugged in.

I'm using the M41T81 chip and a 12.5 pF x-tal. And I've checked that the battery is ok.

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Wed Oct 25, 2017 8:16 am

Of course saving the date/time during power off is the main task of RTC board.

make sure you've updated the linux part (use SD installer tool) to latest one. Older versions don't support RTC board.
Date/time is not immediately saved to RTC board. Linux saves it once per 11 minutes.
So, you need to keep MiSTer working around 15minutes at least, and with internet connected to the board.

There is a manual setting the date and saving to rtc using linux console, but it's out of this discussion. You may find the linux info on internet if you want to do some manual work.

kolla
Atari maniac
Atari maniac
Posts: 90
Joined: Thu Sep 17, 2015 11:39 pm
Contact:

Re: RTC board

Postby kolla » Wed Oct 25, 2017 10:49 am

hwclock --systohc

:p
-- kolla

TorsteinP
Atariator
Atariator
Posts: 21
Joined: Tue Sep 05, 2017 5:34 pm
Location: Norway

Re: RTC board

Postby TorsteinP » Wed Oct 25, 2017 8:09 pm

kolla wrote:hwclock --systohc

:p

Thanks, that did it! :)
Just had to add -u since my local time is +2 ahead of UTC.

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Thu Oct 26, 2017 1:20 pm

The short version it is:
store datetime to RTC:

Code: Select all

hwclock -wu

read RTC:

Code: Select all

hwclock -u


TorsteinP wrote:Thanks, that did it!

so, did you fix your problem with RTC?

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Thu Oct 26, 2017 2:08 pm

i found problem with M41T81S chip. After some time in power off it starts to show wrong date - several days behind the actual date.
I don't know if there is problem with particular chip or any M41T81S will work this way.
I have two other boards with M41T81 and MCP79410 - both keep time reliably.

The difference between M41T81 and M41T81S is very minor - the second one has flag of low battery voltage.

TorsteinP
Atariator
Atariator
Posts: 21
Joined: Tue Sep 05, 2017 5:34 pm
Location: Norway

Re: RTC board

Postby TorsteinP » Thu Oct 26, 2017 4:05 pm

Sorgelig wrote:i found problem with M41T81S chip. After some time in power off it starts to show wrong date - several days behind the actual date.
I don't know if there is problem with particular chip or any M41T81S will work this way.
I have two other boards with M41T81 and MCP79410 - both keep time reliably.

The difference between M41T81 and M41T81S is very minor - the second one has flag of low battery voltage.

When I tried again today after the MiSTer had been powered off for 18 hours, the date and time was same as when I powered it off yesterday.
This tells me that the crystal isn't working. I used SER4080CT-ND from digikey.

Lucky for me I have some old fashion crystals (they looks like a tiny pencil with legs) previously used with another RTC chip. There's plenty of room for it on RTC and this time it's working. Powered off for 5 mins after setting the time and when I powered on, time had advance correct amount of time. :)

Sorgelig
Atari God
Atari God
Posts: 1051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Postby Sorgelig » Thu Oct 26, 2017 4:24 pm

I'm glad you've fixed the problem.
Crystals are tricky. Besides the frequency they need to have appropriate load capacity. Some RTC chips require 6-9pF while others require 12pF. So, i've tried to make universal pads for different crystal sizes, and even for crystals with wired pins like you're using now.

TorsteinP
Atariator
Atariator
Posts: 21
Joined: Tue Sep 05, 2017 5:34 pm
Location: Norway

Re: RTC board

Postby TorsteinP » Thu Oct 26, 2017 4:42 pm

DigiKey part numbers for crystal CMR200T I found working is 300-8340-6-ND and I use the RTC chip M41T81 with number 497-4709-1-ND.


Return to “MiSTer”

Who is online

Users browsing this forum: Newsdee and 1 guest