Main Site Documentation

Config 7" display


#1

I am hooked up to a LARGE bench supply & showing a grid of lines on the display & some text

The text looks fine, but the lines near the LEFT SIDE have noticable flicker…I dug around & found the following, but are these correct adjustments for a flicker-free display???..my program is stopped (waiting for debug command appears in small letters on LCD), but the flicker is still present…

What are the correct values to use?

 static void SetLCDConfigurations()
        {
            Configuration.LCD.Configurations lcdConfig = new Configuration.LCD.Configurations();
            lcdConfig.Width = 800;
            lcdConfig.Height = 480;

            // Only use if needed, see documentation.
            lcdConfig.PriorityEnable = true;

            lcdConfig.OutputEnableIsFixed = false;
            lcdConfig.OutputEnablePolarity = true;
            lcdConfig.PixelPolarity = false;
            lcdConfig.HorizontalSyncPolarity = false;
            lcdConfig.VerticalSyncPolarity = false;

            // For EMX
            lcdConfig.HorizontalSyncPulseWidth = 150;

            lcdConfig.HorizontalBackPorch = 150;   //try different values
            lcdConfig.HorizontalFrontPorch = 150;
            lcdConfig.VerticalSyncPulseWidth = 2;
            lcdConfig.VerticalBackPorch = 2;
            lcdConfig.VerticalFrontPorch = 2;
            lcdConfig.PixelClockDivider = 5;

            if (Configuration.LCD.Set(lcdConfig))
            {
                // New settings were saved, must reboot
                Microsoft.SPOT.Hardware.PowerState.RebootDevice(false);
            }

#2

There are the number we usually use http://www.ghielectronics.com/downloads/FEZ/Cobra/LCD_Example_7_Inch.cs


#3

I am using the SAME values (see below), but get very noticable line flicker on the left side. Is there something i am overlooking?

using System;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Touch;
using Microsoft.SPOT.Input;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;

using GHIElectronics.NETMF.Hardware;


namespace LCD_Example_7_Inch
{    
    public class Program
    {
        static void SetLCDConfigurations()
        {
            Configuration.LCD.Configurations lcdConfig = new Configuration.LCD.Configurations();
            lcdConfig.Width = 800;
            lcdConfig.Height = 480;

            // Only use if needed, see documentation.
            lcdConfig.PriorityEnable = true;

            lcdConfig.OutputEnableIsFixed = false;
            lcdConfig.OutputEnablePolarity = true;
            lcdConfig.PixelPolarity = false;
            lcdConfig.HorizontalSyncPolarity = false;
            lcdConfig.VerticalSyncPolarity = false;

            // For EMX
            lcdConfig.HorizontalSyncPulseWidth = 150;

            lcdConfig.HorizontalBackPorch = 150;   //try diferent values
            lcdConfig.HorizontalFrontPorch = 150;
            lcdConfig.VerticalSyncPulseWidth = 2;
            lcdConfig.VerticalBackPorch = 2;
            lcdConfig.VerticalFrontPorch = 2;
            lcdConfig.PixelClockDivider = 5;

            if (Configuration.LCD.Set(lcdConfig))
            {
                // New settings were saved, must reboot
                Microsoft.SPOT.Hardware.PowerState.RebootDevice(false);
            }     
        }

        public static void Main()
        {
        SetLCDConfigurations();
            Bitmap LCD = new Bitmap(SystemMetrics.ScreenWidth,
                                    SystemMetrics.ScreenHeight);
            // Font MyFont = Resources.GetFont(Resources.FontResources.sego32);

            //clears the memory and not the display
            LCD.Clear();
            int i;
            for (i = 10; i < 200; i += 4)
            {
                //draw on memory
                LCD.DrawLine(Colors.Green, 1, 10, i * 10, i * 5, 200);
            }
            // print some text on the screen
          //  LCD.DrawText("Still Amazing!", MyFont, Colors.Red, 100, 20);
            //transfer the bitmap memory to the actual display
            LCD.Flush();
        }
    }

}


#4

I just happened to try a different color & found red, blue, yellow & few others are rock steady.

GREEN has a lot of flicker…why green?

I found that if I set the thickness parameter to 2, the green is solid, (but is too thick for me).


#5

I have never seen this and it doesn’t make sense.

How is the board powered?


#6

please try out this program ASAP and see for yourself…there is NO power problem very large bench supply

I need to know the proper settings or corection to display these lines without the flickering…let me know if you see the flicker.


#7

Please answer my question. How is the board powered? What voltage? What connector? What power supply?

You said you used a “larger” power supply! That us all we know :slight_smile:


#8

Have you tried the program I gave? Please use this exact one for troubleshooting.

The supply is 30V 10 amp set to 7v to 5.8V–makes no difference. to the power connector con1.

I added 3300uf at the power connector…no difference…it is software


#9

Any other values that might work? did you try the program? The green lines flickwer quite a bit


#10

This is what we use and there is no flicker usually.

Can you try regulated 5v on the 5v pin instead of using power connector?


#11

Hi,

Sorry for bringing up such old thread. I searched through the forum for CP7 flicker and this seems closest to what I’m seeing.

In my case the flicker also depends on the color, but it affects the whole screen.

I test with very simple app that sets lcd background color and shows some black text on touch event:

        void ProgramStarted()
        {
	// Here I set different backgorund colors.
            display_CP7.SimpleGraphics.BackgroundColor = GT.Color.Yellow; 
            display_CP7.ScreenPressed += new GTM.GHIElectronics.Display_CP7.TouchEventHandler(display_CP7_ScreenPressed);

            Debug.Print("Program Started");
        }

        void display_CP7_ScreenPressed(GTM.GHIElectronics.Display_CP7 sender,
            GTM.GHIElectronics.Display_CP7.TouchStatus touchStatus)
        {
            // X position of touch [i]
            int xPos = touchStatus.touchPos[0].xPos;
            // Y position of touch [i]
            int yPos = touchStatus.touchPos[0].yPos;

            display_CP7.SimpleGraphics.DisplayText("(" + xPos + "," + yPos + ")", Resources.GetFont(Resources.FontResources.NinaB),
               GT.Color.Black, (uint)xPos, (uint)yPos);
        }

Flicker with some background colors:

GT.Color.White - no problem
GT.Color.Blue - no problem
GT.Color.Red - no problem
GT.Color.Cyan - no problem
GT.Color.Magenta - no problem
GT.Color.Yellow - no problem
GT.Color.Black - no problem (with white text)

GT.Color.DarkGray - visible
GT.Color.LightGray - visible
GT.Color.Orange - visible

GT.Color.Green - extremely visible
GT.Color.Gray - extremely visible
GT.Color.Brown - extremely visible
GT.Color.Purple - extremely visible

Looking at the lcd from a distance the whole background seems to flicker a lot with some colors. If you look closely at the text - it seems to vibrate/pulsate. Here is macro video showing the effect on the text when there is flickering background color (I think it was Gray in this case):

I’m using Hydra + CP7, but powered only by the “USB Client SP Module”. I realize that this probably is not enough, but at the moment I cannot try with other power supply. So I wanted to describe what I’m seeing and ask if it’s likely to be a power issue. Thanks in advance!

Btw not sure if it matters, but I attach AC measurement of the pikes on 3.3/5v power supply lines measured with scope in 2 cases - with (gray) and without flicker (yellow).


#12

Have you tried it with a powered hub?


#13

I don’t even have powered hub at the moment :frowning:
I have tried connecting the USB SP module to USB3 port on the PC, but no difference compared to USB2 (not sure if it provides more power).

But I noticed something interesting for a moment. I turned off Hydra, disconnected CP7 and connected my old T35 display. Then powered on and I saw the startup text output on the screen - tinybooter version, ip address and so on. Part of it was out of the screen, so I assume that LCD configuration was still for CP7 at that moment. After that my test app started and I saw the same background flicker, but this time with the T35 display. I think this was the first time I saw flicker with T35, so maybe it’s related to lcd config. I was actually uploading another project on Hydra so the board restarted with the T35 lcd config and the other project, so I didn’t get to see more.

edit: I’ll try tomorrow with phone usb charger with 5v/1A output.


#14

No change with the 5v/1A usb phone charger.


#15

In your Gadgeteer code put the following at the beginning of your program:


            Register LCDCON1 = new Register(0x00500800);
            LCDCON1.ClearBits(0x1FF << 12);
            LCDCON1.SetBits(0x1000);

This should make the flickering go away as it sets Hydra’s LDC clock divider to 25MHz.


#16

Thank you, Aron!

It’s perfect, I tested all the colors again.


#17

Aron, there is one serious problem with the fix.

When that code is executed the image is shifted to the right with random amount of pixels (or at least I cannot notice a pattern). Pixels shifted beyond right edge of the display appear on the left side.

I didn’t notice it while testing the colors, because my test app just fills the background, but it’s clear when showing GUI controls (I’m using Glide).

You can also clearly see it when the “LOADING” text appears before starting the program. First it’s correctly shown in the center of the screen and after 1 second it jumps to the right (often really a lot - by 3-4cm). Sometimes the image is not shifted, but it’s rare.

I also noticed that the program runs a lot slower when this fix is enabled, but I suppose this is expected and cannot be avoided, right?

edit:
Just to clear - after the fix every drawing operation is shifted to the right. For example if in my flicker test app I touch the screen, then the touch coordinates appear somewhere to the right. Or if I draw ellipse in center of the screen it is shown right of the center, sometimes almost at the right screen edge. Y coordinate stays correct. X is always shifted with same fixed amount of pixels.

Thanks for your support. I hope that this is easy to fix.


#18

Hi ovivo,

I noticed the same thing happen when I loaded a pic versus the background color fill only. It is random every time the board is reset for me. I am not sure why it is doing that. I am still looking into as of why that is occurring.


#19

Hi ovivo,

This should fix your problem:


Register LCDCON1 = new Register(0x00500800);
LCDCON1.ToggleBits(0x2000);

I tested several times resetting the board and the image stays in place.


#20

Hi Aron,

It works. No flicker and shifting. Thanks :slight_smile: