News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_eto

Easiest way to turn on/off a LED?

Started by eto, 13:35, 14 August 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eto

I am looking into easy ways to measure the input lag of LCD monitors and the different scan converter solutions available. 

A very easy way I stumbled across is, to make a video which captures the screen and a LED (https://alantechreview.blogspot.com/2020/05/a-5-tv-input-lag-tester-using-raspberry.html) and simply count the frames between the LED activity and screen activity. 

I'd like to do that with the CPC, so I am now looking into the most simple solution to turn on/off a LED that is connected to the CPC. 

Flip-flop? on the extension port? or maybe even easier on the printer port? 

Any ideas would be welcome. 

Bryce

How fast do you want it to blink? My first thought would be to connect it to the 1MHz signal to the AY or the 4MHz on the expansion port and then divide it down to the speed you require.

Bryce.

eto

Quote from: Bryce on 14:37, 14 August 22How fast do you want it to blink? My first thought would be to connect it to the 1MHz signal to the AY or the 4MHz on the expansion port and then divide it down to the speed you require.

Bryce.
Sorry, I probably was not clear what I meant. It should not blink. I want to be able to turn it on, then draw something on a screen. A second later I want to turn it off again and clear the screen. 

With my iPhone I will record this at 240fps and can them analyze the lag of the screen/scaler combination. In one frame I will see that the LED turns on and then a few frames later I will see the change in the screen. The number of frames will give me a rough but good enough idea about the input lag of the screen. 

On the raspberry  I could do that by turning gpio on, then draw something, then turn it off. On the CPC I guess that requires some additional logic chips as I don't think there is any port that keeps its state like a GPIO.

andycadley

The printer port maybe?

GUNHED

You can use the LED of the floppy drive. Just program the FDC in the desired way (selecting drive). No need to switch the drive on, just the a few outs to the FDC.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

eto

Quote from: GUNHED on 19:11, 14 August 22You can use the LED of the floppy drive. Just program the FDC in the desired way (selecting drive). No need to switch the drive on, just the a few outs to the FDC.
Will this be instant? Or is there a time delay until the LED turns on?

eto

Quote from: andycadley on 15:28, 14 August 22The printer port maybe?
can I turn on a pin so that it stays on?

pelrun

Fastest way is to just write to the printer port (&EFFF); bits 0-6 are set directly via a latch. Stick an LED and resistor on any of those and you're done.

Cwiiis

Another way would be to use my video distribution circuit, plug into both a CRT and LCD at the same time and record both - you'll need to record results on a CRT anyway with this method to get a baseline figure for latency, this would let you do it without any coding 🙂

The circuit looks complicated, but you could remove the audio part and only hook up sync and a single colour channel and then you really don't need much circuitry at all.

https://www.cpcwiki.eu/forum/index.php?msg=207523

pelrun

You don't actually need to "calibrate" against a CRT. The latency there is (effectively) zero, as the electron beam is directly driven by the monitor output. It's orders of magnitude faster than the CPU can even do a single write operation, so there's nothing to measure.

eto

Quote from: Cwiiis on 08:28, 15 August 22Another way would be to use my video distribution circuit, plug into both a CRT and LCD at the same time and record both - you'll need to record results on a CRT anyway with this method to get a baseline figure for latency, this would let you do it without any coding 🙂
100% agreed. But I thought I will just do a "calibration" with a CRT to get the base line and check if my idea is reliable with not too much variation. Then do the tests with LCDs. The idea is, to make it as easy as possible so everyone can replicate this in the future.

I will go for the printer port solution, do a few baseline tests and then check how things behave for GBS8200 with GBS Control (maybe on different monitors to see if they add lag), LCD TVs over Scart, LCD TV over VGA, LCD monitor (15KhZ compatible). and a SCARTtoHDMI converter.

eto

Quote from: pelrun on 09:47, 15 August 22You don't actually need to "calibrate" against a CRT. The latency there is (effectively) zero, as the electron beam is directly driven by the monitor output. It's orders of magnitude faster than the CPU can even do a single write operation, so there's nothing to measure.
Indeed, but I need it to calibrate my set-up. I'm not yet sure what is the correct way to turn on the LED and print something on screen. The set-up with the CRT will allow to do that in a way that I can make sure, the whole set-up is reliable. Or: if I don't manage to get it perfect and e.g. will always have 1 frame in my 240Hz video even with CRT, I will know that I have to deduct 1 frame from the LCD tests to compensate my imperfect set-up. 

GUNHED

Eventually you can use the LEDs of the LambdaSpeak.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

eto

Quote from: GUNHED on 00:58, 17 August 22Eventually you can use the LEDs of the LambdaSpeak.
I don't have that. I used the printer port idea as it's easy to build. 

But I want to check if your idea with the drive LED is feasible. That would be even better, as it means, you can test your screen lag with nothing but your CPC and a smartphone. 

GUNHED

Then use B-drive. Hold it close to the monitor.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod