Announcement

Collapse
No announcement yet.

How to upgrade uSD cards files without change 4DGL program uSD_SetSector ?

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

  • How to upgrade uSD cards files without change 4DGL program uSD_SetSector ?

    Hi,

    Using uOLED 160, is it possible to change uSD cards with different video files in it, and be able to upgrade new video files without configure new uSD_SetSector?
    I'm sure it's easy, but I don't still have the 4DGL language in my head.
    is it possible to have lines command for example?

    Thanks,
    K-soul

  • #2


    Assuming that this relates to your question of how to display "random" videos, and you are using a GOLDELOX display (160-GMD1 or 160-G1, you don't say which in your post), you cannot use the ImageControl command which requires that you use a FAT16 formatted uSD card and a PICASO display that supports file system access.

    That leaves only one method that I can see to get the information you need without hand coding the uSD-SetSector commands each time you create a new set of video files on the uSD card using the Graphics Composer.

    If you select the "Write Command Block, Yes" option in the Graphics Composer, a block of serial command bytes are written to the uSD card starting at location zero. See the ProjectName.txt file created by the Graphics Composer and the "Cmd (xx)" lines for a listing of the serial command bytes that are written to the uSD card if the Write Command Block option is selected. If you are building only a set of videos (no Delay or ClearScreen commands), the sector address of each video file is contained in the last 3 bytes of the 13 byte "DisplayVideo" (@V, 0x40, 0x56) serial command. See the DisplayVideo command in the uOLED-160-G1 User Manual for details of the command's structure.
    Example:
    Cmd (0) = 40 "@" - Display Video command
    Cmd (1) = 56 "V"
    Cmd (2) = 0 X location for video
    Cmd (3) = 0 Y location for video
    Cmd (4) = 60 Video Width
    Cmd (5) = 40 Video Height
    Cmd (6) = 10 Color mode
    Cmd (7) = 21 Interframe Delay in mS
    Cmd (8) = C Frames(HiByte)
    Cmd (9) = 61 Frames(LoByte)
    Cmd (A) = 0 0x00 - Sector address HiByte
    Cmd (B) = 10 0x10 - Sector address MidByte
    Cmd (C) = 0 0x00 - Sector address LoByte

    Cmd (D) = 7 0x07 - Delay command
    Cmd (E) = 7 0x07 - Delay HiByte
    Cmd (F) = D0 0xD0 - Delay LoByte 0x07D0 = 2000 mS

    Cmd (10) = 45 "E" Clear Screen command

    Cmd (11) = 40 "@" - Next Display Video command
    Cmd (12) = 56 "V"

    You could use the uSD_RdByte command to read the 3 byte sector address information from the serial command block, convert it to two word sized variables that could be stored in an array for use in the uSD_SetSector command for the videos on the uSD card. Not a trivial job if you're just learning 4DGL, but doable and a great learning experience.

    In effect, you would be building an ImageList that you could reference by index much like the ImageControl and ImageList functions available on the PICASO displays that can use the FAT16 file system.

    Good luck and please let us know how your project is coming along by posting progress reports here.

    Steve
    Any technology, sufficiently developed, is indistinguishable from magic. A.C. Clark(RIP)

    NEW! Lower prices on all 4D Systems products for 2009 and continuing into 2010!
    http://shop.littlepcbsolutions.com

    Comment


    • #3


      Hi Steve,

      Thank you for reply, and thank you for your good luck...

      Sure I'll let you know how is the progress of the project
      and which kind of "antipressor" psychiatric' pills I will use...

      If some body already wrote a kind of program for this function , he is welcome...

      K-soul

      Comment


      • #4


        I wrote some proof of concept code (attached). It's a little rough and still contains the text debug code (which you can comment out) , but you're welcome to give it a try if you're feeling brave.

        Steve
        Attached files G1_ImageControl.4dg (5.5 KB)
        Any technology, sufficiently developed, is indistinguishable from magic. A.C. Clark(RIP)

        NEW! Lower prices on all 4D Systems products for 2009 and continuing into 2010!
        http://shop.littlepcbsolutions.com

        Comment


        • #5


          Thank you Steve,

          I'll try it and stay you in touch.

          Some Other questions:

          When I compil a video file for the OLED 128 or 160-G1 using Graphic composer, the file on the uSD card become ten time bigger than the original video file mpeg 128/128, it appears so big than an uncompressed video file !
          Is it normal Doctor ? Is it because the Goldelox cannot run compressed video file ? do you know a medicin for this situation ? because I need to display more than two hours video, and memory card is too small...

          Other question, I devellop a system using OLED displays, and to shut down the display, I need to disconnect the power supply, but I read that it's not so good and that I must to activate "shut down function". How can I activate "shut down function" and disconnect power supply in one action? I saw a pin for reset function, but they are no pin for On/Off function?
          In practice, do you already saw dammaged display with a "many time disconnecting power supply" ?

          K-soul

          Comment


          • #6


            You are correct. Neither the GOLDELOX nor the PICASO processors using 4DGL can decode compressed still images or video. Unlike .WAV files which can be played directly from a FAT16 formatted uSD card on the PICASO based systems, the GOLDELOX displays cannot even support a FAT16 file system. There is no facility to decode compressed image or video formats and no way to store the files on the uSD that the GOLDELOX displays could read (no file system).

            For the GOLDELOX platform displays (GMD1 & G1), only raw pixel data is stored on an unformatted uSD card. It's stored as two bytes per pixel (16 bit color). So, for a 128x128 display, that's 32K/frame. At 13 frames per second, that's over 12MB per minute of video. The first 2MB (2048 sectors) of storage on the uSD card is reserved for the serial Command Block, so it's fairly easy to calculate the max running time for videos or the number of still images that can be stored. None of the 4D displays support uSD cards larger than 2GB (no support for uSDHC format).

            You might be able to reduce the frame rate of your original video or reduce the color density from 16 bit color to 8 bit color to make the files smaller, but of course the quality would be reduced.

            Display shutdown sequence: "Removing power without shutting down the screen electronics can, over time, cause damage and/or reduce the life of the OLED display". The preceeding is the paraphrased language provided by all of the manufacturers of OLED displays. This language can be found in the cautionary notes that are part of the technical datasheet for the display. What they don't say is whether the damage might occur after doing this 10, 100 times or any other number.

            It is safe to say that a prudent designer would endevor to follow the manufacturer's warnings on this point in order to avoid premature failure of the device. On the GOLDELOX platform devices, screen shutdown can be accomplished using the 4DGL gfx_Set() command as follows.

            gfx_Set(CONTRAST, 0);

            A contrast value of zero shuts down the screen electronics and puts the display into low power mode. Values between 1 and 16 control the screen contrast or brightness.

            Removing power from the display while in low power mode will not cause damage to the display. This low power mode could be entered based on a timeout function in your application or by means of user interaction with the device/application, i.e. holding a button closed for 2-3 seconds or selecting a shutdown function from a menu. If your application cannot provide a solution like the ones above, it would be best to remove power when the screen background color is black and nothing is displayed on the screen (lowest power without doing a shutdown procedure).

            Steve
            Any technology, sufficiently developed, is indistinguishable from magic. A.C. Clark(RIP)

            NEW! Lower prices on all 4D Systems products for 2009 and continuing into 2010!
            http://shop.littlepcbsolutions.com

            Comment


            • #7


              good good good....

              can we activate command function with the pins I/O 1 and I/O 2 of the uOLED 128 or 160 G1 ?

              do you know electronic's board with a different microprocessor who can support the 128 or 160 uOLED or 32024 AMOLED and who can drive compressed video codecs ?

              K-soul

              Comment


              • #8


                we have found the functions controlled by the pin I/O 1 and 2.

                when a video is playing, can we activate a pin to read a specific line of the 4DGL programm and so switch off the system ?

                K-soul

                Comment


                • #9


                  If you use the uSD_Frame(); command instead of the uSD_Video(): command, you can get control of the display within 4DGL after each frame of the video is displayed instead of having to wait until the video is complete.

                  Please note that the uSD_Frame() command is currently only available on GOLDELOX platform devices (-GMD1 & -G1).

                  Pseudo code sequence:

                  while framecount not equal 0
                  framecount := uSD_Frame() // plays 1 video frame and returns frames remaining
                  check I/O pin for button press
                  if button pressed, do shutdown
                  and exit while loop
                  wend

                  Hope that helps,

                  Steve
                  Any technology, sufficiently developed, is indistinguishable from magic. A.C. Clark(RIP)

                  NEW! Lower prices on all 4D Systems products for 2009 and continuing into 2010!
                  http://shop.littlepcbsolutions.com

                  Comment


                  • #10


                    Top of the Top Steve...
                    it works well.

                    How do you do to shut down a Picaso AMOLED playing a video if you don't have the uSD_frame command ?

                    K-soul

                    Comment


                    • #11


                      I'm glad it worked out for you.

                      4D systems has said that they are working toward adding the uSD_Frame() command for the PICASO platform. This is how it's been going for the past few months.

                      New features get added to one platform (GOLDELOX or PICASO) and then it takes until the following release for those features to be added to the other platform. Both platforms are changing very quickly in the early going. Please remember that 4DGL is still in Beta status, so you can expect to see a lot of changes until the production release.

                      Steve
                      Any technology, sufficiently developed, is indistinguishable from magic. A.C. Clark(RIP)

                      NEW! Lower prices on all 4D Systems products for 2009 and continuing into 2010!
                      http://shop.littlepcbsolutions.com

                      Comment


                      • #12


                        OK,
                        and do you know if you will insert in your platforms the possibility to run video files using codecs, and so to have smaller video files in the flash memory, because we devellop small video players and we need more capacity to run longer video, this limit of video files is a big problem for us and we don't no how to resolve it. Or do you know if we can get bigger memory flash than 2 Go?

                        K-soul

                        Comment

                        Working...
                        X