RGB to HDMI using a Pi Zero and a small CPLD

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
hoglet
Posts: 8533
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 Mar 17, 2019 5:39 pm

aotta wrote:
Sun Mar 17, 2019 1:12 am
i just burned my third xl9572.. i ordered new one but i am afraid my soldering iron isn't small enough for this little smd ics.. is some RGBtoHDMI board for selling somewhere?
I'm not sure I understand what you mean by "i just burned my third xl9572".

Do you mean you damaged it trying to solder it in? Or there were shorts that destroyed it? Maybe posting a photo would help us understand and offer better advice.

As far as I'm aware, no one is making fully assembled RGBtoHDMI boards yet.

Dave
Last edited by hoglet on Sun Mar 17, 2019 5:39 pm, edited 1 time in total.

User avatar
hoglet
Posts: 8533
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 Mar 17, 2019 6:06 pm

trixster wrote:
Sun Mar 17, 2019 4:13 pm
Do you think rgbtohdmi will ever support the extra features offered by Rob’s VideoNula?
That's an interesting question... Ian has come a long way down this path with the palette work he's been doing, with some fairly impressive results if you look earlier in this thread:
viewtopic.php?p=229621#p229621

But the programming model is different to Video NuLA (the Palette obviously can't be directly memory mapped at &FE2x, like it is with VideoNuLA). What this means is the all of the great work Rob has been doing (Spectrum emulator, Amstrad CPC emulator, Doom, etc) is not going to "just work".

One way to address this might be to design a new Palette API (that games could use) with separate Video NuLA and RGBtoHDMI implementations. I think this is feasible, but as far as I know, no one is working on it currently.

I should also say, there is much development work (both myself and Ian) happening on RGBtoHDMI (in the dev branch), but we are some way off this being ready for release.

This includes:
- Palette control with in-band data
- Increased capture depth (6 bits/pixel, rather than 3 bits/pixel)
- Increased capture rate
- Sync polarity detection
- UI now usable with lower resolution frame buffers
- A new configuration file format that supports multiple machine profiles in separate files (these replace the horrible cmdline.txt file format)
- Persisting the current calibration to the SD Card
- Screen capture (in PNG format) directly to the SD Card

Some of these features (like the increases capture depth) will require the CPLD to be updated, but we are trying hard to ensure as much as possible still works with all previous CPLD releases.

Dave

aotta
Posts: 179
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 Mar 17, 2019 6:07 pm

hoglet wrote:
Sun Mar 17, 2019 5:39 pm

Do you mean you damaged it trying to solder it in? Or there were shorts that destroyed it? Maybe posting a photo would help us understand and offer better advice.
I probably made some short in soldering, and burned IC (literaly... with red lamps and smoke!) when power on the BBC and flashing with xilink...

Waiting for new IC, and next time i'll start another PCB from scratch (i have components for one or two).
Thanks Hoglet for support, and my compliments for your great work!

User avatar
hoglet
Posts: 8533
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 Mar 17, 2019 7:02 pm

aotta wrote:
Sun Mar 17, 2019 6:07 pm
I probably made some short in soldering, and burned IC (literaly... with red lamps and smoke!) when power on the BBC and flashing with xilink...
I had not done any surface mount soldering before this project. The technique to research is called drag soldering.

Here are a couple of video of it being done perfectly:
https://www.youtube.com/watch?v=nyele3CIs-U
https://www.youtube.com/watch?v=wUyetZ5RtPs

The correct soldering iron bit looks like this:
__1.jpg
__1.jpg (5.78 KiB) Viewed 1483 times
It's huge compared to the pins, but that doesn't matter. Don't try to solder each pin individually. And don't use a fine pointed bit.

There are three secrets to getting this right:
- first, make sure the device is perfectly placed before tacking down (I use blu-tac initially)
- second, use lots of extra flux. It works like magic
- third, carefully inspect for shorts (especially at the ends) in good light with some sort of magnification

The CPLD has 0.8mm lead spacing, which is actually not too bad. You can get devices with 0.5mm spacing, but even these are doable with a bit of patience.
aotta wrote:
Sun Mar 17, 2019 6:07 pm
Thanks Hoglet for support, and my compliments for your great work!
Much appreciated (and also IanB has also been working on this as well).

Dave
Last edited by hoglet on Sun Mar 17, 2019 7:04 pm, edited 1 time in total.

aotta
Posts: 179
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 » Mon Mar 18, 2019 6:47 am

hoglet wrote:
Sun Mar 17, 2019 7:02 pm

The correct soldering iron bit looks like this:
__1.jpg

It's huge compared to the pins, but that doesn't matter. Don't try to solder each pin individually. And don't use a fine pointed bit.

Dave
Ordered a soldering spade tip.. Thank you!

aotta
Posts: 179
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 Mar 22, 2019 9:47 pm

Waiting new soldering tip, made new try and burned another xilinx... but some progress this time! i flashed the cpld and seen an acorn bbc on screen and the menu on screen for a few second, before smoke started! :roll: :lol:

But I have a question about link p6, i didn't find the explanation on the wiki: it must be open or closed?

User avatar
hoglet
Posts: 8533
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 Mar 22, 2019 9:53 pm

aotta wrote:
Fri Mar 22, 2019 9:47 pm
Waiting new soldering tip, made new try and burned another xilinx... but some progress this time! i flashed the cpld and seen an acorn bbc on screen and the menu on screen for a few second, before smoke started! :roll: :lol:
Can you possibly post a picture of the soldering? Usually solder bridges are pretty obvious. I wonder if something else is going on here, like somehow you are powering the CPLD from 5V rather than 3.3V.
aotta wrote:
Fri Mar 22, 2019 9:47 pm
But I have a question about link p6, i didn't find the explanation on the wiki: it must be open or closed?
It's unused in the current stable release of the software, so just leave it open.

Dave

aotta
Posts: 179
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 Mar 22, 2019 10:30 pm

Thank you Dave for the support.. that's a pic of board (with burned xc9572xl): do you notice some mistakes?
RGB2HDMI.jpg

User avatar
danielj
Posts: 7500
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

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

Post by danielj » Fri Mar 22, 2019 10:58 pm

I see a bridge between the pins under c6...

JonC
Posts: 726
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 Mar 22, 2019 11:07 pm

And possibly on the two pins next to U1, it's a bit blurred so hard to tell.
Jon
Image

Ramtop
Posts: 135
Joined: Tue Oct 23, 2018 12:40 pm
Contact:

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

Post by Ramtop » Sat Mar 23, 2019 12:00 am

I'm not sure how many of those little 44-pin Xilinx CPLDs I've soldered, but it's certainly more than 100 of them at this point.

Dave's advice is good. Position the device carefully, really carefully. Use magnification if your eyes are (like mine) less than perfect.

Flux is critical. Good flux makes a huge difference; I use MG Chemicals liquid flux, but the AMTECH tacky stuff is good as well. Drag or tap soldering a fine pitch QFP chip is so much easier when the solder flows well. Don't stint on the flux, use loads and loads if necessary.

Some kind of magnification is a godsend when checking for bridges. A microscope isn't necessary, a cheap magnifying lamp from Ebay - the kind that nail technicians use - is fine for 0.8mm chips.

Oh, and make sure the chip is oriented correctly. Sounds silly, but it's really easy to do. I killed an XC9536XL stone dead last weekend because I was tired and soldered it in the wrong way round :oops:

Not really relevant here, but there's also one thing I've found that PCB designers can do to help with surface mount hand soldering; longer pads. The chip footprints in PCB layout software are designed for machine assembly, so the pads are only just big enough and no more. Double or triple the length of the pad and it makes soldering without bridges so, so much easier because any excess solder has somewhere harmless to go. I adopted this practice after seeing a training PCB that was designed for use in a soldering class, it had extra long pads for all the SMD chips. The image below shows how I do my PCBs now (the CPLD isn't soldered, it's the one I killed included for scale).
Attachments
cpld_pads.jpg
Gary

aotta
Posts: 179
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 Mar 23, 2019 12:25 am

the photo was taken after some soldering pass on the xl9572 and there was a bridge, but it's not that the failure.

I found that the pins that go short are the two connected to C5, but only after a few seconds the boad is powered!
Then, after cooled and disconnected, the shorts disappear...
May be the xilinx is damaged? i've no more IC to test... :roll:

User avatar
myelin
Posts: 726
Joined: Tue Apr 26, 2016 9:17 pm
Location: Mountain View, CA, USA
Contact:

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

Post by myelin » Sat Mar 23, 2019 3:09 am

Not really relevant to the case where you’re just making one board, but if you’re doing more than one (or it’s a board with a ton of pins, or any BGA or QFN parts) using a stencil and a hot plate for soldering is much much easier than doing it by hand, and far less failure prone — you’ll always get the right amount of solder. JLC will do stencils with a PCB order for $8, so they’re quite affordable too :)
SW/EE from New Zealand, now in Mountain View, CA, making BBC/Electron hardware projects for fun.
Most interesting: Arcflash, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

