No announcement yet.

uOLED-128 - cant get serial command to display image

  • Filter
  • Time
  • Show
Clear All
new posts

  • uOLED-128 - cant get serial command to display image

    I seriously think googling can kill me one day. I have googled uOLED-128-G1 a billion times, and dowloaded a billion documents in a billion revisions. How hard can it be??
    Ordered the uOLED-128-G1 from Parallax, the PCB says it is the -G2 version, rev3, but the splash screen says it is the G1 version, and the 4D software loader seems to agree to that.
    Version according to the splash screen:
    SPE2 rev 1.1
    PmmC rev 2.2
    The display is UG-2828GDEDF11, which, according to googles makes it the latest/later version. It also says PCB Rev 6.

    I have installed the 4D Workshop software on my PC, hooked up the USB/Serial using approved hardware (which means DTR to Reset is supported).
    Have loaded uOLED with the SPE loader - which should make sure it is congfigured to behave as a serial controlled slave. It does, I have successfully sent it simple commands ("Hello World").
    So far, fine.

    Next, I have run the Graphics Composer, 'add'ed two 128x128 jpgs, and 'build' a file on the uSD card direct. When doing that I have selected the 'raw' option which promises to put the first jpg in the 4D native format, starting at sector address 0.
    How can I verify the files are there? The card gets lost to Win due to the 'raw' format - I think.
    The Graphics composer also outputs some text files; one which gives the sector address of each jpg, and one which contains 4GL code, I think, to display them. Google world promises a text file will be created which contains the appropriate serial command to use - I can find it nowhere.

    Next, I have googled (again) and found out there in the forums (- and also found found in some versions of documentation -) which command to use to Display Image from uSD:
    It appears to be a choice of two options;
    1, first send command Set Sector Address, then command Display Image -or-
    2, send Display Image/Icon from uSD, with the sector address included as part of the parameters.

    I have tried both Display Image commands, but the display only prints "Missing internal fi...." and nothing more happens.

    Now, where do I go? How can I check the files are there? How can I know which is the correct command for this particular soft/firm/hard-ware version?

    This is the command code & reply:
    > 40 49 00 12 7F 5B 10 00 00 00
    < 15 15 15 15 06 FF FB

    This is the dat file from Graphics Composer:
    "PropEye1.jpg" 0000 0000 00 00
    "PropellerHat.jpg" 8200 0000 00 00

    This is the gc file:
    // Image - "PropEye1.jpg" Size 128x128
    // Width = 128
    // Height = 128
    // Usage: PropEye1.jpg(x, y);
    #constant PropEye1.jpg $media_SetSector(0x0000, 0x0000); media_Image

    // Image - "PropellerHat.jpg" Size 128x128
    // Width = 128
    // Height = 128
    // Usage: PropellerHat.jpg(x, y);
    #constant PropellerHat.jpg $media_SetSector(0x0000, 0x0041); media_Image

    Any help to make me reach my goal of displaying jpg's from the uSD by serial commands would be much appreciated!

  • #2
    If the PCB says it's a -G2 then it's a G2, it looks like the wrong PmmC has been loaded, somewhere, somehow.

    From Workshop, select file, new, uOLED-128-G2, Serial.

    Click on the tools tab and click on PmmC Loader, Change mode to manual, point 'PmmC to Load' to C:\Users\Public\Documents\4D Labs\4DUpdates\PmmCs\uOLED-128-G2-R25.PmmC and click load, This should load the correct PmmC and you should see the green "uOLED128-G2..." splash that will blank out after a few seconds.

    Again on the tools tab, click "SPE Load", which will load the SPE and you will end up with the SPE scrolling splash after about 5 seconds.

    The commands you were entering into SPE were SGC commands, you need to use SPE commands, you can find the correct commands under the "Serial Environment Documentation", look for the "Goldelox Serial Command Set Reference Manual", here

    For SPE the Testing tool is Serial Commander, click on 'Serial Commander' in the tools tab.

    The following Serial commander log will display the first image and then the second image

    media_Init[FFB1 ] 0.153 (ACK 2 0x0002)
    media_SetSector[FFB8 0000 0000] 0.009 (ACK)
    media_Image[FFB3 0000 0000] 0.086 (ACK)
    media_SetSector[FFB8 0000 0041] 0.009 (ACK)
    media_Image[FFB3 0000 0000] 0.086 (ACK)
    The sector addresses are taken from the gc file created by Graphics Composer.

    You can, sort of, check that the files are there, using HxD, or WinHex. View the 'physical' uSD disk and sector zero. For a 128x128 image the first bytes will be 00 80 00 80 10 00



    • #3

      A billion thanks!
      The uOLED-128-G2-R25.PmmC was not included with the 4DW installation, but I found it on your website and downloaded it, then firmwared it, and the display showed up as -G2.
      Then I sent the commands init, sector, display, in the format you showed - and it worked perfect!
      (In the mean time I had been put on to the idea to use a hexed to look at the uSD files and convinced myself the files were there.)

      Thanks a bunch for the swift and precise reply. It is so 'painful' when there is something I cannot get to work, and it is such a relief when it finally works.

      Btw, the the display is brilliant!



      • #4

        Sorry, just one more: googling has given me lot of warnings to make sure to issue a Shutdown command before switching off power to the display. Is this still an issue, I cannot seem to find any such command?



        • #5

          If you have the 'ability', by all means set contrast to 0 before powering off.

          If you can't then don't worry about it.


          • #6

            Thanks again. Good info.