Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.electronics.design > #465411
| From | Don Y <blockedofcourse@foo.invalid> |
|---|---|
| Newsgroups | sci.electronics.design |
| Subject | Re: PC timing problem |
| Date | 2017-06-23 12:05 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <oijojh$6vq$1@dont-email.me> (permalink) |
| References | <0rsokcdm5ncdgt6c1qegpnn7rb3jehop43@4ax.com> <oihve2$qge$1@dont-email.me> <a61pkc15rbirru27l8e7v940b2phs0qhgd@4ax.com> |
On 6/22/2017 8:14 PM, John Larkin wrote:
> On Thu, 22 Jun 2017 19:50:07 -0700, Don Y
>
>>> Today a couple of guys literally walked up to our place and rang the
>>> doorbell, looking for help. They are medical types who know basically
>>> nothing about electronics.
>>>
>>> They want to plop a still image on a PC screen and simultaneously
>>> trigger some external gear. They would like those to be coincident to
>>> within maybe a millisecond. This will be a Windows machine, hardly a
>>> realtime OS. I don't think I could load a screen and simultaneously
>>> bang a serial port pin, or some USB device, accurate to a millisecond.
>>> Well, probably not.
>>
>> What is "looking at" the still image?
>
> A person. And maybe my photodiode in the corner.
Light pens (of various forms) can sense the bright spot on the screen.
A traditional light pen was just a photodiode that caused the contents
of the CRT controller's (CRTC) "refresh address" (the display row,column
being driven onto the CRT's pins at that INSTANT) to be captured in an
internal register (and the CPU informed of this event).
Arcade "shooter" games mounted a photodiode in the barrel of a
plastic "gun" and would overdrive ALL of the screen video (resulting
in a bright flash) at the instant the plastic gun's trigger was pressed
(i.e., the player was SHOOTING something) to effect this sort of capture
event.
Vector graphic displays (e.g., Imlac PDS-1) didn't have an inherent raster
that would allow the entire display to be "stimulated" in the hope of
stumbling across the lightpen's photodiode so, instead, they required the
user to drag a tracking "cross" to the point of interest and signify that
event by actuating a button (press the pen against the glass). Software
in the terminal would track the output of the photodiode as it was *drawing*
the various arms of the cross to detect if the pen was being moved to the
left of the cross's current position, right, up or down -- and the position
of the cross updated in real time to reflect that.
Note that in each of these, there is a tight coupling between the display's
"drive signals" (the raster in the traditional CRT and the deflection amplifer
voltages in the vector display) and the signal detected from the light pen.
You want the opposite case: you want the software to be able to dictate a
specific point in time to the external sensor. You know *where* the sensor
will be located. But, in the PC architecture, you don't know *when* the
signal will make it out to the actual "display".
[Notice the TV's in a department store all *trying* to display the same CONTENT
but with *noticeable* time skews in their presentation!]
In theory, you should be able to perceive a "spot" as small as the visible
field of the photodiode conditioned by the persistence of the display
"phosphor". And, the skew between the appearance of the dot and its
detection should only be determined by the delay in your photodiode signal
processing.
In reality, the time at which the dot appears on the screen will be dictated by
many factors:
- when is signal containing its information passed out to the video interface
- what delays are introduced in the (external?) display hardware
- time it takes the display to visually respond to the signal
- time it takes the photodiode to detect it
Typical refresh rates are in the 60Hz region. So, any dot that persists
for less than ~16ms is not guaranteed to EVER appear on the display!
And, as you don't know the point on the screen that the "current display
signal" is painting happens to be at any instant, you may be unfortunate
to discover that it *just* moved past that portion of the display that
your sensor is monitoring. So, you have to wait for another frame
(or, at best, *field*) to be painted to hit that point, again.
[unless you take the video game approach and FLASH the entire display
and let the photodiode monitor the entire frame -- easier to do this
electrically than optically]
In that case, assuming you can reserve a special "color" (i.e., combination
of video signal levels) for your "flash", you could detect it as soon as the
signals propagated out of the display (software) subsystem.
If you can't reserve a "color", then you'll have to resort to looking at a
group of time-contiguous display signals to deduce "hey, video is consistently
at <whatever> signal level across multiple lines/columns/fields/frames and
infer that the entire screen is being flashed.
Nowadays, the GPU (not the CPU) paints the display so there's an added level
of decoupling from the software. SAYING you want to paint the display bright
chartreuse doesn't mean it will happen *now*.
[The DirectX libraries might give some finer-grained assurances]
Point of all this is to loosen your timing constraint. Can a *human* actually
perceive the events you (they) are trying to specify?
[Some idea of what they're trying to do might help]
>> I.e., the image never APPEARS "instantaneously" so what point in time do you
>> use as a reference for your "accurate to a millisecond"?
>
> Let's say when the image is all on the screen. That suggests that the
> optical sensor wins. I guess the video signal sent to the LCD screen,
> and the screen refresh, are asynchronous. There is probably a way to
> synchronize video ram loads with screen refresh, but I'm not
> volunteering to write any device drivers.
No. The CPU (without hooks into the video hardware) can't guarantee
that what its ASKING to be painted on the display will actually be
"displayed" at any particular time.
The bottom half of the display might be updated before the refresh comes
around to the top half. Or, the other way around. The CPU can't control
the display's *raster*.
>> And, you've specified the *accuracy* but not the magnitude of the delay/skew
>> between that "image appearance reference point" and the "serial port pin".
>> I.e., 47268.3ms later? (+- 500us)
>
> How about 1 millisecond? That's their suggestion, but then they are
> not electronic guys, and their idea hasn't been tested yet, so nobody
> knows what really matters.
Again, if humans are the intended receptors of this information, I
challenge them to differentiate a 1ms event from a 10ms event;
*POPCORN*
or, recognized that its been skewed by 20ms!
Simple (unreliable) test: write a piece of code that paints the display
white, waits 16ms (to ensure its propagated to a 60Hz display device)
and then paints it black. Then, add delays before and after this event
and see if they can tell the difference.
>> Does the PC have to retain its functionality as a PC? Or, can it become
>> a dedicated "image displayer with serial port stroker"?
>
> I suppose it can be dedicated for the duration of one experiment. So
> maybe just detecting non-black VGA signals could work. That would be
> fairly easy, Altoids box afternoon sort of stuff.
For video hardware that supports a CLUT, you can just update the CLUT
to signify that "event", then restore it to its previous state to
"undo".
>> Does it have to run on ANY PC, any version of windows, etc.?
>
> It only has to work. I assume that we'd use something that they have,
> or maybe they could buy a cheapish laptop.
Does it have to be an *image*? Presumably, they'd want to be able to CHANGE
the image?
Sure sounds like they're specifying 4.72396K ohm resistors...
>>> I'm helping them for free, so I don't want to launch some big coding
>>> or hardware project.
>>>
>>> One idea is to tape a photodiode in the corner of their screen. Their
>>> image could always include a bright spot there, and we could trigger
>>> off that.
>>>
>>> Another is to use a laptop that has a video port, like you'd connect
>>> to a projector. Then somehow look at the (VGA?) signal and use that as
>>> the trigger.
>>
>> Run the video into (or out of?) "sleep" mode?
>>
>>> In both cases, they'd have to manually arm the system before a shot so
>>> normal PC screens wouldn't trigger the external gear. Make screen
>>> black, throw a switch, begin the show. Maybe a serial port pin could
>>> be the on/off switch?
>>>
>>> A serial or USB port pulse wouldn't have the false alarm problem, but
>>> time sync might be tricky. I have no idea how close in time the video
>>> and the electrical outputs could be aligned. I guess I could
>>> experiment.
>>>
>>> Just possibly the VGA image/signal could contain some distinct trigger
>>> pattern, like a 7 MHz or some such waveform that I could bandpass
>>> filter and trigger on. Maybe RGB at different frequencies? Sounds like
>>> work.
>>>
>>> These guys have a small chance of doing a lot of good in the world, so
>>> I'd like to give them some help, without it becoming a giant project.
>>>
>>> Any ideas?
Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PC timing problem John Larkin <jjlarkin@highlandtechnology.com> - 2017-06-22 19:15 -0700
Re: PC timing problem krw@notreal.com - 2017-06-22 22:37 -0400
Re: PC timing problem John Larkin <jjlarkin@highlandtechnology.com> - 2017-06-22 20:02 -0700
Re: PC timing problem bitrex <bitrex@de.lete.earthlink.net> - 2017-06-23 08:44 -0400
Re: PC timing problem rickman <gnuarm@gmail.com> - 2017-06-23 10:56 -0400
Re: PC timing problem bitrex <bitrex@de.lete.earthlink.net> - 2017-06-23 11:14 -0400
Re: PC timing problem rickman <gnuarm@gmail.com> - 2017-06-23 14:05 -0400
Re: PC timing problem bitrex <bitrex@de.lete.earthlink.net> - 2017-06-23 14:17 -0400
Re: PC timing problem rickman <gnuarm@gmail.com> - 2017-06-23 14:59 -0400
Re: PC timing problem bitrex <bitrex@de.lete.earthlink.net> - 2017-06-23 18:34 -0400
Re: PC timing problem krw@notreal.com - 2017-06-23 22:15 -0400
Re: PC timing problem Don Y <blockedofcourse@foo.invalid> - 2017-06-22 19:50 -0700
Re: PC timing problem John Larkin <jjlarkin@highlandtechnology.com> - 2017-06-22 20:14 -0700
Re: PC timing problem David Brown <david.brown@hesbynett.no> - 2017-06-23 15:20 +0200
Re: PC timing problem rickman <gnuarm@gmail.com> - 2017-06-23 10:58 -0400
Re: PC timing problem David Brown <david.brown@hesbynett.no> - 2017-06-26 10:31 +0200
Re: PC timing problem Spehro Pefhany <speffSNIP@interlogDOTyou.knowwhat> - 2017-06-26 09:05 -0400
Re: PC timing problem rickman <gnuarm@gmail.com> - 2017-06-26 12:41 -0400
Re: PC timing problem David Brown <david.brown@hesbynett.no> - 2017-06-27 06:47 +0200
Re: PC timing problem rickman <gnuarm@gmail.com> - 2017-06-27 14:07 -0400
Re: PC timing problem Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-06-27 11:44 -0700
Re: PC timing problem rickman <gnuarm@gmail.com> - 2017-06-28 02:11 -0400
Re: PC timing problem David Brown <david.brown@hesbynett.no> - 2017-06-28 09:03 +0200
Re: PC timing problem rickman <gnuarm@gmail.com> - 2017-06-28 03:53 -0400
Re: PC timing problem David Brown <david.brown@hesbynett.no> - 2017-06-28 11:28 +0200
Re: PC timing problem Don Y <blockedofcourse@foo.invalid> - 2017-06-23 12:05 -0700
Re: PC timing problem whit3rd <whit3rd@gmail.com> - 2017-06-22 19:56 -0700
Re: PC timing problem John Larkin <jjlarkin@highlandtechnology.com> - 2017-06-22 20:16 -0700
Re: PC timing problem tabbypurr@gmail.com - 2017-06-22 20:31 -0700
Re: PC timing problem bitrex <bitrex@de.lete.earthlink.net> - 2017-06-23 10:51 -0400
Re: PC timing problem Joe Chisolm <jchisolm6@earthlink.net> - 2017-06-23 00:36 -0500
Re: PC timing problem Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2017-06-23 08:39 +0100
Re: PC timing problem tabbypurr@gmail.com - 2017-06-23 02:01 -0700
Re: PC timing problem Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2017-06-23 10:24 +0100
Re: PC timing problem tabbypurr@gmail.com - 2017-06-23 02:38 -0700
Re: PC timing problem "Tim Williams" <tiwill@seventransistorlabs.com> - 2017-06-23 05:38 -0500
Re: PC timing problem jack4747@gmail.com - 2017-06-23 02:14 -0700
Re: PC timing problem Reinhardt Behm <rbehm@hushmail.com> - 2017-06-23 17:34 +0800
Re: PC timing problem whit3rd <whit3rd@gmail.com> - 2017-06-23 12:18 -0700
Re: PC timing problem Jasen Betts <jasen@xnet.co.nz> - 2017-06-23 11:41 +0000
Re: PC timing problem John Larkin <jjlarkin@highlandtechnology.com> - 2017-06-23 07:16 -0700
Re: PC timing problem bitrex <bitrex@de.lete.earthlink.net> - 2017-06-23 11:26 -0400
Re: PC timing problem Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-06-23 09:19 -0700
Re: PC timing problem John Larkin <jjlarkin@highlandtechnology.com> - 2017-06-23 09:28 -0700
Re: PC timing problem bitrex <bitrex@de.lete.earthlink.net> - 2017-06-23 13:40 -0400
Re: PC timing problem Jasen Betts <jasen@xnet.co.nz> - 2017-06-23 21:45 +0000
Re: PC timing problem tabbypurr@gmail.com - 2017-06-23 17:07 -0700
Re: PC timing problem Jasen Betts <jasen@xnet.co.nz> - 2017-06-24 02:22 +0000
Re: PC timing problem Don Kuenz <g@crcomp.net> - 2017-06-23 13:41 +0000
Re: PC timing problem "David Eather" <eather@tpg.com.au> - 2017-06-23 23:47 +1000
Re: PC timing problem bitrex <bitrex@de.lete.earthlink.net> - 2017-06-23 14:28 -0400
Re: PC timing problem rickman <gnuarm@gmail.com> - 2017-06-23 15:01 -0400
Re: PC timing problem whit3rd <whit3rd@gmail.com> - 2017-06-23 12:39 -0700
Re: PC timing problem David Brown <david.brown@hesbynett.no> - 2017-06-26 10:36 +0200
Re: PC timing problem M Philbrook <jamie_ka1lpa@charter.net> - 2017-06-26 18:53 -0400
Re: PC timing problem John Larkin <jjlarkin@highland_snip_technology.com> - 2017-06-23 12:21 -0700
Re: PC timing problem "David Eather" <eather@tpg.com.au> - 2017-06-23 23:55 +1000
Re: PC timing problem Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2017-06-23 08:47 -0700
Re: PC timing problem John Larkin <jjlarkin@highlandtechnology.com> - 2017-06-23 09:25 -0700
Re: PC timing problem Lasse Langwadt Christensen <langwadt@fonz.dk> - 2017-06-23 11:30 -0700
Re: PC timing problem Martin Riddle <martin_ridd@verizon.net> - 2017-06-23 18:34 -0400
Re: PC timing problem Robert Baer <robertbaer@localnet.com> - 2017-06-23 19:02 -0800
Re: PC timing problem M Philbrook <jamie_ka1lpa@charter.net> - 2017-06-24 12:05 -0400
Re: PC timing problem Dimitrij Klingbeil <nospam@no-address.com> - 2017-06-24 20:18 +0200
Re: PC timing problem bitrex <bitrex@de.lete.earthlink.net> - 2017-06-24 15:52 -0400
Re: PC timing problem Adrian Jansen <adrian@qq.vv.net> - 2017-06-25 09:26 +1000
Re: PC timing problem Jamie M <jmorken@shaw.ca> - 2017-06-24 23:36 -0700
csiph-web