Announcement

Collapse
No announcement yet.

Problems Displaying Full Screen Image

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems Displaying Full Screen Image

    I am having trouble getting full screen images to display properly and reliably. I'm using a uOLED-32028-P1T GFX with the latest pmmc I could find, 2.04, installed. I have Workshop 3.1.0.14 and Graphics Composer 2.9.0.15.

    For this demo I have two 320x240 images I'm trying to display in Landscape mode. If I clip them to something significantly less than full size, say 300x200 they display fine but if I don't clip them I get random bad pixels. For one image the bad pixels are at the bottom of the the screen but for the other, the result is color shifting and random bad pixels in most of the image.

    Pretty standard code...

    var *Ihndl; // handle for image control

    func main()
    var imageNum,state;

    gfx_ScreenMode(LANDSCAPE);

    txt_FontID(FONT3);
    putstr("Mounting...\n");
    if (!(D:=file_Mount()))
    while(!(D:=file_Mount()))
    putstr("Drive not mounted...");
    pause(200);
    gfx_Cls();
    pause(200);
    wend
    endif

    print("Drive mounted.\n");
    print(mem_Heap()," bytes avail\n");

    touch_Set(TOUCH_ENABLE); // enable the touch screen

    Ihndl := file_LoadImageControl("Profile1.dat", "Profile1.gci",0);

    imageNum := 0;

    if((Ihndl))
    print(Ihndl[img]," images loaded.\n");

    pause(2000);

    gfx_Cls();

    img_Disable(Ihndl, ALL);

    repeat
    gfx_ClipWindow(0,0,319,239);
    gfx_Clipping(ON);
    img_SetPosition(Ihndl,imageNum,0,0);
    img_Enable(Ihndl,imageNum);
    img_Show(Ihndl, ALL);

    img_Disable(Ihndl,imageNum);

    repeat
    state := touch_Get(TOUCH_STATUS);
    until(state == TOUCH_PRESSED);

    repeat
    state := touch_Get(TOUCH_STATUS);
    until(state != TOUCH_RELEASED);

    imageNum++;
    if(imageNum >= Ihndl[img])
    imageNum := 0;
    endif
    until (0);
    else
    print("Files not found.");
    endif

    mem_Free(Ihndl);

    endfunc

    I've tried various combinations of clipping and image location. I've tried rotating the images and using Portrait instead of Landscape. I've rebuilt the image files at various bit depths, etc. and run them through GC. I just can not get the full image to display properly. Results are inconsistent from run to run and it seems that adding and removing seemingly unrelated code can cause the image to change or even fail to load.

    Good and bad images shown below. The red lines and dots visible in the "bad" image move around from run to run. Again, if I clip the image down far enough it will display properly.

    I'm new to 4D System displays so any suggestions would be appreciated.
    Robert




  • #2


    Hi Robert,
    just tried your code, and the supplied image on uOLED-32028 with the latest PmmC
    http://www.4dsystems.com.au/downloads/4DGL-Display-Modules/uOLED-32028-P1(GFX)/PmmC/uOLED-32028-P1GFX-R24.PmmC
    and it works well. I wonder if your not getting enough power.
    Try downloading the program to FLASH and running from an external PSU. If that proves things are good, try to increase the power setting in your USB driver setup software.
    There is also a slight chance that the uSD card is faulty.
    Regards,
    Dave

    Comment


    • #3


      Thanks, it is a power supply issue. Ran it off a separate supply and the images loaded fine.

      Didn't see a way to increase the USB power through the driver setup. I ended up jumpering in a separate supply through a diode, after the diode from the USB supply, so I can test more easily.

      I do still see some rapidly changing vertical lines that look like noise on the display when the image has a lot of white. I have tried two bench top supplies and they both have these lines, though each one looks a little different. Both supplies are capable of supplying many amps of power. Hope I do not see this problem when I go to a switching power supply running off a battery in the final product. Any thoughts on this issue?

      Also, my Agilent power supply lets me see the current consumption. I am seeing 270mA for some of the darker images up to 350mA or so for ones like the keyboard. The datasheet list supply current at 160mA max. Is the power consumption I'm seeing typical?

      Robert

      Comment


      • #4


        If you are using an MB5 or the 4D programming cable, see here about increasing the current available http://4d.websitetoolbox.com/post?id=2990300 if you are using a CE5 there is nothing to do.

        The datasheet is specified without a uSD card installed. Some uSD cards can be quite frugal (10-20ma IIRC), whereas others think 200ma is fine
        Mark

        Comment


        • #5


          I have been testing power consumption without the uSD card installed. If I set the background to white and contrast to 5, I saw power consumption of 256mA. So I would say either the 160mA max spec is not accurate or my display is defective.

          I tried to ramp up the contrast to beyond 5 with a white background while watching the current and briefly saw it exceed 500mA. Unfortunately, that process has permanently altered the behavior of the display. It will now not start up at all with one of my power supplies. It just buzzes. The other power supply will occasionally work, although sometimes it appears the display is just constantly resetting. I can get this one to work most times by holding the reset line low while powering up. One supply is capable of providing 3A and the other 6A.

          Robert

          Comment

          Working...
          X