Electron YUV video

discuss both original and modern hardware for the bbc micro/electron
Post Reply
User avatar
*TAPE
Posts: 38
Joined: Sat Nov 14, 2020 9:01 pm
Location: Sheffield, Yorkshire
Contact:

Electron YUV video

Post by *TAPE »

Viewing 1980s computers on an HDMI screen..... source of much deliberation.

Its a compromise of awkwardness v quality v price.


There's the RGB to HDMI approach. But that either requires a small computer, or a professional converter.
Incidentally I see Ebay suddenly has several of these....
https://www.ebay.co.uk/sch/i.html?_nkw=rgb-hdmi+300
....but they would require resistors to bring the TTL down to 1Vp-p.

There's composite video..... with its bleeding colours.


It occurred to me that to produce the composite and RF outputs from RGB, that YUV must exist somewhere inside the electron.

YUV to digital video converters are far more commonplace, easier to get hold of, and cheaper.
So, this would be a modification which would then require an external (yet cheap) adapter, but 'should' provide a very good image quality.


Before I proceed any further I must confess my knowledge of analogue circuitry is limited. Whilst at university most of my course concentrated on digital circuitry. I just about understand what is going on in this bit of circuitry, but precisely how. Furthermore, I don't have any suitable test kit nor means to check out my 'theory'.

Anyhow, cue the (badly scanned) circuit diagram.
electron vid yuv.png
For both the RF and composite outputs the luminance/Y is derrived using a small network of resistors.

The composite video path uses different resistor values to the RF path for some reason. I don't know why.

Y=(R x 0.299)+(G x 0.587)+(B x 0.114)

I think U and V are somehow created by six XOR and six NAND gates.

U = B - Y = B - ((R x 0.299)+(G x 0.587)+(B x 0.114))

V = R - Y = R - ((R x 0.299)+(G x 0.587)+(B x 0.114))

The clever bit is that V is 90 degrees behind U. Achieving this in binary logic is (I think) the clever bit.


This network of gates has three extra inputs which originate from two places:
J - originates from a 17MHz crcrystal (which I guess generates the 4.4Mhz chroma-subcarrier when divided by 4) - Likely generates chroma-subcarrier
K - a function of !HS and a 17MHz crystal (Aplogies, no ideas what this bit does)
L - colour burst which occurs briefly at the start of each line, triggered by !HS.


I unpicked what the logic network does....
XOR gates:
X1 = R XOR G
X2 = B XOR G
X3 = B XOR J
X4 = G XOR J
X5 = G XOR K
X6 = B XOR K

Note, only one function of R so far.

Unpicking the NAND gates
N1 = X2 NAND X3 = (B XOR G) NAND (B XOR J)
N2 = X1 NAND X4 = (R XOR G) NAND (G XOR J)
N3 = X1 NAND X5 = (R XOR G) NAND (G XOR K)
N4 = X2 NAND X6 = (B XOR G) NAND (B XOR K)
N5 = X4 NAND L = (G XOR J) NAND L
N6 = X6 NAND L = (B XOR K) NAND L


The outputs of these go through various resistors before being mixed together along with the output of X1 (R XOR G) and X2 (B XOR G).

Would the calculation of the 'mixing' be made using a parallel resistor formula?



Again, U = B - Y , and V = R - Y

N1 and N4 are a function of B. Therefore, I reckon the sum of N1, N4 and X2 = U.
N2 and N3 are a function of R. Therefore, I reckon the sum of N2, N3 and X1 = V. Cleverly, somehow 90 degrees after U.

These signals then go through a coil and capacitor which I guess round the whole thing off to a nice (enough) sine wave, before being buffered by a capacitor biased at 2.5V. The output of which is then mixed to the luminance signal before the RF modulator.

I ask the more knowledgable Acorn hive mind, would my theory work?
User avatar
Richard Russell
Posts: 2071
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Electron YUV video

Post by Richard Russell »

*TAPE wrote:
Sun Jan 17, 2021 7:58 pm
Anyhow, cue the (badly scanned) circuit diagram.
I designed that circuit! Or to be more precise I designed a PAL Encoder using TTL logic that is so similar to the one Acorn uses that we concluded, when this came up before, that it couldn't possibly be coincidence. And it's highly likely that I mentioned my encoder design to Acorn at the time, and may well have given them a copy.

