RTC board

https://github.com/MiSTer-devel/Main_MiSTer/wiki
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

RTC board

Post by Sorgelig »

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 God
Atari God
Posts: 1578
Joined: Fri Sep 19, 2014 8:40 am

Re: RTC board

Post by Newsdee »

I knew it :) I guessed from some of your renders.
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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

Post by TorsteinP »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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 God
Atari God
Posts: 1578
Joined: Fri Sep 19, 2014 8:40 am

Re: RTC board

Post by Newsdee »

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

Post by TorsteinP »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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
Captain Atari
Captain Atari
Posts: 187
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: RTC board

Post by THaase »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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
Captain Atari
Captain Atari
Posts: 187
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: RTC board

Post by THaase »

Thanks a lot - may I know which components you've used?
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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
Captain Atari
Captain Atari
Posts: 187
Joined: Mon Oct 16, 2017 8:39 am
Location: Germany

Re: RTC board

Post by THaase »

Stupid me -I'll check.

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

Re: RTC board

Post by TorsteinP »

How do I adjust DST? My minimigs clock is 2 hours late :?
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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

Post by TorsteinP »

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

Post by TorsteinP »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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 Super Hero
Atari Super Hero
Posts: 502
Joined: Thu Sep 17, 2015 11:39 pm

Re: RTC board

Post by kolla »

hwclock --systohc

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

Re: RTC board

Post by TorsteinP »

kolla wrote:hwclock --systohc

:p
Thanks, that did it! :)
Just had to add -u since my local time is +2 ahead of UTC.
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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

Post by TorsteinP »

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
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: RTC board

Post by Sorgelig »

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

Post by TorsteinP »

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”