🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10664

Re: Timer question

#10664
From: Robert R. Burns
Date: Wed, 21 Dec 1988 22:35
37 lines
2322 bytes
In article <427@tekn01.chalmers.se> m81_claes@tekn01.chalmers.se writes:
)I  have  been  trying  to  write  a  RTTY  encoding  program,  but  have
)encountered problems  using the  timer.device. My  problem is  that when
)reading the current time  the shortest time  "unit" is 1/50s  (= 20 ms),
)ie. if i read current  time, then "wait", then  read it again, the "wait
)time" i get is allways a multipel of 20ms!. 

The system time maintained by the timer.device is only updated every
vertical blank (in Sweden, 50Hz).  I believe that if more than one
access is made between vertical blanks, the time is bumped by one to
make it monotonically increasing, but you've correctly described it's
accuracy.

)  I have tried using the timer as an "alarm clock" in the ms range, and
)it works fine (ok, you sometimes get to sleep 1ms or two to long, but
)never 20)
)
)  Is there anybody out there that knows if this is the way it is, or am
)i doing something wrong?
)
)  If this does not work i have to use the CIA's to check the time.

If I understand your application, you don't intend to busy wait while
checking the time.  If you *were* going to do that, you should set up
an interval to wait for, using the UNIT_MICROHZ that you know works.
But I think you just need a time *stamp* with higher granularity.  You
will need to allocate another of the available CIA timers for that --
CIA timers are allocated by acquiring the associated interrupt (even
though you're not going to use that in this instance) from the cia.resource
for CIAB (note that the timers on CIAA are hard allocated, only timers
A & B on CIAB are available to allocate).

-- 
Bob Burns, amiga!kodiak                   _
| /_  _|. _ |      Commodore __          |_) _ |_  _ )'
|<(_)(_)|(_\|<      /\ |  ||| _` /\      |_)(_\| )(_\ |
| \ Software    ___/..\|\/|||__|/..\___           Faith
Technical Details
Message-ID: <3210@amiga.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!xanth!ames!oliveb!amiga!kodiak
References: <427@tekn01.chalmers.se>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!xanth!ames!oliveb!amiga!kodiak
From: kodiak@amiga.UUCP (Robert R. Burns)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Timer question
Message-ID: <3210@amiga.UUCP>
Date: 21 Dec 88 22:35:30 GMT
References: <427@tekn01.chalmers.se>
Reply-To: kodiak@tooter.UUCP (Robert Burns)
Organization: Commodore-Amiga Inc, Los Gatos CA
Lines: 37