Article View: comp.os.os2.programmer
Article #3716Re: Microsecond delays under OS/2
From: Anders Bjurman
Date: Thu, 28 Jan 1993 14:51
Date: Thu, 28 Jan 1993 14:51
32 lines
2331 bytes
2331 bytes
In article 29629@cs.joensuu.fi, jlavi@cs.joensuu.fi (Jarkko Lavinen) writes:
>Does anybody know how to generate few microseconds delay under OS/2?
>I am using emx environment and developing a front end for AD-converter
>which is connected to parallel port. One needs few microseconds delays
>to make sure the data really goes to device before pulsing strobe.
>
> Jarkko Lavinen
Sorry! I have no nice and easy answer but here are some suggestions:
1 (the easy solution): Write some dummy instructions before the strobe.
2 (modified easy solution): As an answer to the obvious question: what
happens when I bye a faster machine. The dummy instructions could be an
(nearly) empty loop (perhaps with some dummy instructions so the compiler
can't optimize it away, the volatile keyword could be of some use here).
The number of iterations could be calculated at start up by executing
the loop for a fix amount of time (say 1 second). The upper limit can
be calculated from the number of iterations made.
3 (As it "should" be implemented): Write a device driver for the A/D
(huu! - complicated). Maybe there is a timer channel that could be
used in there (I don't know anything about the hardware after the
8086 PC :-)
Hope this helped - Anders
---
_________________________________________________________
`"""' _/ RF Anders Bjurman, Memo: eri.etx.etxabju \_
O O __/ Ellemtel utvecklings AB Anders.Bjurman@eua.ericsson.se \
> _/ S-125 25 Alvsjo, Sweden +46 8 727 49 80 _/
o \______________________________________________________________/
Technical Details
Message-ID:
<1993Jan28.145140.13412@eua.ericsson.se>Path:
arc1-ca.pugleaf.net!sparky!uunet!pipex!bnr.co.uk!bnrgate!nott!torn!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!sunic!ericom!eua.ericsson.se!euas67c28!etxabjuReferences:
<1993Jan28.132339.29629@cs.joensuu.fi>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!bnr.co.uk!bnrgate!nott!torn!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!sunic!ericom!eua.ericsson.se!euas67c28!etxabju From: etxabju@eua.ericsson.se (Anders Bjurman) Subject: Re: Microsecond delays under OS/2 Message-ID: <1993Jan28.145140.13412@eua.ericsson.se> Sender: news@eua.ericsson.se Nntp-Posting-Host: euas67c28.eua.ericsson.se Reply-To: etxabju@eua.ericsson.se Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden References: <1993Jan28.132339.29629@cs.joensuu.fi> Date: Thu, 28 Jan 1993 14:51:40 GMT Lines: 34