Article View: net.micro.atari
Article #2005Re: ST timer tick?
From: Jwahar R. Bammi
Date: Sun, 12 Jan 1986 03:53
Date: Sun, 12 Jan 1986 03:53
49 lines
2247 bytes
2247 bytes
> Can anyone tell me how I can get a simple timer tick on my ST? I need a
> high resolution timer so that I can record keystrokes off of MIDI for a
> simple sequencer I'm writing. However, I've looked through all the
> developer documentation and can't figure out how to do it... Do I have to
> write an interupt handler to count timer interupts? (ugh...) I can't believe
> it's as hard as that...
>
> Steve Tynor
> Georgia Instutute of Technology
The simplest way is to read the value of the 200 Hz system
timer contained in location 4BA -- The hitch Hikers guide says 4BC but
that is a misprint. It has to be done in super mode otherwise you get
mushrooms. Here is a example
long ticks;
long *_hz200 = 0x000004ba;
read_ticks()
{
ticks = *_hz200;
}
main()
{
......
/* Call read_ticks in super mode - this def if missing in
osbind.h */
xbios(38,read_ticks);
/* ticks now has the value of the 200 Hz timer */
}
You could also use the Xbtimer() xbios call with timer a, but I
have'nt gotten it to work correctly as yet ( I had posted a query a
couple of days back, but still have no answer ).
Some people over here have been hacking midi code too. One of their
experiences was that incresing the size of the midi receive buffer
helps a lot too in keeping up with some of the Yahama equipment that
send status bytes every 200 ms (I think). this can be done by using
the Iorec() xbios call. Hope this helps.
--
Jwahar R. Bammi
Usenet: .....!decvax!cwruecmp!bammi
CSnet: bammi@case
Arpa: bammi%case@csnet-relay
CompuServe: 71515,155
Technical Details
Message-ID:
<1368@cwruecmp.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!cwruecmp!bammiReferences:
<1241@gitpyr.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site cwruecmp.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!cwruecmp!bammi From: bammi@cwruecmp.UUCP (Jwahar R. Bammi) Newsgroups: net.micro.atari Subject: Re: ST timer tick? Message-ID: <1368@cwruecmp.UUCP> Date: Sat, 11-Jan-86 22:53:10 EST Article-I.D.: cwruecmp.1368 Posted: Sat Jan 11 22:53:10 1986 Date-Received: Tue, 14-Jan-86 04:19:23 EST References: <1241@gitpyr.UUCP> Organization: CWRU Dept. Computer Eng., Cleveland, OH Lines: 49