User avatar
IanB
Posts: 389
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 » Wed Apr 03, 2019 6:04 pm

I just figured out a way to test how much lag there is with this converter:
I connected a HDMI to VGA converter lead to the HDMI output and then wrote a program to flash the screen briefly.
The VGA converter lead is just a simple D to A converter and doesn't introduce much delay itself.
I then looked at one of the RGB inputs (from the computer) and one of the RGB outputs from the HDMI to VGA lead on a scope and it shows the total delay is 2.4 milliseconds:
Converter Lag.png
(Yellow is the computer RGB source, Cyan is the output of the converter)
If I switched on multiple buffering, the delay went up by 20ms for each buffer as expected.

User avatar
hoglet
Posts: 8533
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 » Wed Apr 03, 2019 6:09 pm

Wow, that's spectacularly good. I'm rather amazed that it's so low.

If you change the vsync line, does that directly alter the latency by the same amount?
Last edited by hoglet on Wed Apr 03, 2019 6:10 pm, edited 1 time in total.

User avatar
IanB
Posts: 389
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 » Wed Apr 03, 2019 6:17 pm

hoglet wrote:
Wed Apr 03, 2019 6:09 pm
If you change the vsync line, does that directly alter the latency by the same amount?
Yes the delay goes up as the vsync line goes down the screen.

User avatar
IanB
Posts: 389
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 » Wed Apr 03, 2019 6:30 pm

I started a thread on the vogons board for PC related applications of the converter if you want to follow that:

https://www.vogons.org/viewtopic.php?f=63&t=66194

User avatar
tricky
Posts: 3728
Joined: Tue Jun 21, 2011 8:25 am
Contact:

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

Post by tricky » Wed Apr 03, 2019 6:34 pm

That's great.
It feels like you could display a counter on the beeb and connect something via component and a display via HDMI and record the two with a 50hz+ camera to see how many frames/fields delay the TV adds and possibly adjust the vsync line to calculate the sub frame delay.

User avatar
Elminster
Posts: 3897
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 May 17, 2019 11:44 am

Thread has got huge now. Quick question did anyone every design any sort of 3d printed case for the Beeb version? The atom one fits in a project case and got me thinking to putting this in one.

aotta
Posts: 179
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 May 17, 2019 12:30 pm

Elminster wrote:
Fri May 17, 2019 11:44 am
Thread has got huge now. Quick question did anyone every design any sort of 3d printed case for the Beeb version? The atom one fits in a project case and got me thinking to putting this in one.
I think the standard PiZero case used IanB is perfect, look his post viewtopic.php?f=3&t=14430&p=225297

I copied his idea of course:
RGB2HDM_caseI.jpg
Last edited by aotta on Fri May 17, 2019 12:31 pm, edited 1 time in total.

User avatar
Elminster
Posts: 3897
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 May 17, 2019 12:57 pm

Ah yes, missed that post as I spent a month or 2 in the wilderness (figeratively).

Looks the same as this ebay item, except it is cheaper: Pi Case
Last edited by Elminster on Fri May 17, 2019 12:59 pm, edited 1 time in total.

aotta
Posts: 179
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 May 17, 2019 1:05 pm

Elminster wrote:
Fri May 17, 2019 12:57 pm
Ah yes, missed that post as I spent a month or 2 in the wilderness (figeratively).

Looks the same as this ebay item, except it is cheaper: Pi Case
yes, it's the one! youl'll have only to drill some holes for buttons and leds

