comp.lang.ada
 help / color / mirror / Atom feed
* Re: High Precision timing
  1997-04-09  0:00 High Precision timing Ian Swinkels
@ 1997-04-08  0:00 ` Tom Moran
  1997-04-09  0:00 ` Jerry van Dijk
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Moran @ 1997-04-08  0:00 UTC (permalink / raw)



It's been a while, but doesn't counter 2 of the PC's 8253 control
dynamic RAM refresh?  If so, I'd suggest you not fiddle with it.
  If you need high resolution timing, but not frequent, time consuming
interrupts, how about just reading, but not resetting, channel 1? 
That's what I did in my replacement Calendar body for RR's Ada 83
(available on their BBS).
  If you need frequent interrupts with pretty good timing properties,
output (junk) characters on a serial port at 115 Kbaud, with the
Transmit interrupt ISR merely stuffing another character out the port. 
That will give interrupts at just under 100 microseconds.  I've posted
code for a background speaker driver using this technique on Compuserve.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* High Precision timing
@ 1997-04-09  0:00 Ian Swinkels
  1997-04-08  0:00 ` Tom Moran
  1997-04-09  0:00 ` Jerry van Dijk
  0 siblings, 2 replies; 3+ messages in thread
From: Ian Swinkels @ 1997-04-09  0:00 UTC (permalink / raw)



Hi all!

This is a question that is perhaps more hardware related, but here
goes anyway....

The IBM PC has a hardware timer that is 8253 compatable(embedded- you
know what I mean in that its not a single chip anymore). There are 3
timer channels.

The first is hooked to INT 0 to cause system ticks, resulting in the
execution of code at the 1C int vect.

The third is used in the generation, and its output is controled by
the 8255 programable interface controler.

Can anyone tell me if I can stuff around with the second timer without
causing system crashes?(all I have achieved so far).

At present I am using timer 1, speed up to do some timing, and timer 3
to control an output device. My code works reliably. 

What I want to do with channel 2 is to use it as a 1uS resolution
counter which can be software triggered, latched, read, and then
restarted.  The reason I want to do this is to free the CPU time that
I loose to performing timing with timer 1, plus the obvious benefit of
1uS accuracy.

Any takers to this curly question? Oh and if there is a solution, I
would very much appreciated some ASM code/pointers in the right
direction, to do this to timer 2. 

Thanks one and all.

Ian Swinkels.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: High Precision timing
  1997-04-09  0:00 High Precision timing Ian Swinkels
  1997-04-08  0:00 ` Tom Moran
@ 1997-04-09  0:00 ` Jerry van Dijk
  1 sibling, 0 replies; 3+ messages in thread
From: Jerry van Dijk @ 1997-04-09  0:00 UTC (permalink / raw)



>What I want to do with channel 2 is to use it as a 1uS resolution
>counter which can be software triggered, latched, read, and then
>restarted.

If you happen to be using GNAT/DOS, it was possible to do this sort
of thing using the DJGPP v1 ports. I'm not sure about the current V2
versions.

I' relocating in a few days, so if you're still interested in a fortnight,
mail be then and I'll see if the V1 based stuff still works.

--

-- Jerry van Dijk       | Haarlem, Holland
-- Business Consultant  | Team Ada
-- Ordina Finance       | jdijk@acm.org




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-04-09  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-09  0:00 High Precision timing Ian Swinkels
1997-04-08  0:00 ` Tom Moran
1997-04-09  0:00 ` Jerry van Dijk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox