Solved

C Language question

Posted on 1997-06-27
2
185 Views
Last Modified: 2012-05-04
I am trying to read data from the parallel port at precise intervals (The fastest needed interval is 43 microseconds)
There are also a few steps which need to be done after reading the data.  To do this I beleive I need a very accurate timer, and the standard timer on the PC is only accurate to 54 miliseconds.  We have tried reading data from the 8253 external timer, but have not had much luck with this.  Does anyone have any ideas?
0
Comment
Question by:ghausheer
2 Comments
 
LVL 4

Accepted Solution

by:
emmons earned 170 total points
ID: 1251779
Talking directly to the 8253 should give you the resolution you crave. Check out this web site for some samples and instructions on dealing directly with the timer -
http://www.strangecreations.com/strange/library/hardware/pit.txt
0
 
LVL 10

Expert Comment

by:rbr
ID: 1251780
If you use an AT you can use Function 83h of Interrupt 15h.
This function sets a flag at Bit number 7 after a period of time.
AH:= 83h
ES:= Segment Adress of the flag.
BX:= Offset Adress of the flag.
CX:= High Word of Microseconds you want
DX:= Low Word of Microseconds you want.

Or if you want to wait for some microseconds use function 86h of the same interrupt.
AH:=86h
CX:= High word of microseconds to wait for.
DX:= Low Word of microseconds to wait for.



0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Best UNIX-compatible free C compiler for Windows or Mac 6 239
How to set environment variables in C 2 78
Want to delete all my personal data 13 138
UPD maximums on Red Hat 6 110
Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now