Displaying Videos and Images on 4Dsystems uOLED Serially


Closed Thread
Results 1 to 40 of 68

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Location
    Murrieta, CA
    Posts
    62

    Default Displaying Videos and Images on 4Dsystems uOLED Serially

    I have to start by saying that those guys at 4Dsystems really know what they are doing. they have made it very easy to display video, images, and even animated gifs on their Displays.

    - For my setup ill be using the µOLED-128-G1(SGC)
    Note: the (SGC) indicates that this is a serial display and has the 4Dsystems Pmmc firmware loaded.
    - My Controller board consists of a PIC16F877A , 5 Button dedicated RF interface (Key Fob), including Ports B,C,E brought out to the board edge.
    - Also in this setup is the Parallax RFID reader (serial). Radio shack has these on sale for $5. i have a few

    Ok. Lets start with Graphics Composer. Once you download your free copy of Graphics Composer Software, you must read the Graphics Composer manual. Unfortunately there are no links to the manual it is zipped with the software. It fully details how to get images onto your Micro SD card (uSD). There are 2 ways to get your images/videos to your uSD card. plugged directly into you computer as a Drive (recommended). or serially through the Display (which is very very slow).

    I chose to plug it into my computer. Very important to NOT "Quick Format" as it needs to write to the boot sector. when you get all your files loaded via the Device>Load it will give you a TXT icon that you can click on. This TXT file (Below) is the most important part. it basically just hands you the code that you just need to copy and paste into Pic Basic (Pro).

    Code:
    ===========================
    SERIAL-PLATFORM OUTPUT FILE
    ===========================
    
    ---------------------------------------------------------------------------------------
    File "Danger_Laser_Operating.gif"
    Sector Address 0x001000
    Width = 128 Height = 128 Bits = 16 (Location and size may be adjusted depending on image size
                                         and Size Mode selected)
    
    Display Image from Memory Card (Serial Command):
    Syntax:
    @, I, x, y, width, height, colourMode, SectorAdd(hi), SectorAdd(mid), SectorAdd(lo)
    Data:
    0x40, 0x49, 0x00, 0x12, 0x7F, 0x5B, 0x10, 0x00, 0x10, 0x00
    You will need to change all the "0x" to "$" in order for PBP recognize the values. This example only shows one file. the text file would grow depending on how many items you put on your micro SD Card.

    below is an example of PBP Code with the Data given from the TXT File above. This Code basically Turns on a laser and tells the display to show the file "Danger_Laser_Operating.gif" at Sector Address 0x001000.

    Code:
    DEFINE OSC 20
    
    '***************************** RF COMMUNICATION ********************
    
    ADCON1=7
    CMCON=7
    TRISA.0 = 1         ' These lines of code setup my RF Button Link
    TRISA.1 = 1
    TRISA.2 = 1
    TRISA.3 = 1
    TRISA.4 = 1
    
    Symbol Centerbtn  = PORTA.0 
    symbol UP            = PORTA.1       
    symbol Right         = PORTA.2
    Symbol Down        = PORTA.3  
    symbol Left          = PORTA.4 
    
    '*************************************************  *****************
    X               var     byte
    
    '*************************************************  *****************
    Symbol PWRLED  = PORTB.2
    symbol Laser       = PORTD.7        'Port D Output is Driven by a ULN2803 8 Channel Transistor Array
    symbol LCD         = PORTC.0
    
    pause 1000
    
    serout2 LCD,84,[$55]      ' uOLED Initialize
    low laser
    high pwrled
    
    '*************************************************  *****************
    
    Reset:
    gosub cls
    
    Main:
    If centerbtn = 1 then activate_Laser  'press center button to go to activate Laser Loop
    goto Main
    
    '****************** LASER Routine *************************
    
    
    Activate_Laser:
    if centerbtn = 1 then activate_laser        ' Release button to activate
    serout2 LCD,84,[$40, $49, $00, $12, $7F, $5B, $10, $00, $10, $00]    'The code given to us from Graphics Composer
    high laser
    
    Laser_On:
    if centerbtn = 1 then Deactivate     'Press Center button to go to Deactivate loop
    goto laser_on
    
    Deactivate:
    if center = 1 then Deactivate           'Release to Deactivate Laser
    low laser
    gosub cls
    goto main
    
    '****************** CLEAR SCREEN ************************************
    
    CLS:
    for x = 0 to 2
    serout2 lcd,84,[$45]
    next
    return
    Here is the Video of the working code above.





    You will notice that these videos also Implement my RFEFX Logo which is called in a separate routine

    Here are some other code / video examples:

    Code:
    define OSC 20
    
    
    '********************** RFID Tag Data *****************************
    
    
    Tag1 DATA  "0415146D53" '0415146D53   ' 2 cards registered...
    Tag2 DATA  "30700D48A5" '30700D48A5
     
    LastTag         CON     2
    tagNum          VAR     byte                    ' from EEPROM table
    idx             VAR     Byte                    ' tag byte index
    char            VAR     Byte                    ' character from table
    buf             var     byte(10)
    X               var     byte
    
    '*************************************************  *****************
    Symbol PWRLED  = PORTB.2
    symbol LCD     = PORTC.0
    Symbol rfidin  = PORTB.4
    Symbol RFID    = PORTB.5
    pause 1000
    
    serout2 LCD,84,[$55]      ' uOLED Initialize
    high RFID
    high pwrled                  'Software controlled Power LED (if this LED is not on at load check your code)
    
    '*************************************************  *****************
    
    Reset:
    gosub cls
    pause 100
    logo:
    gosub Logo_png             
    
    Main:
    low rfid
    serin2 rfidin,396,1000,Logo,[WAIT(10),str BUF\10]                      '2 Sec Timeout for Logo refresh
    high RFID
    
    '**************** RFID Check Tag Routine *****************
    
    Check_List:
    FOR tagNum = 1 TO lasttag
    FOR idx = 0 TO 9
    READ (((tagNum - 1) * 10) + idx), char        'The Tricky Order of Operation
    IF (char <> buf(idx)) THEN Bad_Char
    NEXT
    GOTO Tag_found
    Bad_Char:
    NEXT
    
    Bad_tag:
    serout2 LCD,84,[$40, $56, $00, $00, $80, $80, $10, $21, $00, $D4, $01, $54, $2E]  
    PAUSE 8000         ' Delay the duration of the length of the File on the uSD card, in this case 8 sec.
    GOTO reset
    
    Tag_Found:
    serout2 LCD,84,[$40, $56, $00, $00, $80, $80, $10, $21, $00, $D4, $01, $1F, $2E]
    pause 8000          ' Delay the duration of the length of the File on the uSD card, in this case 8 sec.
    GOTO reset
    
    
    
    
    '************************* LOGO Routine ********************************
    
    Logo_png:
    serout2 lcd,84,[$40, $49, $00, $30, $7F, $1F, $10, $01, $8A, $EE]
    return
    
    '************************** Clear the LCD ****************************
    
    CLS:
    for x = 0 to 2
    serout2 lcd,84,[$45]
    next
    return




    Code:
    DEFINE OSC 20
    
    '***************************** RF COMMUNICATION ********************
    
    ADCON1=7
    CMCON=7
    TRISA.0 = 1         ' These lines of code setup my RF Button Link
    TRISA.1 = 1
    TRISA.2 = 1
    TRISA.3 = 1
    TRISA.4 = 1
    
    Symbol Center  = PORTA.0 
    symbol UP      = PORTA.1       
    symbol Right   = PORTA.2
    Symbol Down    = PORTA.3  
    symbol Left    = PORTA.4 
    
    '*************************************************  ******
    
    Symbol PWRLED  = PORTB.2
    symbol LCD     = PORTC.0
    pause 1000
    
    serout2 LCD,84,[$55]      ' uOLED Initialize
    high pwrled                  'Software controlled Power LED (if this LED is not on at load check your code)
    
    '**************************************************************
    Reset:
    GOSUB CLS
    PAUSE 100
    Logo:
    GOSUB Logo_png
    
    Main: 
    If Left = 1 then Minions             ' Press Key Fob left button to start play loop
    goto Main
    
    
    '********************** Play Video Routine ********************
    
    Minions:
    if left = 1 then Minions       ' Release left button to Play Video
    serout2 lcd,84,[$40, $56, $00, $00, $80, $80, $10, $21, $04, $3C, $00, $10, $2E]    'Graphics Composer Data
    pause 38000                'Pause the duration of the loaded file (38 Sec)
    goto reset
    
    '************************* LOGO Routine ********************************
    
    
    Logo_png:
    serout2 lcd,84,[$40, $49, $00, $30, $7F, $1F, $10, $01, $8A, $EE]      'Graphics Composer Data
    return
    
    '************************** Clear the LCD ****************************
    
    CLS:
    for x = 0 to 2
    serout2 lcd,84,[$45]
    next
    return

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Great post!

    I was going to promote it as article, but got second!

    Thanks a lot. Now only if we could add sound...

    Ioannis

  3. #3
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default

    Thank you for this post RFEFX!
    Thanks and Regards;
    Gadelhas

  4. #4
    Join Date
    Nov 2006
    Location
    Murrieta, CA
    Posts
    62


    Did you find this post helpful? Yes | No

    Default lol !

    Quote Originally Posted by Ioannis View Post

    Now only if we could add sound...
    Thats funny you should Mention that.... because im already working on it.

    I've Already ordered the 4Dsystems SOMO

    I will post a Project when i get it.

    Cheers!

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Yes, I have seen the SOMO, I just meant to have the sound from the Video.

    OK, I know I ask too much...

    Ioannis

  6. #6
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    I picked up a µLCD-144(GFX) display yesterday. The reason I got this instead of the µOLED-128-G1(SGC) is that it was available locally for US$32. The main differences is that it is a backlit TFT LCD (instead of OLED) and it can be used standalone or with an MCU. You only need an RS232 (or USB to RS232 bridge) connection to program it. It comes with The 4D-Workshop3 IDE which provides an integrated software development environment for GOLDELOX-GFX2 processor and associated display modules. The IDE combines the Editor, Compiler, Linker and DownLoader to develop complete 4DGL application code. All user application code is developed within the Workshop3 IDE.
    Name:  TEST-6A.jpg
Views: 4998
Size:  96.7 KB
    Here are 2 demos that I did with the abovementioned development package. The first is a short clip of a PBS documentary. The video file is stored in the attached micro SD card. The actual code to display the video the LCD takes just 2 lines. The second demo is a simple analog clock.

  7. #7
    Join Date
    Nov 2006
    Location
    Murrieta, CA
    Posts
    62


    Did you find this post helpful? Yes | No

    Question .....

    rmteo,
    Thank you for posting your project.

    The only difference i see between your display and any of the µOLED-XXX-G1 series is the price and the TFT LCD. All 4Dsystems displays are capable of being standalone.. in my article above i stated that i had the "Pmmc Firmware Loaded." with a quick firmware change to the 4DGL firmware the µOLED-128-G1 becomes a standalone module as it has the GOLDELOX processor.

    This article was just a PIC based serial approach to the display.

    Cheers !
    Last edited by RFEFX; - 15th December 2010 at 18:49.

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts