Author Topic: True HDMI for Tang Nano 9K  (Read 10038 times)

0 Members and 1 Guest are viewing this topic.

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
True HDMI for Tang Nano 9K
« on: October 20, 2022, 08:10:02 pm »
Hi All,

So my initial question:

Quote
I am wondering if some HDMI sink ports are more unequal than others....

So I am currently experimenting with a Gowin FPGA that streams video and audio over HDMI. Nothing fancy yet.... but some hdmi sinks work and others don't:

- Now on a regular Dell monitor Dell P2421 monitor no issues, perfect video over 1.5 meter of cable, no audio of course because the thing does not have speakers...
- On my older Samsung TV the HDMI ports are labeled "HDMI1" "HDMI/DVI". On the "HDMI/DVI" perfect video and audio however nothing when i plug into the "regular HDMI" connector.
- On my newer Samsung TV with HDMI ports 1 2 3 also no output, while it recognizes the hdmi is connected it will just tell check cables....

My device has only tdms channels connected, no DDC or CEC wires...

So what is the deal here?
  Is it electrical incompatibility
  Or because there's no EDID handshake over DDC?
  Or maybe because i doe not stream HDCP encrypted content?

UPDATE - 2023-1-1
Nope, turns out we need to populate R1, in order to provide +5v and activate the pullups for DDC and CEC. Thanks Andryblack: 

Check R1 on Tang Nano 9k board, after soldering this jumper (near HDMI connector) my Samsung TV recognize signal and show image.

Turns out that it was indeed electrical incompatibility:



Quote on page 3, paragraph 1 of PTN3366 data sheet:

Quote
2.1 High-speed TMDS level shifting
 Converts four lanes of low-swing AC-coupled differential input signals to DVI v1.0 and
HDMI v1.4b compliant open-drain current-steering differential output signals

Your gowin FPGA IOs cannot do that, and the series caps driving the outputs only makes things worse.

See the functional diagram on page 5, figure 2 of PTN3366 data sheet.

The gowin can only properly drive the series cap AC coupled DisplayPort digital video standard and some monitor inputs which may be wired to an HDMI connector may also be DisplayPort compatible for those input lines.  This may be the only reason some HDMI/DVI monitors can function with your circuit.

So in this post I created an initial schematic that is intended to be plugged in to the Tang Nano Boards and should deliver True - open drain - compatible HDMI output for use in general TV sets and so on.
See post below  https://www.eevblog.com/forum/fpga/fpga-to-hdmi-variants/msg4482196/#msg4482196 design files attached for thos willing to exploit the idea...

Updated:
V1.1 Schematics and the PCB file are included in the zip file.
Just upload in https://easyeda.com/
« Last Edit: January 01, 2023, 07:02:05 pm by hve »
 
The following users thanked this post: paf

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8175
  • Country: ca
    • LinkedIn
Re: FPGA to HDMI-variants
« Reply #1 on: October 20, 2022, 11:34:55 pm »
Use the 99cent LVTTL/LVDS->TMDS HDMI translator cable driver IC in the circuit posted here:
https://www.eevblog.com/forum/fpga/hdmi-dvi-encoder-with-audio-smart-quartus-pll-integration-in-systemverilog/

All other coding is up to you.  Note that some monitor inputs will only accept DVI mode and they will ignore a HDMI signal.  Make sure you can switch between the 2.

My LG flatron monitor is an example.  The HDMI input works with both DVI and HDMI TX standards, but, it also has a DVI input which will only understand DVI mode exclusively.
« Last Edit: October 21, 2022, 02:32:03 am by BrianHG »
 

Offline laugensalm

  • Regular Contributor
  • *
  • Posts: 130
  • Country: ch
Re: FPGA to HDMI-variants
« Reply #2 on: October 21, 2022, 08:59:33 am »
What's your resolution?

This could have many reasons, but you'll definitely get a compatibility gain when supporting EDID and proper video mode configuration, although classical video modes should work everywhere. I've come across a monitor (a no-name unit) that required an EDID readout sequence in order to start syncing.
HDCP is not an issue here. With high pixel clocks though, timing issues or IP core deficiencies can be exposed and some monitors may refuse to display, some would glitch, etc. These cases are hard to determine without a sink being able to debug lane skews and other HDMI issues, let aside really expensive GHz scopes able to spot signal issues.
 

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
Re: FPGA to HDMI-variants
« Reply #3 on: October 21, 2022, 09:56:55 am »
Hi Brian,

I am using this board: https://wiki.sipeed.com/hardware/en/tang/Tang-Nano-9K/Nano-9K.html.

HDMI driver schematic is below:

The CEC and DDC/I2C port are unused now, only pull-up to 5V 

I am suspecting that consumer electronic TV sets require the EDID / HDCP handshake via DDC or will fail to service the signal..
 

Offline mon2

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: ca
Re: FPGA to HDMI-variants
« Reply #4 on: October 21, 2022, 10:04:07 am »
 

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
Re: FPGA to HDMI-variants
« Reply #5 on: October 21, 2022, 10:24:09 am »
Hi Laugensalm,

I am aiming for 1280x720x60 which should be quite standard.

Connecting the laptop to the TV I can readout the supported modes:
Code: [Select]
// Modeline "Mode 4" 74.250 1280  1390       1420     1650   720   725        730      750 +hsync +vsync
//                   pclk   hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal

Using the Sameer hdmi code repo https://github.com/hdl-util/hdmi/:

Slightly changed the mode parameters in 'hdmi.sv':

Code: [Select]
        4:
        begin
            assign screen_width      = 1280;
            assign hsync_pulse_start = 110;
            assign hsync_pulse_size  = 30; // 40;
            assign frame_width       = 1650;

            assign screen_height     = 720;
            assign vsync_pulse_start = 5;
            assign vsync_pulse_size  = 5;
            assign frame_height      = 750;
            assign invert            = 0;
        end

Yes will need to perform EDID readout I think...
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8175
  • Country: ca
    • LinkedIn
Re: FPGA to HDMI-variants
« Reply #6 on: October 21, 2022, 10:31:02 am »

I am suspecting that consumer electronic TV sets require the EDID / HDCP handshake via DDC or will fail to service the signal..
That is only true if you HDCP encrypt your video.  I dont believe you are doing that as it requires an extensive license agreement.  I have not bothered with EDID yet and have not had any problems getting a picture to work fine.

Additionally, I'm sorry, but the board schematic you are showing does not have an authentic TMDS cable driver.  It is a 'Jerry rigged' together solution which cannot be guaranteed to drive a HDMI or DVI compliant  signal down any length of cable.

If you want a proper TMDS, transition-minimized differential signaling cable driving specification for HDMI & DVI, then the easiest solution when wiring to a FPGA's LVDS differential output pairs is to use this NXP IC:
https://www.nxp.com/docs/en/data-sheet/PTN3366.pdf

Unless your FPGA has a specific IO mode designed to drive a pulled-up 3.3v DC terminated end-point at the other end of the cable, use the NXP IC listed above which does support this HDMI/DVI weird standard driver for you.  Trying to pull off what you have shown in your supplied schematic, like the DC filter caps with the diode clamping will offer spotty support at best with many monitors.
« Last Edit: October 21, 2022, 10:49:30 am by BrianHG »
 

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
Re: FPGA to HDMI-variants
« Reply #7 on: October 21, 2022, 01:16:59 pm »

I am suspecting that consumer electronic TV sets require the EDID / HDCP handshake via DDC or will fail to service the signal..
That is only true if you HDCP encrypt your video.  I dont believe you are doing that as it requires an extensive license agreement.  I have not bothered with EDID yet and have not had any problems getting a picture to work fine.

Hmm I was hoping for an other answer, as some sort of an EDID handshake would be relatively easy to implement.
I will hook up the scope this weekend in order to see what signal is actually on the pins.

Thank you Brian!


 
 

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
Re: FPGA to HDMI-variants
« Reply #8 on: October 21, 2022, 01:26:52 pm »
Found this:
https://github.com/tmatsuya/i2c_edid
It is for the display end. Still maybe see to start of with proper matching...
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8175
  • Country: ca
    • LinkedIn
Re: FPGA to HDMI-variants
« Reply #9 on: October 21, 2022, 01:33:23 pm »
Quote on page 3, paragraph 1 of PTN3366 data sheet:

Quote
2.1 High-speed TMDS level shifting
 Converts four lanes of low-swing AC-coupled differential input signals to DVI v1.0 and
HDMI v1.4b compliant open-drain current-steering differential output signals

Your gowin FPGA IOs cannot do that, and the series caps driving the outputs only makes things worse.

See the functional diagram on page 5, figure 2 of PTN3366 data sheet.

The gowin can only properly drive the series cap AC coupled DisplayPort digital video standard and some monitor inputs which may be wired to an HDMI connector may also be DisplayPort compatible for those input lines.  This may be the only reason some HDMI/DVI monitors can function with your circuit.
« Last Edit: October 21, 2022, 01:37:39 pm by BrianHG »
 

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
Re: FPGA to HDMI-variants
« Reply #10 on: October 23, 2022, 07:20:36 pm »
Quote on page 3, paragraph 1 of PTN3366 data sheet:

Quote
2.1 High-speed TMDS level shifting
 Converts four lanes of low-swing AC-coupled differential input signals to DVI v1.0 and
HDMI v1.4b compliant open-drain current-steering differential output signals

Your gowin FPGA IOs cannot do that, and the series caps driving the outputs only makes things worse.

See the functional diagram on page 5, figure 2 of PTN3366 data sheet.

The gowin can only properly drive the series cap AC coupled DisplayPort digital video standard and some monitor inputs which may be wired to an HDMI connector may also be DisplayPort compatible for those input lines.  This may be the only reason some HDMI/DVI monitors can function with your circuit.

Totally right, I should have done my homework.
Lesson here is just because device has HDMI connector does not mean HDMI compatible.. Thanks Brian case solved.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9265
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: FPGA to HDMI-variants
« Reply #11 on: October 23, 2022, 10:17:50 pm »
Get one of those cheap HDMI repeaters to regen the signal.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 
The following users thanked this post: hve

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
Re: FPGA to HDMI-variants (solved)
« Reply #12 on: October 24, 2022, 08:08:21 pm »
Added a schematic of HDMI converter module for the Tang Board as suggested by Brian:

Comments are welcome...

Schematic:


3D view:


The JSON files for use with https://easyeda.com/ are included in the zip feel free to experiment...

Comments are welcome..

 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8175
  • Country: ca
    • LinkedIn
Re: True HDMI for Tang Nano 9K
« Reply #13 on: October 24, 2022, 08:21:55 pm »
Added a schematic of HDMI converter module for the Tang Board as suggested by Brian:

Comments are welcome...
     You also need to pass the 5v to the HDMI out connector. Some PC monitors use this to sense if the PC is powered on, IE should they go into deep sleep.  Others use it to auto-scan their multiple video inputs.

The HPD tells the PC/video out side if it should turn on the TMDS transmitter, otherwise it may not pass FCC as an open plug may be transmitting a 1.5GHz plus sub-band signals into open air.

I'm not sure who designed that Tang Nano 9K PCB, but, replacing the 2x diode protection ICs with the one NXP buffer would have cost less in the long run, offer true HDMI cable driving with it's own built in anti-static diode protection and offer true DDC I2C level shifting.
« Last Edit: October 24, 2022, 11:04:52 pm by BrianHG »
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8175
  • Country: ca
    • LinkedIn
Re: FPGA to HDMI-variants
« Reply #14 on: October 24, 2022, 08:31:03 pm »
Get one of those cheap HDMI repeaters to regen the signal.
I guess he decided to build one.
 

Offline tchicago

  • Regular Contributor
  • *
  • Posts: 115
  • Country: us
Re: True HDMI for Tang Nano 9K
« Reply #15 on: October 24, 2022, 08:55:16 pm »
Is there any more generic PTN3366 -> HDMI breakout board that can be used with other FPGAs boards? (Maybe supporting lower resolutions if there are signal integrity constraints with lower frequency connectors)

I saw there was one from nockieboy in this topic https://www.eevblog.com/forum/fpga/hdmi-dvi-encoder-with-audio-smart-quartus-pll-integration-in-systemverilog/  but it has no PCB file to get gerbers from. 
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8175
  • Country: ca
    • LinkedIn
Re: True HDMI for Tang Nano 9K
« Reply #16 on: October 24, 2022, 09:13:01 pm »
Is there any more generic PTN3366 -> HDMI breakout board that can be used with other FPGAs boards? (Maybe supporting lower resolutions if there are signal integrity constraints with lower frequency connectors)

I saw there was one from nockieboy in this topic https://www.eevblog.com/forum/fpga/hdmi-dvi-encoder-with-audio-smart-quartus-pll-integration-in-systemverilog/  but it has no PCB file to get gerbers from.
The PTN3366 works from 240p to 1080p.
Plenty of stock exists everywhere, EG:
https://www.mouser.com/ProductDetail/NXP-Semiconductors/PTN3366BSMP?qs=%252BRKXB2WKlSdBGKoajmQSNw%3D%3D
https://www.digikey.com/en/products/detail/nxp-usa-inc/PTN3366BSMP/5981060?s=N4IgTCBcDaIAoBUByBmFA2dIC6BfIA

It's easy to wire, left side in, right side out, straight wires...
And with Nockieboy's and my code, even with crummy board-board din connector and unbalanced wiring, we got a Cyclone IV with it's normal LVTTL outputs to go as far as 1440x960, or 1280x1024.  (This is way beyond Altera's advertised limits for their normal IO toggle rate.)

Note that the PTN3366 does have internal pull-up resistors on the input side.  It may have been possible to directly wire it to the FPGA outputs without the DC filter caps, but, we did not experiment this far as the first solution worked right off the bat.
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8175
  • Country: ca
    • LinkedIn
Re: True HDMI for Tang Nano 9K
« Reply #17 on: October 24, 2022, 09:29:40 pm »
I saw there was one from nockieboy in this topic https://www.eevblog.com/forum/fpga/hdmi-dvi-encoder-with-audio-smart-quartus-pll-integration-in-systemverilog/  but it has no PCB file to get gerbers from.
This was the point where we finished the PCB: https://www.eevblog.com/forum/fpga/fpga-vga-controller-for-8-bit-computer/msg3328920/#msg3328920

Just ask nockieboy for the gerbers, or source files.  I guess he just thought that no one else would bother with that PCB designed for that FPGA dev board.

6gb/s 4k support would require TI's TDP158.  Note you are paying for the 6ghz HDMI 2.0b capable driver.
« Last Edit: October 24, 2022, 09:55:56 pm by BrianHG »
 

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
Re: FPGA to HDMI-variants
« Reply #18 on: October 24, 2022, 11:06:31 pm »
Get one of those cheap HDMI repeaters to regen the signal.
I guess he decided to build one.

I ordered one for 2.5 USD just in case ... ;) 
Don't look forward replacing the displayport connector with a HDMI-Male connector.
 

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
Re: True HDMI for Tang Nano 9K
« Reply #19 on: October 24, 2022, 11:14:01 pm »
I saw there was one from nockieboy in this topic https://www.eevblog.com/forum/fpga/hdmi-dvi-encoder-with-audio-smart-quartus-pll-integration-in-systemverilog/  but it has no PCB file to get gerbers from.
This was the point where we finished the PCB: https://www.eevblog.com/forum/fpga/fpga-vga-controller-for-8-bit-computer/msg3328920/#msg3328920

Just ask nockieboy for the gerbers, or source files.  I guess he just thought that no one else would bother with that PCB designed for that FPGA dev board.

6gb/s 4k support would require TI's TDP158.  Note you are paying for the 6ghz HDMI 2.0b capable driver.

1280x720P is good enough for me the Nano 9K board stays well below 1.2 GHz...  :popcorn:


Updated the design files to v1.1 if you are curious see the first post for the sources.
« Last Edit: October 24, 2022, 11:20:23 pm by hve »
 

Offline andryblack

  • Newbie
  • Posts: 2
  • Country: ru
Re: True HDMI for Tang Nano 9K
« Reply #20 on: December 16, 2022, 10:52:56 pm »
- On my newer Samsung TV with HDMI ports 1 2 3 also no output, while it recognizes the hdmi is connected it will just tell check cables....

Check R1 on Tang Nano 9k board, after soldering this jumper (near HDMI connector) my Samsung TV recognize signal and show image.
 

Offline hveTopic starter

  • Contributor
  • Posts: 48
  • Country: nl
Re: True HDMI for Tang Nano 9K
« Reply #21 on: January 01, 2023, 05:52:08 pm »
Thanks allot. Super this works!

Bridged the R1 with a wire. See attachment.
« Last Edit: January 01, 2023, 06:53:51 pm by hve »
 

Offline andryblack

  • Newbie
  • Posts: 2
  • Country: ru
Re: True HDMI for Tang Nano 9K
« Reply #22 on: November 13, 2024, 08:15:39 pm »
Anybody success with HDMI/dvi RX on tang nano 9?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf