RGB to HDMI using a Pi Zero and a small CPLD

discuss both original and modern hardware for the bbc micro/electron
yellowdog77
Posts: 4
Joined: Thu Jun 03, 2021 12:50 pm
Contact:

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

Post by yellowdog77 »

I understand, thank you very much for the information.
User avatar
fordp
Posts: 1131
Joined: Sun Feb 12, 2012 9:08 pm
Location: Peterborough, England
Contact:

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

Post by fordp »

FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!
User avatar
hoglet
Posts: 10215
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

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

Post by hoglet »

Thanks for that link Simon.

Adrian does seem quite pleased with the end result....

I'm keeping track of the various video here:
https://github.com/hoglet67/RGBtoHDMI/w ... ube-Videos

Ian, did you have to give Adrian much help creating the profile?
User avatar
IanB
Posts: 751
Joined: Sun Sep 04, 2011 8:28 pm
Location: South Wales
Contact:

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

Post by IanB »

hoglet wrote:
Sat Jun 05, 2021 10:11 pm
Ian, did you have to give Adrian much help creating the profile?
No, he did that himself.
BTW the double pixel problem on the Mac output in integer scaling is a rounding error in the Pi's hardware scaler when using an odd numbered horizontal scaling value like x3 or x5. I found a workaround which fixed that by adding a 1 pixel overscan to the output resolution, see: https://github.com/hoglet67/RGBtoHDMI/c ... 54a3c51d90

Here's another one from Adrian using it with the Laser 128 + custom palette:
https://www.youtube.com/watch?v=DHooJIb4xeE
(Starts at about 15:30)

Retro Recipies installing a c0pperdragon Amiga board with Vampire board:
https://www.youtube.com/watch?v=Xz1_W0oKH14
There is a brief followup video demonstrating the solution I added to switch off the HDMI output when the Amiga displays a grey screen to allow the auto switching to work but it hasn't been made public yet.
User avatar
adriancblack
Posts: 19
Joined: Mon Jan 21, 2019 11:45 pm
Location: Portland, Oregon, USA
Contact:

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

Post by adriancblack »

Another video on using the C64 with RGB2HDMI (C0pperdragon as well) from Retro Hack Shack:
https://www.youtube.com/watch?v=oo_gWjK-gGw

But yeah the Mac worked out great! People seem to be pretty excited about it -- I think what might temper their excitement a little is the general unavailability of the hats at the moment. The Mac video is a bit old so I haven't had a chance to test Ian's fix yet.

I'll be doing the Apple IIc video next, comparing it to the Apple //C VGA adapter (FPGA based) ... spoiler alert: the RGB2HDMI blows that thing away and of course is cheaper and much more versatile. Ian's has been putting in a ton of work getting the latest releases working incredibly well with the IIc. (And this is using the digital connection, not over composite.)

I can't say how great this project is for the community!
User avatar
IanB
Posts: 751
Joined: Sun Sep 04, 2011 8:28 pm
Location: South Wales
Contact:

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

Post by IanB »

I've updated the wiki to document the changes over the last few months:
Wiki

Changes include:
Supported Computers
Quick Start Guide
Reference Guide
Cables
Gallery of Screencaps

I've also added a new section on measuring the lag using an oscilloscope and a HDMI to VGA converter:
Lag Measurement

Also Sam Coupe support was added recently which had an unusual 7 bit TTL output (2 bits each RGB + Intensity)
Here's a screencap of it running lemmings:
samcoupegame2.png
Lilwashu
Posts: 2
Joined: Mon Jun 07, 2021 2:30 pm
Contact:

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

Post by Lilwashu »

Does anyone know if it would be possible to get digital video out of an Apple II/II+/IIe (no external RGB port without unobtanium video card) by grabbing the signals from somewhere on the motherboard like the Amiga version?
yellowdog77
Posts: 4
Joined: Thu Jun 03, 2021 12:50 pm
Contact:

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

Post by yellowdog77 »

Dear IanB!

Hoglet said you're already involved in development, so I want to ask, you would do the 3x8 bit mode? If this is not possible, it would be good to have either 3x7 bit (2097152 colors) or 3x6 bit (262144 colors) mode.

Thank for your help!
User avatar
IanB
Posts: 751
Joined: Sun Sep 04, 2011 8:28 pm
Location: South Wales
Contact:

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

Post by IanB »

Lilwashu wrote:
Tue Jun 08, 2021 6:41 pm
Does anyone know if it would be possible to get digital video out of an Apple II/II+/IIe (no external RGB port without unobtanium video card) by grabbing the signals from somewhere on the motherboard like the Amiga version?
It should be possible but I haven't tested it.

You need to pick up the SYNC, GR, SEROUT, GND and +5v signals which are available internally on the 80 column expansion connector in the IIe (not sure about the II or II+) and use the Apple IIc TTL profile as they are the same signals as the connector on the IIc.

The quality will be identical to using the analog version connected to the composite output except that the 4 lines of text in mixed modes will stay white and not have any artifacts.

See the Apple IIc connection in the Cables section and the Gallery of Screencaps for a comparison of TTL connection with composite connection.
User avatar
IanB
Posts: 751
Joined: Sun Sep 04, 2011 8:28 pm
Location: South Wales
Contact:

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

Post by IanB »

yellowdog77 wrote:
Tue Jun 08, 2021 9:22 pm
Hoglet said you're already involved in development, so I want to ask, you would do the 3x8 bit mode? If this is not possible, it would be good to have either 3x7 bit (2097152 colors) or 3x6 bit (262144 colors) mode.
No, it isn't possible to increase the bit depth that much with the current design which has reached it's limits. It might be possible to increase to 5+6+5 bits for full 16 bits per pixel but even that would require a larger CPLD with more pins and a non trivial redesign so it would be probably be better to do a complete redesign from scratch using the camera input which would likely work at 24bpp and maybe support audio as well although I don't know what sort of lag such an arrangement would have. Such a redesign would require a much larger CPLD or FPGA which probably wouldn't fit in the footprint of the existing 'hat' pcb.
yellowdog77
Posts: 4
Joined: Thu Jun 03, 2021 12:50 pm
Contact:

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

Post by yellowdog77 »

Ok, thanks for your reply.
User avatar
aotta
Posts: 304
Joined: Fri May 26, 2017 9:57 am
Location: Italy
Contact:

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

Post by aotta »

IanB wrote:
Tue Jun 08, 2021 11:01 pm
Lilwashu wrote:
Tue Jun 08, 2021 6:41 pm
Does anyone know if it would be possible to get digital video out of an Apple II/II+/IIe (no external RGB port without unobtanium video card) by grabbing the signals from somewhere on the motherboard like the Amiga version?
It should be possible but I haven't tested it.

You need to pick up the SYNC, GR, SEROUT, GND and +5v signals which are available internally on the 80 column expansion connector in the IIe (not sure about the II or II+) and use the Apple IIc TTL profile as they are the same signals as the connector on the IIc.

The quality will be identical to using the analog version connected to the composite output except that the 4 lines of text in mixed modes will stay white and not have any artifacts.

See the Apple IIc connection in the Cables section and the Gallery of Screencaps for a comparison of TTL connection with composite connection.
I can confirm working on my IIe PAL (with PAL switch OFF).
Here's the pick-up point i used:
GR -> IOU pin 2
Sync -> IOU pin 39
SEROUT -> 166 pin 1
GND -> ROM pin 14
AppleIIe-pickup.jpg
AppleIIe-pickup2.jpg

and here are a couple of screenshots:
capture1.png
capture0.png
but i couldn't test the "Mixed mode" because... i haven't an integer language card and i'm not an Apple users... i don't know how to get the screen demo test.
User avatar
IanB
Posts: 751
Joined: Sun Sep 04, 2011 8:28 pm
Location: South Wales
Contact:

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

Post by IanB »

aotta wrote:
Thu Jun 10, 2021 9:54 am
but i couldn't test the "Mixed mode" because... i haven't an integer language card and i'm not an Apple users... i don't know how to get the screen demo test.
Thanks for testing this on a PAL IIe

It looks like you have already tested mixed mode as the "32MB" colour image has clean white text at the bottom so that must be using one of the mixed modes. That text would have coloured artifacts when using the composite output.
User avatar
aotta
Posts: 304
Joined: Fri May 26, 2017 9:57 am
Location: Italy
Contact:

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

Post by aotta »

IanB wrote:
Thu Jun 10, 2021 4:59 pm
aotta wrote:
Thu Jun 10, 2021 9:54 am
but i couldn't test the "Mixed mode" because... i haven't an integer language card and i'm not an Apple users... i don't know how to get the screen demo test.
Thanks for testing this on a PAL IIe

It looks like you have already tested mixed mode as the "32MB" colour image has clean white text at the bottom so that must be using one of the mixed modes. That text would have coloured artifacts when using the composite output.
Thank you Ian, and i think the GR command in basic it's for the "mixed mode" you're talking about:
capture4.png
of course, the RGBtoHDMI output with this TTL input is the same with PAL switch in ON or OFF position, but i had to change the ntsc phase to 270° to have the right colours:
capture3.png
Lilwashu
Posts: 2
Joined: Mon Jun 07, 2021 2:30 pm
Contact:

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

Post by Lilwashu »

aotta wrote:
Thu Jun 10, 2021 9:54 am
I can confirm working on my IIe PAL (with PAL switch OFF).
Here's the pick-up point i used:
GR -> IOU pin 2
Sync -> IOU pin 39
SEROUT -> 166 pin 1
GND -> ROM pin 14
AppleIIe-pickup.jpg
AppleIIe-pickup2.jpg

and here are a couple of screenshots:
capture1.png
capture0.png

but i couldn't test the "Mixed mode" because... i haven't an integer language card and i'm not an Apple users... i don't know how to get the screen demo test.
This is great, thanks - My IIe is also PAL so as soon as I get hold of a board I will give it a try.
User avatar
aotta
Posts: 304
Joined: Fri May 26, 2017 9:57 am
Location: Italy
Contact:

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

Post by aotta »

Lilwashu wrote:
Fri Jun 11, 2021 8:55 am

This is great, thanks - My IIe is also PAL so as soon as I get hold of a board I will give it a try.
Anyway, I found the pickup point on IIe schematics, I think they are the same for both pal and ntsc version
Post Reply

Return to “8-bit acorn hardware”