Welcome, Guest. Please login or register.

Author Topic: Interfacing serial RTC chip with serial port  (Read 3447 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Interfacing serial RTC chip with serial port
« on: March 07, 2007, 07:31:37 PM »
I've found a Serial Interface Real Time Clock Module. I'm wondering if there's any way to interface it with the serial port on an Amiga. I might then be able to write a simple Blitz Basic app to read the time and date from the serial port and set the Amiga's clock.

Would anybody have any idea if this is possible?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Tahoe

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 971
    • Show only replies by Tahoe
    • http://www.amiga4ever.nl
Re: Interfacing serial RTC chip with serial port
« Reply #1 on: March 07, 2007, 08:06:56 PM »
Why would you want to? Is your onboard RTC dead? Or does your miggy not have one?
Greetings from Wilnis, The Netherlands
Now owning ALL Amiga models and most; if not all; flavours of them...My Amiga Museum
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Interfacing serial RTC chip with serial port
« Reply #2 on: March 07, 2007, 08:09:53 PM »
The battery on my A4000 was removed before I bought it, and I refuse to put a soldering iron anywhere near it to solder a lithium battery in.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Tahoe

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 971
    • Show only replies by Tahoe
    • http://www.amiga4ever.nl
Re: Interfacing serial RTC chip with serial port
« Reply #3 on: March 07, 2007, 08:13:56 PM »
Right; so your on-board RTC is probably running just fine; you just need something to hold the time for you?

Is the "SAVE" button greyed out in Prefs/Time? If not your RTC is working fine and you only need a battery.

You could ofcourse also sync time with a internet based time source; your miggy would keep time until switched off..
Greetings from Wilnis, The Netherlands
Now owning ALL Amiga models and most; if not all; flavours of them...My Amiga Museum
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Interfacing serial RTC chip with serial port
« Reply #4 on: March 07, 2007, 08:18:19 PM »
Quote
Tahoe wrote:
Right; so your on-board RTC is probably running just fine; you just need something to hold the time for you?

Correct.

Quote
Tahoe wrote:
Is the "SAVE" button greyed out in Prefs/Time? If not your RTC is working fine and you only need a battery.

Yes, but as I said I don't want to solder a bettery to the motherboard.

Quote
Tahoe wrote:
You could ofcourse also sync time with a internet based time source; your miggy would keep time until switched off..

I have done this, but I don't always want to connect to the Internet because it causes problems with WHDLoad.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline shoggoth

  • Full Member
  • ***
  • Join Date: Dec 2004
  • Posts: 223
    • Show only replies by shoggoth
Re: Interfacing serial RTC chip with serial port
« Reply #5 on: March 07, 2007, 09:11:17 PM »
The serial interface on the clock modules you referenced use a synchronous serial interface. The serial port on the Amiga is asynchronous. You'd be better of using the parallel port and use bit-banging.

-- Peter
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Interfacing serial RTC chip with serial port
« Reply #6 on: March 07, 2007, 09:13:27 PM »
Quote
shoggoth wrote:
You'd be better of using the parallel port

With that chip, or a different one?

Quote
shoggoth wrote:
and use bit-banging.

I have no idea what that means :-)

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline InTheSand

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 1766
    • Show only replies by InTheSand
    • http://www.ali.geek.nz
Re: Interfacing serial RTC chip with serial port
« Reply #7 on: March 07, 2007, 11:23:05 PM »
Quote

Quote
shoggoth wrote:
and use bit-banging.

I have no idea what that means :-)


Heh! Bash on the hardware!

Read/write to the parallel port hardware directly, rather than going via an API...

 - Ali
 

Offline Dr_Righteous

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 1345
    • Show only replies by Dr_Righteous
Re: Interfacing serial RTC chip with serial port
« Reply #8 on: March 09, 2007, 01:49:21 AM »
It would be hundreds of times easier to solder a NiMH barrel battery (not the silly lithium coin batteries, you're just asking for trouble) in place on your motherboard than messing with an external RTC. I've done this on my A4000 and had no problems at all, and it's been in place for years.
- Doc

A4000D, A3640 OC-36.3MHz, custom tower, Mediator A4000D. Diamond Banshee 16M, Indivision AGA 4000, GVP HC+8.

Mac Mini 1.5GHz, that might run MorphOS someday, when the fools who own it come to the realization that 30 minutes just isn\'t enough time to play with it enough to decide whether or not you like it enough to cough up $200.

 - Someone please design SOME kind of DIY accelerator for the A4000. :D -
 

Offline adolescent

  • Hero Member
  • *****
  • Join Date: Sep 2003
  • Posts: 3056
    • Show only replies by adolescent
Re: Interfacing serial RTC chip with serial port
« Reply #9 on: March 09, 2007, 03:21:58 AM »
RTC?  Why not just go with serial to GPS or atomic clock?
Time to move on.  Bye Amiga.org.  :(
 

Offline alexh

  • Hero Member
  • *****
  • Join Date: Apr 2005
  • Posts: 3645
    • Show only replies by alexh
    • http://thalion.atari.org
Re: Interfacing serial RTC chip with serial port
« Reply #10 on: March 09, 2007, 11:11:52 AM »
Why not go for an NTP client application which updates your clock over the net every time you power on?

http://aminet.net/package/comm/tcp/facts

No soldering and I am sure you've already got a network.
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Interfacing serial RTC chip with serial port
« Reply #11 on: March 09, 2007, 11:29:20 AM »
@InTheSand
OIC, that's what I was planning to do with Blitz.

@Others who have suggested NNTP or soldering battery...
I've already explained why I don't want to do those.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline _yak_

  • Full Member
  • ***
  • Join Date: Mar 2006
  • Posts: 227
    • Show only replies by _yak_
Re: Interfacing serial RTC chip with serial port
« Reply #12 on: March 09, 2007, 04:14:39 PM »
@motorollin

The "serial" in the name of this chip doesn't refer to the RS-232 serial port. It uses a data/clock bus. Therefore it would be simplier to connect data in (DI), data out (DO) and clock (CLK) lines to the parallel port and access the parallel port registers directly (because parallel.device lets you only read/write data as bytes through the Dx lines, it doesn't give you separate control over the parallel port signals). This is called hardware banging.
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Interfacing serial RTC chip with serial port
« Reply #13 on: March 09, 2007, 04:21:53 PM »
Are DI, DO and CLK the only lines which need to connect to the parallel port? And is it as simple as powering the chip and connecting those lines to the port?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Stedy

  • Sr. Member
  • ****
  • Join Date: Jul 2002
  • Posts: 259
    • Show only replies by Stedy
    • http://www.ianstedman.co.uk
Re: Interfacing serial RTC chip with serial port
« Reply #14 on: March 09, 2007, 08:50:54 PM »
Hi,

Yes, connecting DI, DO, CLK and ground to the parallel would be all you need to do. Power the chip from a 5V power supply, using perhaps a connection from your Amiga's power supply or a micropower regulator and a battery pack to retain the time when the power is off!

Another option but more involved would be to use a micrcontroller to interface to the chip and send the time to your Amiga via the serial port. This would have a lower CPU overhead.