User avatar
trixster
Posts: 925
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 » Fri May 17, 2019 1:33 pm

My two just run naked! :shock: maybe I should investigate casing them up
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
Elminster
Posts: 3897
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 May 17, 2019 1:34 pm

trixster wrote:
Fri May 17, 2019 1:33 pm
My two just run naked! :shock: maybe I should investigate casing them up
I have soo many things running naked I am afraid they will touch, get over excited, and explode.

User avatar
IanB
Posts: 389
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 May 17, 2019 2:56 pm

Elminster wrote:
Fri May 17, 2019 12:57 pm
Ah yes, missed that post as I spent a month or 2 in the wilderness (figeratively).
Looks the same as this ebay item, except it is cheaper: Pi Case
Yes, they are lots of listings for them at varying prices and quantities:
This is slightly cheaper again:
https://www.ebay.co.uk/itm/Protective-C ... 3487349305
2x works out at £3.60 compared to £3.89 above and 5x is £8.75 compared to £9.68 in my original link.

There is even a transparent option now but it's a bit more expensive (£2.80):
https://www.ebay.co.uk/itm/For-Raspberr ... 3402771283

transparent.jpg
aotta wrote:
Fri May 17, 2019 1:05 pm
yes, it's the one! youl'll have only to drill some holes for buttons and leds
Here is a drilling template pdf from kicad:
Drilling template.pdf
(12.11 KiB) Downloaded 16 times

Print and cut it out, push pinholes through the centre points and place face down on the inside of the case. It should just fit in the narrow direction with little or no slack but you will have to centre it in the long direction. The holes should be closest to the side with the hdmi and usb connectors and you should push the template towards that side if there is any slack as the board is mounted slightly off centre in the narrow direction. (You have to make pinholes because the printing is face down on the inside of the case.) As the cases are so cheap, it's worth getting an extra one in case of drilling mistakes.

Also these threaded metal standoffs are exactly the right size to support the board They screw directly into the plastic case and the screws supplied with the plastic case fit into the top of the standoffs to hold hoglet's board in place:

pillars.jpg

I only used two in the above as the 40 way header provides support on the other side but you could fit four of them.

The standoffs are Ettinger part no. 05.12.113 and they can be found here:
https://uk.farnell.com/ettinger/05-12-1 ... dp/2494583
and here:
https://cpc.farnell.com/ettinger/05-12- ... dp/PC01982
Last edited by IanB on Fri May 17, 2019 3:07 pm, edited 1 time in total.

User avatar
Elminster
Posts: 3897
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 May 17, 2019 5:59 pm

Thanks, I have a big box of stand offs, probably all the wrong size. Plan to expand from 1 to 3 RGB hdmi boards. And want to stick them out the way without damage them, these all should be ideal.

User avatar
Elminster
Posts: 3897
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 May 17, 2019 7:49 pm

Ordered 4 transparent cases, only need 3 but at that price and the fact it takes a while to come, I ordered a spare.

Also ordered 10 v4 boards from seeed.

My current RGBHDMI is from first batch Dave sent out so not sure which hardware revision that was.

I have a spreadsheet with all the bits for beeb hdmi, atom hdmi, atom noise killer and beeb FPGA, just waiting on me checking on what I already have and then ordering the missing bits. (FPGA itself is already in transit)

sparkyhall
Posts: 21
Joined: Sun Feb 17, 2019 8:29 pm
Contact:

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

Post by sparkyhall » Fri May 17, 2019 9:14 pm

Elminster wrote:
Fri May 17, 2019 7:49 pm

Also ordered 10 v4 boards from seeed.
If you have any spare bare boards I will buy one from you [-o<

Chris

User avatar
hoglet
Posts: 8533
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 May 17, 2019 9:35 pm

sparkyhall wrote:
Fri May 17, 2019 9:14 pm
If you have any spare bare boards I will buy one from you [-o<
DanielJ has a bunch of these boards as well I think.

Dave

sparkyhall
Posts: 21
Joined: Sun Feb 17, 2019 8:29 pm
Contact:

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

Post by sparkyhall » Sat May 18, 2019 4:02 pm

Thanks Dave, I'll send DanielJ a PM.

Chris

Post Reply