Shop OBEX P1 Docs P2 Docs Learn Events
HDMI examples for Rev.B silicon? — Parallax Forums

HDMI examples for Rev.B silicon?

RaymanRayman Posts: 14,646
edited 2019-11-15 19:49 in Propeller 2
The code in the documentation doesn't seem to be working for me...
Trying to figure out if problem is code or hardware....

Update: Seems this s32d850t monitor doesn't like 640x350 resolution, works on another monitor...
2016 x 1512 - 810K

Comments

  • cgraceycgracey Posts: 14,155
    I just copied it from the doc and it ran okay. I used pins 48..55:
    
    '********************************************
    '*  VGA 640 x 480 x 16bpp 5:6:5 RGB - HDMI  *
    '********************************************
    
    CON             hdmi_base = 48          'must be a multiple of 8
    
    DAT             org
    '
    '
    ' Setup
    '
                    hubset  ##%1_000001_0000011000_1111_10_00       'config PLL, 20MHz/2*25*1 = 250MHz
                    waitx   ##20_000_000 / 200                      'allow crystal+PLL 5ms to stabilize
                    hubset  ##%1_000001_0000011000_1111_10_11       'switch to PLL
    
                    rdfast  ##640*350*2/64,##$1000  'set rdfast to wrap on bitmap
    
                    setxfrq ##$0CCCCCCC+1           'set streamer freq to 1/10th clk
    
                    setcmod #$100                   'enable HDMI mode
    
                    drvl    #7<<6 + hdmi_base       'enable HDMI pins
    
                    wrpin   ##%100100_00_00000_0,#7<<6 + hdmi_base  'set 1mA drive on HDMI pins
    '
    '
    ' Field loop
    '
    field           mov     hsync0,sync_000         'vsync off
                    mov     hsync1,sync_001
    
                    callpa  #90,#blank              'top blanks
    
                    mov     x,##350                 'set visible lines
    line            call    #hsync                  'do horizontal sync
                    xcont   m_rf,#1                 'do visible line
                    djnz    x,#line                 'another line?
    
                    callpa  #83,#blank              'bottom blanks
    
                    mov     hsync0,sync_222         'vsync on
                    mov     hsync1,sync_223
    
                    callpa  #2,#blank               'vertical sync blanks
    
                    jmp     #field                  'loop
    '
    '
    ' Subroutines
    '
    blank           call    #hsync                  'blank lines
                    xcont   m_vi,hsync0
            _ret_   djnz    pa,#blank
    
    hsync           xcont   m_bs,hsync0             'horizontal sync
                    xzero   m_sn,hsync1
            _ret_   xcont   m_bv,hsync0
    '
    '
    ' Initialized data
    '
    sync_000        long    %1101010100_1101010100_1101010100_10    '
    sync_001        long    %1101010100_1101010100_0010101011_10    '        hsync
    sync_222        long    %0101010100_0101010100_0101010100_10    'vsync
    sync_223        long    %0101010100_0101010100_1010101011_10    'vsync + hsync
    
    m_bs            long    $70810000 + hdmi_base<<17 + 16          'before sync
    m_sn            long    $70810000 + hdmi_base<<17 + 96          'sync
    m_bv            long    $70810000 + hdmi_base<<17 + 48          'before visible
    m_vi            long    $70810000 + hdmi_base<<17 + 640         'visible
    
    m_rf            long    $B0850000 + hdmi_base<<17 + 640         'visible rfword rgb16 (5:6:5)
    '
    '
    ' Uninitialized data
    '
    x               res     1
    
    hsync0          res     1
    hsync1          res     1
    '
    '
    ' Bitmap
    '
                    orgh    $1000 - 70              'justify pixels at $1000
                    file    "birds_16bpp.bmp"       'rayman's picture (640 x 350)
    
  • RaymanRayman Posts: 14,646
    Can you please post the PNUT .exe you used?
  • cgraceycgracey Posts: 14,155
    Rayman wrote: »
    Can you please post the PNUT .exe you used?

    Ha, I was just getting the link for you:

    https://drive.google.com/file/d/1W4_O8garuXfxYGz80bLm81kBuby5WeI9/view?usp=sharing
  • RaymanRayman Posts: 14,646
    BTW, my power light comes on with just HDMI connected...
    Seems I get ~2V on VIO from HDMI data pins somehow...
  • cgraceycgracey Posts: 14,155
    Rayman wrote: »
    BTW, my power light comes on with just HDMI connected...
    Seems I get ~2V on VIO from HDMI data pins somehow...

    That demo sets up 1mA drive mode on those eight I/O pins, so the voltage is going to be a function of the receiver's impedance.

  • RaymanRayman Posts: 14,646
    edited 2019-11-15 19:18
    Sorry, I meant when HDMI cable is only thing connected to board (I.e., No USB power cable).
  • RaymanRayman Posts: 14,646
    edited 2019-11-15 19:26
    Thanks for posting your PNut.
    Gives me same thing though...
    I'll try on P0 when I find my Digital Video Expansion adapter...

    My chip is a hair warm... Maybe it's overheating... Only thing I can think of that could cause this....
  • cgraceycgracey Posts: 14,155
    Rayman wrote: »
    Sorry, I meant when HDMI cable is only thing connected to board (I.e., No USB power cable).

    Okay. You are getting 2V on the VIO pin which is driving the HDMI pins. That VIO pin is driven by a 3.3V regulator, right? Seems there is some heavy load, maybe, dragging that 3.3V down?
  • I think Rayman means there is power arriving from the HDMI cable, when the P2 board is otherwise unpowered
  • RaymanRayman Posts: 14,646
    Yes, that's right.

    BTW: Just tested on cheaper monitor and it works!
  • RaymanRayman Posts: 14,646
    Seems my Samsung s32d850t doesn't like 640x350 resolution...
  • Great to hear that its working now. It sure was an interesting effect on the screen.

    I have this recalcitrant 50 or 55" 4k TCL monitor from costco that often doesn't like the signals being fed to it. For some odd reason its the one I often try first, but it does no favors.

    Then we have a cheap white dick smith monitor that just works (mostly)
  • cgraceycgracey Posts: 14,155
    The image is 640 x 350, but black lines are put above and below the image, so that the vertical sync lines are properly placed. Seems it should work okay.
  • RaymanRayman Posts: 14,646
    edited 2019-11-15 20:03
    Ok, this is a strange one... I changed the code to have 480 lines (to include uninitialized RAM) and now works with that monitor...

    Vertical placement is off, but at least shows image correctly...
    2016 x 1512 - 933K
  • jmgjmg Posts: 15,173
    Don't PCs first boot at 640 x 480 (or is it 640x400?) and then 'move up' ?
    That may give the lowest resolution they test monitors at ?
  • evanhevanh Posts: 15,916
    Yep, a minimum of 30 kHz horizontal sync.
  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2019-11-15 21:15
    FYI, PCs boot at 720x400 @ 70Hz
    (yes, the pixels are very much not square)

    (Although, actually, my PC boots at whatever the monitor's EDID claims to be the native resolution. (internally, it just scales whatever resolution the running software selects to that, until the OS loads the proper GPU driver))
  • evanhevanh Posts: 15,916
    All of which are above 30 kHz horizontal - http://martin.hinner.info/vga/timing.html
  • @cgracey

    I have the new screen. Using two different laptops windows 10 pro. On one the spiral works on the other no. I cannot get the birds to work. Period.
    Please look at the threads. What is going on. Used Pnut v and earlier versions still no avail.
Sign In or Register to comment.