RGB to HDMI using a Pi Zero and a small CPLD

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
aotta
Posts: 197
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

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

Post by aotta » Fri Jul 12, 2019 3:13 pm

i'd like to test the last Dev release, but i haven't a system ready to compile it.. may it be uploaded here or in the github repository?


aotta
Posts: 197
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

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

Post by aotta » Fri Jul 12, 2019 3:59 pm

Elminster wrote:
Fri Jul 12, 2019 3:54 pm
The versions I used are all in github

Firmware
https://github.com/hoglet67/RGBtoHDMI/r ... 10_49320d4

CPLD
https://github.com/hoglet67/RGBtoHDMI/b ... toHDMI.jed
Yes, but i'm looking for the "may 2019" version for Beeb, not Atom... is in the Dev branch but only the source code, i think

User avatar
hoglet
Posts: 8859
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 » Fri Jul 12, 2019 4:02 pm

aotta wrote:
Fri Jul 12, 2019 3:59 pm
Yes, but i'm looking for the "may 2019" version for Beeb, not Atom... is in the Dev branch but only the source code, i think
The Pi Software is the same for the Atom and Beeb boards, only the CPLD is different.

So the Pi Firmware release link Duncan posted is the correct one:
https://github.com/hoglet67/RGBtoHDMI/r ... 10_49320d4

Note, there are been a couple of changes to dev since this, but I'm not really ready to make a new release.
Last edited by hoglet on Fri Jul 12, 2019 4:03 pm, edited 1 time in total.

aotta
Posts: 197
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

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

Post by aotta » Fri Jul 12, 2019 4:08 pm

Thank you Hoglet, i missed the PI firmware was the same!

User avatar
hoglet
Posts: 8859
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 » Fri Jul 12, 2019 4:17 pm

aotta wrote:
Fri Jul 12, 2019 4:08 pm
Thank you Hoglet, i missed the PI firmware was the same!
The CPLD contains a 12-bit identifier that is read by the Pi Software on boot:
<design><major version><minor version>

The <design> part is different for the Atom and Beeb CPLD designs.

That's how it is then able to load a board specific driver, which gives different options on the sampling menu.

Dave

User avatar
IanB
Posts: 431
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 Jul 12, 2019 6:29 pm

Elminster wrote:
Thu Jul 11, 2019 9:38 pm
Issue 3 - auto resolution seemingly picks wrong resolution
Auto resolution is necessary to ensure that a picture is visible on the monitor on first startup but it isn't very useful for actually using it with a BBC / Electron or any other 50Hz based source.

The Auto setting ensures that the Pi selects the optimal resolution for the monitor as read from the EDID info and normally this is the native resolution of the LCD panel although with your monitor that doesn't seem to be the case. However it will almost always select a 60Hz mode as that is the default refesh rate for all monitors and that guarantees that you will get an image on the screen in order to adjust the menus especially with older 4:3 LCDs with DVI inputs.

In order to get a 50Hz output so that genlocking will work and there will be no tearing or frame delay, you have to manually select the appropriate 50Hz resolution from the menu. In some cases, especially with older DVI monitors you will get no display at 50Hz so you can only use 60Hz refresh on such monitors with the resulting issues mentioned above. If you have mismatched input and output refresh rates there will be a warning near the top of the menu to remind you of that.

If you have a monitor that won't display 50Hz after changing the menu and rebooting, you can force it back to Auto and get the OSD back by holding any two of the three menu buttons down during power up.

At the moment we are relying on the Pi boot code to do the Auto selection. It might be possible to implement an Auto 50Hz option but that can't be the default as it would mean no output at all on some monitors with no easy way to bypass it.

Auto mode is useful for the Atom version of the board as the Atom has a 60Hz output.

Perhaps the option should be changed to "Auto 60Hz"
Last edited by IanB on Fri Jul 12, 2019 7:10 pm, edited 2 times in total.

User avatar
Elminster
Posts: 3979
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 Jul 12, 2019 8:19 pm

Yep, it is all good. As long as that goes in the update instructions I am sure it be fine. The irony is I has I fixed at the correct mode for nearly all my testing, but I think just before I reflashed the CPLD to fix issue 2b, I changed it back to default. if I hadn't then issue 3 would have never happened. But a least I can go in the gotchas on the wiki page now.

jasonl
Posts: 41
Joined: Wed Mar 27, 2019 9:22 am
Contact:

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

Post by jasonl » Fri Jul 19, 2019 6:46 pm

I'd like to report success with my build of this made using one of Tim/retrobrewcomputing's PCBs. It was all hand-soldered, and I had to reflow solder on the CPLD a few times to remove solder bridges between pins. But got there in the end, and fortunately didn't burn anything. Had more trouble trying to locate and install the Xilinx software to flash the CPLD - the software included with the Chinese DLC9G seemed to only want Windows XP. Got something working on my Ubuntu laptop eventually... more luck than judgment I think.

I designed and 3d printed a small case for it - it uses some clear filament to act as light pipes for the LEDs - quite effective:
rgbtohdmi2.jpg
There's a hole in the bottom to allow access to the microSD card to retrieve the screen captures - with the help of some scotch tape stuck to it to pull it out. The case clamps the RGB cable which is also held in place with a cabletie.
rgbtohdmi3.jpg
I can post the STL and Fusion360 files if anyone would find them useful.

The RGBtoHDMI adapter has been working well with both my Model B and Master128 - really quick to start up, and the easy way to make screen caps is really nice.
capture16.png
Thanks guys! =D>

User avatar
hoglet
Posts: 8859
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 » Fri Jul 19, 2019 7:00 pm

jasonl wrote:
Fri Jul 19, 2019 6:46 pm
I designed and 3d printed a small case for it - it uses some clear filament to act as light pipes for the LEDs - quite effective:
That's a neat case, very nice to see some of these end up in boxes.

Dave

aotta
Posts: 197
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

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

Post by aotta » Sat Jul 20, 2019 1:59 pm

very nice works Jasonl! and you was lucky you didn't burn nothing, yesteday i worked for a second one, and fried 3 xilinx and 1 pi zero!! :cry: :cry:
how did you find the bridge between cpld pins, with a multimeter? it seemed all ok to me.... before xilinx started smoking! :lol:

I hope Hoglet or someone else will design a PLCC version of the board one day!! [-o<

User avatar
hoglet
Posts: 8859
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 » Sat Jul 20, 2019 2:17 pm

aotta wrote:
Sat Jul 20, 2019 1:59 pm
I hope Hoglet or someone else will design a PLCC version of the board one day!! [-o<
The PLCC version of the XC9572XL is, unfortunaly, no longer available.

Question for the folk that are struggling to solder the CPLD: what technique are you using to solder it? The recommened method is called "drag soldering", and involves a reasonable large sized bit and lots and lots of flux. If you are trying to solder each indiviual pin, one at a time, then that's the wrong technique. There are some good videos on youtube on drag soldering. But I can't overstate how important it is to use lots of flux and a large bit!

Dave
Last edited by hoglet on Sat Jul 20, 2019 2:18 pm, edited 1 time in total.

aotta
Posts: 197
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

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

Post by aotta » Sat Jul 20, 2019 2:25 pm

hoglet wrote:
Sat Jul 20, 2019 2:17 pm
aotta wrote:
Sat Jul 20, 2019 1:59 pm
I hope Hoglet or someone else will design a PLCC version of the board one day!! [-o<
The PLCC version of the XC9572XL is, unfortunaly, no longer available.
i didn't know... anyway, if you launch a search on ebay, a lot of plcc version are still on the market..

yesterday i used the large "cone cutted" tin i bought for my iron, but i made the disaster i wrote.
Waiting for new xilinx for further test.. while playing with the only RGBtoHDMI working board i got 'til now

User avatar
trixster
Posts: 968
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 » Sat Jul 20, 2019 5:10 pm

Just catching up with the thread, I’ve put the latest firmware onto my Atom (with cpld Atom v2.1) and the picture is amazing! Well done, it’s incredible.

However, I’ve just tried the same firmware on my Master (with cpld version 1) and I cannot get a good picture at all.
CADD55B9-9678-481E-9F1F-90BAF9DE0BD8.jpeg
B21BE5E7-90C0-4AD5-877A-F1EA4294F061.jpeg
Do I need an updated cpld?
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
hoglet
Posts: 8859
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 » Sat Jul 20, 2019 5:34 pm

trixster wrote:
Sat Jul 20, 2019 5:10 pm
Do I need an updated cpld?
The profiles are all setup for the latest CPLD, which allows a wider range of horizontal movement.

If you can't update then you should be able to get a decent picture by setting Geometry/H Capture Offset to 0.

Then put up some mode 7 content, like the STH Menu, and press/hold SW3 to do an Auto Calibration, then in the menu, select the Save Configuration option.

Dave
Last edited by hoglet on Sat Jul 20, 2019 5:43 pm, edited 1 time in total.

jasonl
Posts: 41
Joined: Wed Mar 27, 2019 9:22 am
Contact:

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

Post by jasonl » Sat Jul 20, 2019 5:47 pm

aotta wrote:
Sat Jul 20, 2019 1:59 pm
very nice works Jasonl! and you was lucky you didn't burn nothing, yesteday i worked for a second one, and fried 3 xilinx and 1 pi zero!! :cry: :cry:
how did you find the bridge between cpld pins, with a multimeter? it seemed all ok to me.... before xilinx started smoking! :lol:

I hope Hoglet or someone else will design a PLCC version of the board one day!! [-o<
Inspected with a jewellers loupe and good light. :) Beginners luck I suspect. Fortunately it didn't blow up with power applied, but I got text with vertical magenta lines through it, so the pins bridged weren't the power/gnd pins. I did buy two CPLDs just in case I blew one up but got lucky with this one. Used loads of flux, too, and tried the drag-soldering technique, but I think my soldering iron tip is a little too fine for it, and got some bridges. Made sure there weren't any shorts between power and ground before powering up, though.
Last edited by jasonl on Sat Jul 20, 2019 5:49 pm, edited 1 time in total.

User avatar
Elminster
Posts: 3979
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 » Sat Jul 20, 2019 6:01 pm

hoglet wrote:
Sat Jul 20, 2019 2:17 pm
aotta wrote:
Sat Jul 20, 2019 1:59 pm
I hope Hoglet or someone else will design a PLCC version of the board one day!! [-o<
The PLCC version of the XC9572XL is, unfortunaly, no longer available.

Question for the folk that are struggling to solder the CPLD: what technique are you using to solder it? The recommened method is called "drag soldering", and involves a reasonable large sized bit and lots and lots of flux. If you are trying to solder each indiviual pin, one at a time, then that's the wrong technique. There are some good videos on youtube on drag soldering. But I can't overstate how important it is to use lots of flux and a large bit!

Dave
Agreed, when I did my first one doing a pin at a time took forever, dragging you can knock one out in less than 10
Mins and get less issues. I did about 4 in an hour at abug and I am not fast. And don’t worry if it bridges, just throw on more flux, clean tip and drag again. If still have issue just wick off with desolder braid.

Then visual inspection with mag lens. Either test all pins or just the ones that look dodgy (hopefully none) with multimeter.
Last edited by Elminster on Sat Jul 20, 2019 6:03 pm, edited 1 time in total.

User avatar
trixster
Posts: 968
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 » Sat Jul 20, 2019 6:51 pm

That did the trick, Dave, thanks :)
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
billcarr2005
Posts: 1433
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

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

Post by billcarr2005 » Sat Jul 20, 2019 8:31 pm

I'm terrible at soldering... is there a chance that a fully assembled, ready to plug in version will be available to purchase any time soon? [-o<

cmorley
Posts: 1143
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford
Contact:

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

Post by cmorley » Sat Jul 20, 2019 9:00 pm

billcarr2005 wrote:
Sat Jul 20, 2019 8:31 pm
I'm terrible at soldering... is there a chance that a fully assembled, ready to plug in version will be available to purchase any time soon? [-o<
I did briefly talk to Dave about this at the last Hampshire ABUG - either assembling some or doing a cost reduced version with a MAX V... but IIRC we never finished the discussion...

User avatar
hoglet
Posts: 8859
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 » Sun Jul 21, 2019 6:31 am

cmorley wrote:
Sat Jul 20, 2019 9:00 pm
I did briefly talk to Dave about this at the last Hampshire ABUG - either assembling some or doing a cost reduced version with a MAX V... but IIRC we never finished the discussion...
If someone on the forum wanted to assemble and sell a batch of these, that would be great and I would be very pleased indeed. I'm not really set up for mass production.

The painful part is actually making up the cable.

Regarding a cost reduced version with a different CPLD, that's completely up to you. Personally I don't see the point, as the XC9572XL is only £3.03+VAT (in one-off quantities). It's 5V tolerant, allowing it to act as a level shifter as well. It's also much faster in practice than the timing analysys suggests (more than twice as fast), which gives it a very narrow sampling window.

I've been talking with Ian over the last few months about a revision to the board.
- use a different connector for the video which is more "box friendly"
- better support for non-Beeb systems
- allow for the Pi to reprogram the CPLD so a programmer isn't needed for CPLD updates (not that any more are actually planned)

The latter requires four extra wires and some additional software (which is now working):
59751129-e60ebd80-9277-11e9-9b18-410ca0613d36.jpg
There's a thread for the updated PCB design on github. It's a bit stalled at the moment, because as always there are compromises*, and my attention has been elsewhere for the last month (Visual Z80). Also, for Beeb/Elk only use, there's actually nothing much wrong with the current design.

Dave

* For example, with the Pi based CPLD programming, all the JTAG signals are shared, meaning that if you program the wrong CPLD design in (for example, the CPLD for the Atom adapter) the board can be seriously bricked. I deliberately tried this, and had to desolder two of the wires to be able recover it with a CPLD programmer.
Last edited by hoglet on Sun Jul 21, 2019 6:42 am, edited 6 times in total.

User avatar
Elminster
Posts: 3979
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 Jul 21, 2019 8:34 am

Probably good (idea) for beginners to not have to buy a program(mer) if all they want is a single beebrgb.

I might have a go at that. I have another Beebrgb to sort where I solder the last component, the pi connector, the wrong way round. Don’t solder when tired.... :)
Last edited by Elminster on Sun Jul 21, 2019 3:39 pm, edited 1 time in total.

aotta
Posts: 197
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

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

Post by aotta » Sun Jul 21, 2019 12:35 pm

Buy additional software? I think the sw about Dave is talking is a different version of vhld..
About soldering error, I discovered, after one od my best cpld's mounting... It was flipped in the wrong way!
Never rotate the pcb when soldering square ic! 😜

User avatar
Elminster
Posts: 3979
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 Jul 21, 2019 3:38 pm

aotta wrote:
Sun Jul 21, 2019 12:35 pm
Buy additional software? I think the sw about Dave is talking is a different version of vhld..
About soldering error, I discovered, after one od my best cpld's mounting... It was flipped in the wrong way!
Never rotate the pcb when soldering square ic! 😜
Not software, hardware. The programmer.

Currently you need to buy a Xlinix programmer, the pi programming method makes that not required.
Last edited by Elminster on Sun Jul 21, 2019 3:39 pm, edited 1 time in total.

User avatar
Elminster
Posts: 3979
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 Jul 26, 2019 7:56 pm

hoglet wrote:
Sun Jul 21, 2019 6:31 am
The latter requires four extra wires and some additional software (which is now working):
59751129-e60ebd80-9277-11e9-9b18-410ca0613d36.jpg

There's a thread for the updated PCB design on github. It's a bit stalled at the moment, because as always there are compromises*, and my attention has been elsewhere for the last month (Visual Z80). Also, for Beeb/Elk only use, there's actually nothing much wrong with the current design.

Dave

* For example, with the Pi based CPLD programming, all the JTAG signals are shared, meaning that if you program the wrong CPLD design in (for example, the CPLD for the Atom adapter) the board can be seriously bricked. I deliberately tried this, and had to desolder two of the wires to be able recover it with a CPLD programmer.
So that looks like:

38 GPIO20 -> TCK
28 GPIO1 -> TMS
27 GPIO0 -> TDI
18 GPIO24 -> TDO

User avatar
hoglet
Posts: 8859
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 » Fri Jul 26, 2019 8:10 pm

Elminster wrote:
Fri Jul 26, 2019 7:56 pm
So that looks like:
38 GPIO20 -> TCK
28 GPIO1 -> TMS
27 GPIO0 -> TDI
18 GPIO24 -> TDO
That looks correct. You can see them in the defs.h file:
https://github.com/hoglet67/RGBtoHDMI/b ... efs.h#L194

User avatar
Elminster
Posts: 3979
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 » Sat Jul 27, 2019 12:00 am

I am assuming you can make this hardware change, and even if you don’t put on new software it will still work as before, or is this a one way change?

Built and programmed my last RGBHDMI this evening, has a few jumper wires on it to repair a track after the rip connector was soldered on backwards (pixies did it). Working fine, but don’t mind putting a few more wires on it for testing purposes.

User avatar
hoglet
Posts: 8859
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 » Sat Jul 27, 2019 6:13 am

Elminster wrote:
Sat Jul 27, 2019 12:00 am
I am assuming you can make this hardware change, and even if you don’t put on new software it will still work as before, or is this a one way change?
Yes, that's correct, the old software should work fine.

Dave

Methanoid
Posts: 11
Joined: Wed Jul 04, 2018 12:18 pm
Contact:

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

Post by Methanoid » Fri Aug 02, 2019 8:21 pm

TLDR is this possible to buy and if so, where, please... I know.. but its a long thread!!!

User avatar
Elminster
Posts: 3979
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 » Mon Aug 05, 2019 6:49 am

Methanoid wrote:
Fri Aug 02, 2019 8:21 pm
TLDR is this possible to buy and if so, where, please... I know.. but its a long thread!!!
I gave away all my spare boards at last ABUG. Danielj did have some but probably offloaded them by now.

Post Reply