Not able to configure FezPortal Display correctly

I have a FezPortal and am using the display values in the documentation for the 480x272 screen used in the dev board (there is no section for the FezPortal in the docs), but all I get is a black screen and blue lines.

My search-fu is failing me - I can’t find a better config in the forum, the docs, or on the intertubes.

This is my init code:

 var displayController = DisplayController.GetDefault();
            displayController.SetConfiguration(new ParallelDisplayControllerSettings
            {
                Width = 480,
                Height = 272,
                DataFormat = DisplayDataFormat.Rgb565,
                Orientation = DisplayOrientation.Degrees0, //Rotate display.
                PixelClockRate = 10000000,
                PixelPolarity = false,
                DataEnablePolarity = false,
                DataEnableIsFixed = false,
                HorizontalFrontPorch = 2,
                HorizontalBackPorch = 2,
                HorizontalSyncPulseWidth = 41,
                HorizontalSyncPolarity = false,
                VerticalFrontPorch = 2,
                VerticalBackPorch = 2,
                VerticalSyncPulseWidth = 10,
                VerticalSyncPolarity = false,
            });

            displayController.Enable();

            this.screen = Graphics.FromHdc(displayController.Hdc);
            screen.Clear();

Anybody got better settings?

Thanks in advance.

I would try with both horizonal and vertical front/back porch to 0.

Edit: I would also try to invert vertical polarity. But here that’s just a guess as I don’t know what true/false means : rising or falling edge ?

We will check the docs but this is the official example

If you have Rev A then this might be the problem, not sure what changed

What is the reference of the display used on the FEZ Portal ?
You should be able to get the correct values in its datasheet.

Turns out that I am already using the same values as from the FezPortal sample (copy/pasted again just to be sure).

It’s a RevC board.

I suspect a HW problem and have reached out to Gus & Co.

UPDATE: I also tried @Bec_a_Fuel’s suggestions - no change. Thanks for the suggestions though.

If you have a suitable magnifying eyeglass, check the 40 way FPC connector that all of the pins are soldered properly, especially around the clock and sync pins.

@Dave_McLaughlin - thanks - I was about to do that, and will still give it a close look in case the ribbon fractured or came loose, but Gus reminded me that the Portals are sent out with a test program already flashed and it was displaying correctly when I received the board, so that is steering me more toward software issues in either firmware or my program stack. I am trying to recompile and flash the original test program but have run into unrelated issues getting it to compile…

1 Like

True confessions time - this was largely pilot error on my part.

I was only seeing the vertical lines when “Expand Heap” was turned on. It turns out that the display buffer is not zeroed when the display is initialized. It is only coincidentally zero at boot when Expand Heap is off.

So I saw rhythmic vertical lines and immediately thought “hardware” or “firmware”. Maybe I might have thought differently if it was noise.

The whole mess was compounded by using Graphics.FromHdc and not calling Flush() after some test code, which made me think “Oh, No output!” … confirmation bias that something was wrong that wasn’t my code.

Bottom line : Display buffers are not cleared on startup; call Flush() liberally; and happiness will be yours. Thanks for all, including and especially Gus and Dat, for fielding my weekend questions.

To be fair, we should clear the buffer when we create it to eliminate confusion. We will take care if that.

1 Like