Shop OBEX P1 Docs P2 Docs Learn Events
HDMI Tutorial for P2, please... - Page 2 — Parallax Forums

HDMI Tutorial for P2, please...

2»

Comments

  • ColeyColey Posts: 1,110
    I'm running this on a P2 Edge
  • RaymanRayman Posts: 14,646
    I don't have one of those to test with... I can't image what the difference could be...
  • ColeyColey Posts: 1,110
    edited 2020-12-07 21:02





    The image does appear, albeit very briefly ;-)
  • A flow chart of the HDMI display software might help novices understand what the HDMI program(s) do and why they do it. In particular I'd like to know how the buffer is organized and how to put information in it pixel by pixel so I can see it on the LCD. How can I display only a small green square on the LCD?
    For a good diagram the shows and explains a bit-mapped image file, visit: https://engineering.purdue.edu/ece264/16au/hw/HW13.
  • RaymanRayman Posts: 14,646
    edited 2020-12-07 21:37
    @Coley Maybe I should have put a repeat statement at the end of Main function... Can you add that and try? Or, try this one?

    @JonTitus This version draws a rectangle on top of the image. Maybe that will get you started...
  • RaymanRayman Posts: 14,646
    @Coley Actually, I don't think that's it... Try increasing clock frequency like this:
    _clkfreq=330_000_000
    
  • ColeyColey Posts: 1,110
    That is better (mostly on) but if I try another 8bpp BMP it stops working, all the time it works on my main monitor (even with the alternative BMP) but not on the 7"

    It's a strange one.
  • RaymanRayman Posts: 14,646
    Maybe we're getting somewhere...

    Try this:
    _clkfreq=312_500_000
    

    I think this is what it actually should be.
  • RaymanRayman Posts: 14,646
    Also, make sure the bitmap is 800x480 and 8bpp indexed color
  • RaymanRayman Posts: 14,646
    Tried this with mini projector to make animated Minecraft nether portal.
  • ColeyColey Posts: 1,110

    Working better now, still not 100% stable.

    8EOJ1JxATQuBsU2vdq5r_g.jpg
    1913 x 1913 - 432K
  • dgately wrote: »
    An interesting tutorial would be to show how in code, to place a pixel of a specific color at an x,y coordinate on either an HDMI or VGA display. Wouldn't that be a "core" function for teaching basic graphics that can be extended to create lines & more complex shapes? All examples so far seem to be at such a lower level than "mere mortals" like myself can use to display basic graphic items.

    dgately

    Have you looked at the mandelbrot and/or turtle_demo samples that come with FlexProp? Both of those plot pixels, the mandelbrot in 8 bit and the turtle graphics in 16 bit.
  • evanhevanh Posts: 15,916
    Coley wrote: »
    ... My pin group is the same as yours (48), I know it's right because I've plugged into my monitor and it's fine.
    This problem is more related to the 7" screen I think, maybe it's on the edge of it's tolerances.
    What is the native resolution of your 7" LCD?

  • ColeyColey Posts: 1,110
    evanh wrote: »
    Coley wrote: »
    ... My pin group is the same as yours (48), I know it's right because I've plugged into my monitor and it's fine.
    This problem is more related to the 7" screen I think, maybe it's on the edge of it's tolerances.
    What is the native resolution of your 7" LCD?

    800x480, the BMP and Driver are the same resolution.
    Not sure what refresh rates it can handle and I suspect that's where the issue lies.
  • RaymanRayman Posts: 14,646
    @Ariba figured out that the LUT starting from index #32 was due to the xcont line having a source value of 1 instead of 0.
    Here's an update with that fixed.
  • RaymanRayman Posts: 14,646
    edited 2020-12-08 17:49
    @Coley Comparing with the Spiral demo, I think I may have had the vertical blanks top and bottom reversed...
    Can you try this version and see if it's any better?

    Wait a minute... This doesn't work with my LCD... I'll keep looking...
    Actually, it does work on mine... Didn't have the extra power connected...
  • ColeyColey Posts: 1,110
    @Rayman

    I've found the difference between the spiral demo and your code it's this line in the setup of the spiral demo
    wrpin   ##%001001<<8,#7<<6 + hdmi_base  'set 1k-ohm drive on HDMI pins
    

    Your code is this line
    wrpin   ##%100100_00_00000_0,#7<<6 + hdmi_base  'set 1mA drive on HDMI pins
    

    Rock steady on the 7" LCD now ;-)
  • RaymanRayman Posts: 14,646
    Excellent!
    Hopefully, this is the last version of this.
  • Rayman. Many thanks for the rectangle program. It explains a lot and shows how to use the pixel buffer. Much appreciated. --Jon
  • RaymanRayman Posts: 14,646
    @JonTitus Wait! I've got something better... About to post in new thread..
  • ersmith wrote: »
    dgately wrote: »
    An interesting tutorial would be to show how in code, to place a pixel of a specific color at an x,y coordinate on either an HDMI or VGA display. Wouldn't that be a "core" function for teaching basic graphics that can be extended to create lines & more complex shapes? All examples so far seem to be at such a lower level than "mere mortals" like myself can use to display basic graphic items.

    dgately

    Have you looked at the mandelbrot and/or turtle_demo samples that come with FlexProp? Both of those plot pixels, the mandelbrot in 8 bit and the turtle graphics in 16 bit.
    Thanks for the reminder! I'll go back and check them out... In the mean time, I got simple line drawing working (and... now Ray has a lot more simple drawing code woking). Lot's of example code to work from!

    It's all good!

Sign In or Register to comment.