RGB to HDMI using a Pi Zero and a small CPLD

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
IanB
Posts: 376
Joined: Sun Sep 04, 2011 7:28 pm
Location: South Wales
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by IanB » Sun May 19, 2019 10:29 pm

Elminster wrote:
Fri May 17, 2019 7:49 pm
Thanks, I have a big box of stand offs, probably all the wrong size.
...
Ordered 4 transparent cases, only need 3 but at that price and the fact it takes a while to come, I ordered a spare.
I just noticed that although it is otherwise indentical, the transparent case has different mountings to the black one, the support posts and their screw holes are much smaller in the transparent case and it comes with small self tapping screws which aren't even long enough to reach through the Pi board to actually secure it :(

I drilled out the support pillars using a 2mm drill so the stand offs could be screwed in but you have to be careful as the support pillars are already so much smaller they might split.

transparent-screws.jpg

I also cut / filed about 1.5 - 2 mm off the stand off threads so they don't have to be screwed in so far. (This may be worth doing even with the black case as the thread bottoms out in the screw holes and they are quite hard to screw in all the way)

success.jpg

One advantage with the transparent case, you don't actually have to drill holes for the LEDs :)
Last edited by IanB on Sun May 19, 2019 11:16 pm, edited 1 time in total.

User avatar
Elminster
Posts: 3446
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by Elminster » Sun May 19, 2019 10:59 pm

Ah ok thanks. Well I have one spare case, or will do, and a lot of hot glue. Well see how far I get.

f82
Posts: 2
Joined: Thu May 23, 2019 12:17 pm
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by f82 » Thu May 23, 2019 12:31 pm

Hi,

I was reading about this great project and I was thinking if this would theorically work, maybe with some specific customization, also with other old PAL 50hz game console that had rgb output to scart like the Megadrive. Lately I was considering a scaler/converter to output the video to a vga/hdmi monitor but prices and input output latency are the problem usually.

Thank :)

User avatar
hoglet
Posts: 8212
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by hoglet » Thu May 23, 2019 12:50 pm

f82 wrote:
Thu May 23, 2019 12:31 pm
I was reading about this great project and I was thinking if this would theorically work, maybe with some specific customization, also with other old PAL 50hz game console that had rgb output to scart like the Megadrive. Lately I was considering a scaler/converter to output the video to a vga/hdmi monitor but prices and input output latency are the problem usually.
I've just looked up the video specs on the Mega Drive:
https://segaretro.org/Sega_Mega_Drive/Palettes_and_CRAM

The system outputs 9-bit colour (i.e. 3-bit Red, 3-bit Green, 3-bit Blue) and the resolution is 320x240 (PAL) and 320x224 (NSTC).

I think in principle the software on the Pi could deal with this data rate.

Unfortunately, none of the current front end capture boards (for the Beeb or the Atom) support the digitization of 3-bit/pixel colours. For that, a new design would be needed, probably using three proper high-speed Video ADC devices, such as three AD9057 convertors:
https://uk.rs-online.com/web/p/video-adcs/7095115/

I'm not planning such a design, at least not in the short term anyway.

Dave
Last edited by hoglet on Thu May 23, 2019 1:03 pm, edited 3 times in total.

f82
Posts: 2
Joined: Thu May 23, 2019 12:17 pm
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by f82 » Thu May 23, 2019 4:00 pm

hoglet wrote:
Thu May 23, 2019 12:50 pm
f82 wrote:
Thu May 23, 2019 12:31 pm
I was reading about this great project and I was thinking if this would theorically work, maybe with some specific customization, also with other old PAL 50hz game console that had rgb output to scart like the Megadrive. Lately I was considering a scaler/converter to output the video to a vga/hdmi monitor but prices and input output latency are the problem usually.
I've just looked up the video specs on the Mega Drive:
https://segaretro.org/Sega_Mega_Drive/Palettes_and_CRAM

The system outputs 9-bit colour (i.e. 3-bit Red, 3-bit Green, 3-bit Blue) and the resolution is 320x240 (PAL) and 320x224 (NSTC).

I think in principle the software on the Pi could deal with this data rate.

Unfortunately, none of the current front end capture boards (for the Beeb or the Atom) support the digitization of 3-bit/pixel colours. For that, a new design would be needed, probably using three proper high-speed Video ADC devices, such as three AD9057 convertors:
https://uk.rs-online.com/web/p/video-adcs/7095115/

I'm not planning such a design, at least not in the short term anyway.

Dave
Thank you. It would be nice to have this device supporting these console and I was hoping it would have been just a matter of different software configs. :-|
I hope for the future to see a newer design supporting it! :wink:

User avatar
trixster
Posts: 860
Joined: Wed May 06, 2015 11:45 am
Location: York
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by trixster » Thu May 23, 2019 4:05 pm

f82 wrote:
Thu May 23, 2019 12:31 pm
Hi,

I was reading about this great project and I was thinking if this would theorically work, maybe with some specific customization, also with other old PAL 50hz game console that had rgb output to scart like the Megadrive. Lately I was considering a scaler/converter to output the video to a vga/hdmi monitor but prices and input output latency are the problem usually.

Thank :)
It’s not cheap at £100+ for a prebuilt one, but the OSSC is a sound purchase for rgb games consoles, especially if you use a scart switch to connect multiple devices to it. Virtually zero lag and lots of options for sync and output. Works well with rgb computers too.
A3020 | A3000 | A420/1 | BBC B | Master Turbo | ZX48K | NeoGeo
Atom | Amiga A4000 | A3000 | A1200 | A500 | PC Engine | Enterprise
Falcon | Saturn | PS1 | SNES | CPC6128 | C64 | 3DO | MD | Jaguar | X68000 | CD32

User avatar
marcusjambler
Posts: 600
Joined: Mon May 22, 2017 11:20 am
Location: Bradford
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by marcusjambler » Thu Jun 06, 2019 7:42 am

Interested in a PCB if there are some [-o<

Marcus

User avatar
hoglet
Posts: 8212
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by hoglet » Thu Jun 06, 2019 8:19 am

marcusjambler wrote:
Thu Jun 06, 2019 7:42 am
Interested in a PCB if there are some [-o<
I don't have any boards at the moment, but Daniel might have some still.
Last edited by hoglet on Thu Jun 06, 2019 8:19 am, edited 1 time in total.

User avatar
IanB
Posts: 376
Joined: Sun Sep 04, 2011 7:28 pm
Location: South Wales
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by IanB » Thu Jun 06, 2019 10:29 am

marcusjambler wrote:
Thu Jun 06, 2019 7:42 am
Interested in a PCB if there are some [-o<
Looks like someone has listed their surplus ones on ebay:

https://www.ebay.co.uk/itm/PCB-for-the- ... 3516528081
Last edited by IanB on Thu Jun 06, 2019 5:37 pm, edited 1 time in total.

User avatar
hoglet
Posts: 8212
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by hoglet » Thu Jun 06, 2019 11:10 am

It would have been nice if this vendor had asked permission. :(

He also seems to have mangled the silk screen.

Dave

bprosman
Posts: 283
Joined: Sun Mar 29, 2015 10:27 pm
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by bprosman » Thu Jun 06, 2019 12:46 pm

Sue him Dave :evil: :evil:

User avatar
Elminster
Posts: 3446
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by Elminster » Thu Jun 06, 2019 1:49 pm

hoglet wrote:
Thu Jun 06, 2019 11:10 am

He also seems to have mangled the silk screen.
Just checked silk screen on the ones I had done at seeed recently and they are fine. Perhaps he didn't use seeedstudio.

User avatar
hoglet
Posts: 8212
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by hoglet » Thu Jun 06, 2019 3:32 pm

bprosman wrote:
Thu Jun 06, 2019 12:46 pm
Sue him Dave :evil: :evil:
I've just been contacted by Tim (retrobrewcomputing on ebay) who has explained the situation, and I'm happy for him to sell the spare boards that he has. They are the most recent (v4) version.

Dave

User avatar
Elminster
Posts: 3446
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by Elminster » Thu Jun 06, 2019 3:59 pm

Any idea what happened to the silk screen? I am sure mine were the latest board and checking them silkscreen looks fine.

Got me wondering now if I uploaded the wrong gerbers.

twoangrybears
Posts: 1
Joined: Thu Jun 06, 2019 4:17 pm
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by twoangrybears » Thu Jun 06, 2019 4:30 pm

Hi

I am the guilty party (Tim/retrobrewcomputing) who listed these PCBs without contacting @Hoglet first :oops: Thank you Dave for being so gracious about this and for giving me the clue I needed to register here (my ad blocker was stopping a cookie I needed to accept). It's nice to be here finally.

@Elminster I used JLCPCB to print the boards because I was in the middle of placing an order with them already rather than using seeed and I think the silk screen error crept in there. I will examine them more closely later to see if there is anything else but at first glance it looks as if the newline character between each line of the copyright message has been interpreted as a literal backlash followed by a "n" ("\n") rather than inserting a line break so three lines have been written as one line.

User avatar
Elminster
Posts: 3446
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by Elminster » Thu Jun 06, 2019 4:56 pm

Thanks for clearing that up. I shall rest easy, I checked mine and all look fine. Not built this batch yet.

bprosman
Posts: 283
Joined: Sun Mar 29, 2015 10:27 pm
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by bprosman » Thu Jun 06, 2019 6:54 pm

Glad you worked it out.

User avatar
IanB
Posts: 376
Joined: Sun Sep 04, 2011 7:28 pm
Location: South Wales
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by IanB » Fri Jun 14, 2019 12:03 am

I was asked in a PM if this adapter would work with a Spectrum so I did a bit of investigation. The original Spectrum only had multi level YUV internally so there is no simple way to get it working although a similar interface to the Atom board to convert YUV to TTL RGBI could be designed.

However it looks like it would be very easy to get it working with the Spectrum 128, +2, +2A and +3
According to this info:
http://www.fruitcake.plus.com/Sinclair/ ... TCable.htm
The spectrum 128 and +2 output TTL RGBI (4 bits) and that could be connected straight to the BBC converter with an appropriate profile using the same mods I did for PC CGA which is also RGBI.
The Spectrum +2A and 3 output analog RGB which isn't suitable but it looks like they have the TTL RGBI internally so those signals could be picked up and again connected directly to the BBC converter.
Last edited by IanB on Fri Jun 14, 2019 12:09 am, edited 1 time in total.

User avatar
sirmorris
Posts: 770
Joined: Wed Feb 11, 2009 12:18 pm
Location: oxfordshire uk
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by sirmorris » Fri Jun 14, 2019 6:10 am

If you need a spectrum edge connector I can sort you out.

MadeGray
Posts: 52
Joined: Wed Dec 27, 2017 4:44 pm
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by MadeGray » Fri Jun 14, 2019 3:10 pm

Glad everything was cleared with Tim (retrobrew) I’ve just ordered a couple (very nice chap by the way with his response to the order) I’ve no connection but does seem a good chap if he’s supply these literally at cost and as said glad cleared up with Hoglet.

Im aiming to practice my surface mount skills on these and CPLD programming etc as it encompasses all those elements.

Thanks everyone. I’m sure I’ll have plenty of questions!

John
John Gray

BBC Master x2 with BeebSCSI, PI copro etc and lots of Goteks. A few Model B’s and a trusty Elk. Won’t mention the ZX80 and ZX81!

User avatar
Elminster
Posts: 3446
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by Elminster » Fri Jun 14, 2019 6:24 pm

For anyone going to Cambridge, if I remember to take them, I may have some spare boards to give out.

JonC
Posts: 722
Joined: Wed May 14, 2014 9:19 pm
Location: Wakefield
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by JonC » Fri Jun 14, 2019 9:10 pm

If anyone decides to do a run of built boards, I'd be interested. Regrettably the soldering level required is beyond my skill level. :D
Jon
Image

tynemouthsoftware
Posts: 2
Joined: Tue Jun 18, 2019 10:24 am
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by tynemouthsoftware » Tue Jun 18, 2019 10:43 am

Looks an interesting project, I will have to build one.

I've not looked in detail at the code (yet), but I wonder, is there any point where a whole frame of video is held where it could be exported to an image file? I ask this as I am never very good at taking screenshots from a monitor with a camera, which I often need to do to illustrate my blog posts. It would be quite handy if one of the buttons (or an extra one) could be configured to save a screenshot image of the current frame, either to the SD card, or a USB drive maybe?

I appreciate this might cause the output to drop frames whilst processing that, but maybe whiting out the screen would be a good indication it had taken a picture anyway?

Thanks,

Dave

User avatar
hoglet
Posts: 8212
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by hoglet » Tue Jun 18, 2019 10:57 am

tynemouthsoftware wrote:
Tue Jun 18, 2019 10:43 am
I've not looked in detail at the code (yet), but I wonder, is there any point where a whole frame of video is held where it could be exported to an image file? I ask this as I am never very good at taking screenshots from a monitor with a camera, which I often need to do to illustrate my blog posts. It would be quite handy if one of the buttons (or an extra one) could be configured to save a screenshot image of the current frame, either to the SD card, or a USB drive maybe?
That feature was added to the dev branch about two months ago.

It works pretty well, and writes a PNG file to the SD card.

Here's an example from an Atom:
capture12.png
Here's a second example, posted earlier by Ian from a PC:
vga640x480.png
There is a pre-release available containing this code here:
https://github.com/hoglet67/RGBtoHDMI/r ... 10_49320d4

(the title suggests this is an Atom Specific release, that's actually not the case)

Dave
Last edited by hoglet on Tue Jun 18, 2019 11:06 am, edited 2 times in total.

tynemouthsoftware
Posts: 2
Joined: Tue Jun 18, 2019 10:24 am
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by tynemouthsoftware » Tue Jun 18, 2019 11:05 am

Great, thank you. I'll check out that branch.

Dave

User avatar
hoglet
Posts: 8212
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by hoglet » Tue Jun 18, 2019 11:07 am

tynemouthsoftware wrote:
Tue Jun 18, 2019 11:05 am
Great, thank you. I'll check out that branch.
I just added a couple of examples to the post above.

User avatar
SimonSideburns
Posts: 342
Joined: Mon Aug 26, 2013 8:09 pm
Location: Purbrook, Hampshire
Contact:

Re: RGB to HDMI using a Pi Zero and a small CPLD

Post by SimonSideburns » Tue Jun 18, 2019 7:01 pm

I don't know what it is about Windows 3.1x but seeing the Program Manager like this brings back many memories of when I used to use Windows back in the day. Everything was much simpler back then.
I'm writing a game where you can change your character from a Wizard to a monkey to a cat.

Well, Imogen that!

Post Reply