Announcement

Collapse
No announcement yet.

uSD_Image hangs using GC 2.0.1.1?

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

  • uSD_Image hangs using GC 2.0.1.1?

    I've created a project using GC 2.0.1.1

    and followed the directions from the uSD_Image page see below...
    the uSD_Image call never returns... That is I see the start message but not the end.

    What have I missed?

    /*
    Requires Graphics Composer version 2.0.1.0

    The image and video formats under 4DGL has changed slightly from the serial platform versions.
    The image height, width and colour_mode(colour bits per pixel) parameters are now embedded into the
    image data block and does not require the user to pass these parameters to the image/video display functions.

    Getting Started:
    - Make sure to download the latest Graphics Composer version 2.0.1.0
    - You'll need a SD card reader/writer.
    - Run the GC and create a new project.
    - Enable the following settings:

    "Device" -> "Load Options" -> "Com Port/Drive" = (your drive name for the card reader, eg J
    "Device" -> "Load Options" -> "Write Command Block" = NO
    "Device" -> "Load Options" -> "Image Format" = Image & Pixel Data

    - Change the properties of the display resolution to

    X = 240, Y = 320

    - On the left "Actions" window pane right click the mouse button and add the following images:

    ..\4DGL_Workshop_Version_a1.0\Images\Jpg\abstract_azo5onui.jpg"
    ..\4DGL_Workshop_Version_a1.0\Images\Jpg\aeon041114.jpg"
    ..\4DGL_Workshop_Version_a1.0\Jpg\hibiscus_hkowya9a.jpg"
    ..\4DGL_Workshop_Version_a1.0\Images\Jpg\seasunset_5umhrb4r.jpg"
    ..\4DGL_Workshop_Version_a1.0\Images\Jpg\strawberry_3db7f143.jpg"
    ..\4DGL_Workshop_Version_a1.0\Images\Jpg\sunset_q4l1iowt.jpg"


    - Save your project, e.g ImageDemo1.gcs
    - Select "Device" -> "Load" to save all of the image data into the uSD card.
    - Using a text editor (eg Notepad) open the ImageDemo1.txt file the GC has created.
    Note down each of the sector addresses for each of the images. You will need these for the
    uSD_SetSector(SectHiWord, SectLoWord) function. In this case the sector addresses have already been
    inserted into the uSD_SetSector() function calls for each image for this example programas can be seen below.


    */


    func screenSplash()
    print("start");
    uSD_SetSector(0x0020,0x0000); //from GC .txt file Location=0x200000
    uSD_Image(0,0);
    print("end");
    pause(1000);

    endfunc

    func main()

    while(uSD_Init() == 0) // initialise and test the uSD card

    print("PLEASE INSERT uSD CARD\r");
    pause(1000);
    wend


    screenSplash();

    repeat
    // ...
    forever
    endfunc

  • #2


    The value in the .txt file created by the Graphics Composer is the byte address of the image. In order to set the "uSD_SetSector" sector address, you must divide by 0x200 (512 bytes/sector).

    For an image stored at 0x00200000, use "uSD_SetSector(0x0000, 0x1000);".

    See the 4DGL demo program code below the comments section that you quoted above. The first image on the uSD card is always written at byte 0x200000 or sector 0x1000 by the Graphics Composer.

    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

    Working...
    X