Anyway, the bad news is that nowhere in my 'TTL' PAL encoder does it generate baseband U and V signals. As you have deduced, it goes directly from digital RGB to modulated 4.433 MHz subcarrier in one hit, using various exclusive-OR gates and resistive mixing networks. That's not to say that it's impossible to generate U & V using a similar technique - I don't remember enough about how the circuit works to answer that - but I doubt that it would be any easier than starting from scratch using the equations you listed.
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
*TAPE
Posts: 38
Joined: Sat Nov 14, 2020 9:01 pm
Location: Sheffield, Yorkshire
Contact:

Re: Electron YUV video

Post by *TAPE »

Richard Russell wrote:
Sun Jan 17, 2021 11:49 pm
...the bad news is that nowhere in my 'TTL' PAL encoder does it generate baseband U and V signals.
I was going to disagree.

PAL chroma subcarrier is the U and V components, U + (V delayed by 90 degrees, or 0.05µS), and then added to a HF carrier.

Your original diagram shows the introduction of a signal 90 degrees ahead of its neighbour. I read this as the modulating signal for U and V.
On the Electron diagram I suspect J and K are those two exact signals, I just can't figure out which is which though.

And then the penny dropped. J and K are at 4.433MHz. As soon as J, K and L are introduced to the matrix, we're no longer in base band video. AND for YUV, we want U and V perfectly IN phase, not 90 degrees apart. DOH! ](*,)

You are absolutely correct, Mr Russell. U and V do not exist as discreet video signals. Im sure there is some sort of 'Jedi Master' reference that would be appropriate here!

And this is why I have respect for the more senior engineers who designed analogue electronics. When I did electronic engineering at university (91-93), we we're taught nothing of this sort of circuit design. Just digital design, power control, and infinite Fourier series!

One thing is certain though, with a slight tweek of the resistor network, the Acorn could be brought in to the 21st Century by making it output HDR! HDR in 4:3!
User avatar
Richard Russell
Posts: 2071
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Electron YUV video

Post by Richard Russell »

*TAPE wrote:
Mon Jan 18, 2021 3:41 pm
PAL chroma subcarrier is the U and V components, U + (V delayed by 90 degrees, or 0.05µS), and then added to a HF carrier.
There is some confusion here. It is not the U and V baseband signals that are phase shifted, but the colour subcarrier onto which they are modulated. And they are multiplied by, not added to, that subcarrier. :)
One thing is certain though, with a slight tweek of the resistor network, the Acorn could be brought in to the 21st Century by making it output HDR! HDR in 4:3!
HDR is meaningless if there are only two values (0% and 100%) of R, G and B! It has often been suggested that it would have been more useful for palette entries 8-15 to correspond to additional colours, rather than the BBC Micro's flashing colours, but that would have required 'analogue' RGB outputs rather than 'TTL' ones, and would have made the PAL encoder much more complicated.
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
*TAPE
Posts: 38
Joined: Sat Nov 14, 2020 9:01 pm
Location: Sheffield, Yorkshire
Contact:

Re: Electron YUV video

Post by *TAPE »

To shamelessly invoke a scene from Spinal Tap.....
But HDR colour goes up to 11.
User avatar
Richard Russell
Posts: 2071
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Electron YUV video

Post by Richard Russell »

*TAPE wrote:
Tue Jan 19, 2021 4:01 pm
But HDR colour goes up to 11.
It's at the other end of the range (really dark colours) that HDR makes a difference. One of the (admittedly less common) HDR variants - Hybrid Log-Gamma - was developed at BBC Research & Development Department, where I worked for 33 years!
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
*TAPE
Posts: 38
Joined: Sat Nov 14, 2020 9:01 pm
Location: Sheffield, Yorkshire
Contact:

Re: Electron YUV video

Post by *TAPE »

....and thus your contribution to Acorn. =D>

I must confess I also work in telly. VT op and VT guarantee engineer in the OB sector. As a freelance mercenary I'll work for anyone who'll pay my invoice. More content is being originated in (3Gb/s) 1080p now, mostly SDR, occasionally HDR (S-Log3/REC.2020). Irrespective of which curve you use, HDR just adds extra layers of complexity to any OB, and there are not many OB trucks in the UK that can do HDR.
I suspect the choice of S-Log3 (for sports coverage) is because the broadcasters want live events to look bright and colourful..... a technique pioneered by Sky Sports in the early days, "I don't care what your scope says, just open up the iris and crank up the colour. It makes it look good."
User avatar
1024MAK
Posts: 10544
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Electron YUV video

