[net.micro.amiga] Amiga clock again

XBR1D97B%DDATHD21.BITNET@WISCVM.WISC.EDU (04/16/86)

From: XBR1D97B%DDATHD21.BITNET@WISCVM.WISC.EDU  (D97B@BR1.THDNET)

REPLY-TO: <#D2S%DDATHD21.BITNET@WISCVM.WISC.EDU>

Hello amigas and amigos,

about three weeks ago I posted two mails to the net. One was about CLI
(ideas for improvement) and the other was about a clock-timing-problem.
While someone was able to help me in the first place (ZLI, right?), the
clock-timing-problem is still unanswered.
Looking at the replies I received (3!), I think you people outside in
netland did not understand me (due to my english?). So I try again...
My problem was (and is!) the following:

The realtime-clock inside the Amiga is realized using the TOD-clock,
contained in one of the 8520 CIA's.

<extract of the Amiga Hardware Manual (C) 1985 by Commodore... follows:>

                      *** Appendix_F Page 6:
                      ======================
> TIME OF DAY CLOCK
>
> TOD consists of a 24-bit binary-counter. Positive edge transistions on
> this pin cause the binary-counter to increment. The TOD pin has a
> passive pull-up on it.

                     *** Appendix_F Page 10:
                     =======================
> BIT MAP OF REGISTER CRA:
> REG # NAME TOD     . . . .
>             IN     . . . .
>  E    CRA  0=60Hz  . . . .
>            1=50Hz  . . . .

                         <end of extract>

In the USA the AC-supply (the *JUICE*) is 110 V / 60 Hz, while e.g.
W.Germany has 220 V / 50 Hz instead. As the TODIN pin is clocked by
the *JUICE*, Amiga with US-software wants 60 Hz and gets 50 Hz.
This makes the TOD-clock 10 Hz too slow. I tried to fix this problem
by setting the CRA TODIN-bit to logical 1 (=50Hz) in 68000, but it
failed. Failed the way, that the WORKBENCH-clock was still too slow.
Probably my program is OK, but the clock-program forces the TODIN-bit
back to logical 0 (=60Hz)? If this is true, Amiga should offer an
EURO-PATCH for the Amiga (do YOU LISTEN Amiga-people?).
Maybe my program is not right. So I post it here. Please don't tell
me, that it is right, just answer, if it is wrong!

<68000-routine to set TODIN-clock to 50 Hz following:>

>           RORG 0               ; everything's relative
> CIAACRA   EQU   $BFEE01        ; 8520-A CRA
> CIABCRA   EQU   $BFDE00        ; 8520-B CRA
> TODIN     EQU   $80            ; Bit 7 of CRA (TODIN)
> *
> * This routine sets bit 7 of the CRA's of both CIAs inside the Amiga
> * to 50 Hz-mode. I set both of them to 50 Hz, just because I don't
> * know which one is really used for the realtime-clock...
> *
> BEGIN:    ORI.B #TODIN,CIAACRA ; which one might it be ? This one,
>           ORI.B #TODIN,CIABCRA ; or this one ?
>           RTS                  ; old Beatle-song: GET BACK!
> *
> * This is what I tried, and if you believe it or not, it failed!
> *
>           END                  ; Yes, I like PASCAL-notation!

                  <end of 68000-routine>

Ok, amiga-gurus, where's your wise advise (please don't let me long
too long...).

                    awaiting your help
                       Kosta Kostis

---------------------------------------------------------------------------
P l e a s e   dont't reply to my F R O M -address!!!
If you want to MAIL anything to   m e   send it to:
                                  ===
BITNET: #D2S@DDATHD21
APRA  : #D2S%DDATHD21.BITNET@WISCVM.WISC.EDU
UUCP  : SAM:'guess a number between one and thirty!','42','That's correct!'
HOME  : Kosta Kostis, Talstr. 25, 6074 Roedermark 3, W. Germany

Disclaimer: Tell me what time it is, and I tell you what I disclaim!
---------------------------------------------------------------------------

neil@amiga.UUCP (04/19/86)

In article <1900@caip.RUTGERS.EDU> XBR1D97B%DDATHD21.BITNET@WISCVM.WISC.EDU writes:
>Hello amigas and amigos,
>
>about three weeks ago I posted two mails to the net. One was about CLI
>(ideas for improvement) and the other was about a clock-timing-problem.
>While someone was able to help me in the first place (ZLI, right?), the
>clock-timing-problem is still unanswered.
>Looking at the replies I received (3!), I think you people outside in
>netland did not understand me (due to my english?). So I try again...
>My problem was (and is!) the following:

I sent out a previous note about this problem, and that it was fixed
in 1.2.  I guess it did not make it to Germany.  It seems to be impossible
to reply directly to you from USENET land...

1.2 dynamically figures out your line frequency and sets the proper
constants on the fly.  As soon as it goes into beta it will be shipped
to registered developers.

>W.Germany has 220 V / 50 Hz instead. As the TODIN pin is clocked by
>the *JUICE*, Amiga with US-software wants 60 Hz and gets 50 Hz.
>This makes the TOD-clock 10 Hz too slow. I tried to fix this problem
>by setting the CRA TODIN-bit to logical 1 (=50Hz) in 68000, but it
>failed. Failed the way, that the WORKBENCH-clock was still too slow.
>Probably my program is OK, but the clock-program forces the TODIN-bit
>back to logical 0 (=60Hz)? If this is true, Amiga should offer an
>EURO-PATCH for the Amiga (do YOU LISTEN Amiga-people?).
>Maybe my program is not right. So I post it here. Please don't tell
>me, that it is right, just answer, if it is wrong!
>
>> * This routine sets bit 7 of the CRA's of both CIAs inside the Amiga
>> * to 50 Hz-mode. I set both of them to 50 Hz, just because I don't
>> * know which one is really used for the realtime-clock...

The manual is in error.  The 8520 that is in there is not arranged in
bcd digits -- it is a 24 bit counter.  The 50/60 hz mode bit is
nonexistant.  It is no wonder that your trying to poke it does no
good.

>                    awaiting your help
>                       Kosta Kostis

Await no longer.
	Neil Katin
	Commodore-Amiga Inc.