Post by 1024MAK »

If you want some bedtime reading, try this topic. It’s a fairly good way to get HDMI ;-)

Mark
User avatar
1024MAK
Posts: 10544
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Electron YUV video

Post by 1024MAK »

*TAPE wrote:
Tue Jan 19, 2021 8:36 pm
I suspect the choice of S-Log3 (for sports coverage) is because the broadcasters want live events to look bright and colourful..... a technique pioneered by Sky Sports in the early days, "I don't care what your scope says, just open up the iris and crank up the colour. It makes it look good."
And yet they insist on stupid DOGs. Okay, now some are semitransparent so not as annoying as they once were.

Anyhoo that’s off topic, so I’ll shut up now :-#

Mark
dominicbeesley
Posts: 1444
Joined: Tue Apr 30, 2013 12:16 pm
Contact:

Re: Electron YUV video

Post by dominicbeesley »

If you're prepared to tinker I've got some RGB to YUV boards I "designed" they're not perfect (the contrast is a bit down) but do more or less work. They take RGB in and give YPbPr out - I needed them to get my Beeb to hook up to a Roxio GameCap device.

I've been thinking about doing something a bit more complex with a ti TVP7002 and a cpld or small FPGA to give scan doubling 576p/50 and maybe HDMI output but it's still at the thought experiment stage at the moment - unless anyone knows of a better/cheaper/easier three or more channel ADC - I'd quite like something that does analogue RGB to work with RobC's NULA.

D
User avatar
robcfg
Posts: 113
Joined: Sun Dec 30, 2018 6:23 pm
Contact:

Re: Electron YUV video

Post by robcfg »

Do these boards fit inside the electron?

I’m tinkering with a YPbPr to hdmi converter and would be nice to use it with the Electron too.
dominicbeesley
Posts: 1444
Joined: Tue Apr 30, 2013 12:16 pm
Contact:

Re: Electron YUV video

Post by dominicbeesley »

No they're about 8cm square and convert the rgb to yup. I'll get a picture tomorrow
User avatar
robcfg
Posts: 113
Joined: Sun Dec 30, 2018 6:23 pm
Contact:

Re: Electron YUV video

Post by robcfg »

Nice, thank you!
dominicbeesley
Posts: 1444
Joined: Tue Apr 30, 2013 12:16 pm
Contact:

Re: Electron YUV video

Post by dominicbeesley »

I don't know how handy you are with a soldering iron? You'd require a load of smt transistors and resistors and the DIN plug/socket.

It's a fairly simplistic circuit and give slightly lower levels than I'd hoped for but comes out ok after turning the contrast up a tad.

I'm sure there are better circuits but this was what I'd had on a breadboard for ages.

The captures from the screen are BBC->YUV board->Roxio Game Cap->HDMI->HDMI to USB. The signal from the YUV board looks better when plugged direct into a YUV monitor. The Roxio Game Cap tends to mangle mode 7 and mode 0 slightly.

There is also an RGB pass-thru connector.

The resistors R24-R29 are all just links on my board - they were to allow me to fit ferrite beads if I needed them. I've also shorted r23 and added a "speed up" cacitor of 100pf in parallel with R10 on my board to get the U/V signals to better register with Y on my capture device, this might or might not be necessary depending on what you're feeding to. I suspect the Roxio GameCap thing is at fault?

I'd appreciate feedback from the more knowledgeable as to where it could be improved!
Attachments
20210122_173707.jpg
20210122_173857.jpg
20210122_173849.jpg
yuvschema.pdf
(59.4 KiB) Downloaded 11 times
advent65.png
mo.0.png
User avatar
robcfg
Posts: 113
Joined: Sun Dec 30, 2018 6:23 pm
Contact:

Re: Electron YUV video

Post by robcfg »

They look very nice!

I can do my fair share of soldering and would be delighted if I can get a board from you.

I usually see my Electron on a small chinese display which is not good but does the work. Now, who wouldn't like better quality and the ability to work with the Electron on a big HDMI monitor... :mrgreen:

Plus, tinkering is fun!
dominicbeesley
Posts: 1444
Joined: Tue Apr 30, 2013 12:16 pm
Contact:

Re: Electron YUV video

Post by dominicbeesley »

I prefer a smaller crt display!

Pm me your address and I'll send one out next week

D
Post Reply

Return to “8-bit acorn hardware”