• AVR Freaks

Getting the Microchip Graphics Library to work with the SSD1906

Page: 12 > Showing page 1 of 2
Author
amrbekhit
Junior Member
  • Total Posts : 95
  • Reward points : 0
  • Joined: 2006/04/23 13:32:34
  • Location: 0
  • Status: offline
2008/07/03 04:35:53 (permalink)
0

Getting the Microchip Graphics Library to work with the SSD1906

Hello all,
 
I'm trying to get the MC Graphics Library v1.4 to work with the SSD1906 controller and a Hitachi TX14D11 320x240 TFT. I'm not using the Explorer 16 and Graphics PICtail boards but I've wired up the SSD1906 and my PIC24FJ96GA010 in the same way. I've followed the Starting a New Project topic in the help file with the only changes being that I swapped the S6d0129L.c and S6d0129L.h files for the SSD1906.c and SSD1906.h files. After that I modified the SSD1906.c file, specifically lines 341-360 and 370, which setup the controller's registers, to match my screen specs.
 
I compiled programmed the PIC and the output on the screen can be seen in the photo.
 
The slider and buttons can be seen and I can make out the text on the buttons. Because of this, I think that the problem is not a hardware one but a software one.
 
What other changes do I need to make to the code files to get the library to work? Alternatively, are there any demos that use the SSD1906 that I can build upon? All the demos that come with the Library do not seem to use the SSD1906.
 
Thanks
 
--Amr


Attached Image(s)

#1

24 Replies Related Threads

    amrbekhit
    Junior Member
    • Total Posts : 95
    • Reward points : 0
    • Joined: 2006/04/23 13:32:34
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/07/03 08:23:19 (permalink)
    0
    Looking at the screen output, it seems almost like there's another graphics layer that's being drawn after the buttons and slider are being drawn, and that this layer is being blended in with the previous layer. Does this ring a bell by any chance?
     
    --Amr
    #2
    amrbekhit
    Junior Member
    • Total Posts : 95
    • Reward points : 0
    • Joined: 2006/04/23 13:32:34
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/07/14 02:15:03 (permalink)
    0
    Does anyone have a working example of the Microchip Graphics Library working with the SSD1906? The PICtail graphics board has an SSD1906 on board and yet none of the examples that come with the library seem to use the SSD1906.

    --Amr
    #3
    Kiwi Mike AZ
    Super Member
    • Total Posts : 2044
    • Reward points : 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/07/14 08:19:13 (permalink)
    0
    ORIGINAL: amrbekhit
    Does anyone have a working example of the Microchip Graphics Library working with the SSD1906? The PICtail graphics board has an SSD1906 on board and yet none of the examples that come with the library seem to use the SSD1906.

     
    I have not used it yet (Still waiting for some spare cash to buy a new board as I have R1) but all you should need to do is include the SSD1906.c file in your project and remove the current one.
     
    Wire the TFT LCD to the appropiate pins, provide the appropiate power supply to your TFT display (Watch out, some have multiple voltages and critical startup order and timing). You may also need to reconfigure timings etc in the SSD1906 file to match your TFT display.
     
    Once I can get a new baord I have a couple of 3.5" LCD's I would like to test.
     
    Mike
    #4
    andyappeldorn
    New Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2006/09/27 08:33:55
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/07/14 12:53:38 (permalink)
    0
    I have the SSD1906 working with the Graphics Libs.  A couple things I was told to change:

    - Use a timer to create a refresh rate for the screen, can be done without this
    - Make sure you have a 48MHz Osc on your SSD1906 or you will need to have the absolute slowest setting on your PMP
    - Slow down the PMP speed in the ResetDevice function in the SSD1906.c file, make the delays as long as possible and work backwards, example below


        PMMODEbits.WAITB  = 3;
        PMMODEbits.WAITM  = 15;
        PMMODEbits.WAITE  = 3;
        PMMODEbits.INCM   = 0;  // auto increment address


    The wire wrap idea might be part of the problem.  Once you have the demo working you should only need to enable the other components and use them.  External memory may be needed if you are using graphics.

    Andy

    A^2

    visit: www.whatsupkc.com
    #5
    amrbekhit
    Junior Member
    • Total Posts : 95
    • Reward points : 0
    • Joined: 2006/04/23 13:32:34
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/07/16 08:58:32 (permalink)
    0
    Thanks very much for the information Andy - the speed was indeed the issue and now the system seems to be 99% fine. The last 1% is that now I have just one line of pixels at the bottom of the screen which are random. I'll keep tweaking the settings to see if I can get them to go away, but at least now it's much better.

    Thanks

    --Amr
    #6
    kuldeep
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2008/07/30 02:20:20
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/07/30 02:25:40 (permalink)
    0
    hi amrbekhit
     i am also tring to configure ssd1906 for hitachi TX14D12 but in datasheet there is no Hsync and Vsync pins,what to do with these pins as in microchip schematic for ssd1906 it shows connection for Hsync.
     
    kuldeep singh
    #7
    iceneo2k
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2008/09/15 06:43:39
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/09/15 06:49:51 (permalink)
    0

    Hi All,

    I'm with kuldeep in not understanding the datasheet for this display (i.e. no Hsync and Vsync pins) can anybody help with that issue?

    Amr, could you please confirm that Andy's changes were the only changes you made to the SSD1906.c files - or was there anything else that you did?

    If you have them to hand, do you think you could possibly upload them (SSD1906.c, SSD1906.h) to the forum for us other TX14D* users to browse through?

    Thanks a lot!

    Regards,
    iceneo2k.
    #8
    amrbekhit
    Junior Member
    • Total Posts : 95
    • Reward points : 0
    • Joined: 2006/04/23 13:32:34
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/09/15 07:06:00 (permalink)
    0
    Hi iceneo2k,

    The TX14D screens use the DTMG lines for their horizontal and vertical sync signals. Connect the DTMG line to the LDEN pin on the SSD1906 and configure it to activate the LDEN line every line.

    I'm more than happy to upload my SSD1906 files - I'll do so in a seperate thread.

    --Amr
    #9
    iceneo2k
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2008/09/15 06:43:39
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/09/15 07:15:51 (permalink)
    0
    Fantastic - that's cleared things up nicely.

    It'd be much appreciated if you could upload those files somewhere.


    Thank you,
    iceneo2k.
    #10
    amrbekhit
    Junior Member
    • Total Posts : 95
    • Reward points : 0
    • Joined: 2006/04/23 13:32:34
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/09/15 07:27:14 (permalink)
    0
    The code files have been uploaded to this post in the PIC24 graphics section.

    Can I ask a small favour? While using these files can you check to see if you get the odd random pixel appearing on the screen while you're drawing? I'm getting this problem on my screen but I think it's due to noise (I have lots and lots of flying wires so there's bound to be some crosstalk). If you do or don't get this problem I'd be interested to know as that'll help determine whether the problem is in the code or my hardware.

    Thanks

    --Amr
    #11
    iceneo2k
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2008/09/15 06:43:39
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/09/15 07:33:44 (permalink)
    0
    Thanks for the files.

    I'd be happy to let you know if I encounter the same problem. It might be a few days before I update you - the parts haven't arrived yet.


    iceneo2k.
    #12
    iceneo2k
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2008/09/15 06:43:39
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/09/22 02:10:54 (permalink)
    0
    Amr, I'm hoping to get the controller and screen up and running today.


    Could you please confirm that I have the right idea here - in that you got your screen running with the following connections:



    Display Connection   -->    SSD1906 Connection
    ----------------------------------------------
    DTMG                 -->     LDEN    (LCD_DEN)
    DCLK                 -->     LSHIFT  (LCD_SHIFT)



    Regards,
    iceneo2k.


    #13
    amrbekhit
    Junior Member
    • Total Posts : 95
    • Reward points : 0
    • Joined: 2006/04/23 13:32:34
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/09/22 02:15:16 (permalink)
    0
    Hi iceneo2k,

    That sounds right - good luck!

    --Amr
    #14
    iceneo2k
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2008/09/15 06:43:39
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/09/23 04:45:27 (permalink)
    0

    Hi Amr,


    Mostly good news - it works! I haven't seen any random pixels yet so presumably it must be some interference with your wires.

    My display needs to be rotated so I had to change to "USE_PORTRAIT" code to the following:

    For 90 degrees of rotation:


    #ifdef USE_PORTRAIT
        SetReg(REG_SPECIAL_EFFECTS,0x41);               // Reg   71h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR0,0x77);     // Reg   74h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR1,0x00);     // Reg   75h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR2,0x00);     // Reg   76h
        SetReg(REG_MAIN_WIN_ADDR_OFFSET0,0x78);         // Reg   78h
        SetReg(REG_MAIN_WIN_ADDR_OFFSET1,0x00);         // Reg   79h
    #else


    I tried to calculate these values from the datasheet for the controller but the values obtained from that did not work. These values were found from trial and error. They're not perfect. The display appears to be shifted to the right by one line of pixels.

    Ideally I’d like to use 270 degrees of rotation but I was unable to find any values which cause the controller to write to the correct pixels from the correct place - it always seemed to start writing off the screen - as though it was really a much larger display such as 480x320 or 640x480.

    I'll post again later as I continue to investigate these problems. Otherwise the display seems to be working well.

    Thanks for all your help.

    Regards,
    ice_neo2k.

    #15
    iceneo2k
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2008/09/15 06:43:39
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2008/09/23 09:24:50 (permalink)
    0

    Turns out the register values I was setting were being reset to something else later on in the code.

    My final modifications to SSD1906.c were:



    #ifdef USE_PORTRAIT
    #define ROTATE270

    #ifdef ROTATE270
        SetReg(REG_SPECIAL_EFFECTS,0x43);                   // Reg   71h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR0,0x88);         // Reg   74h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR1,0x95);         // Reg   75h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR2,0x00);         // Reg   76h
        SetReg(REG_MAIN_WIN_ADDR_OFFSET0,0x78);             // Reg   78h
        SetReg(REG_MAIN_WIN_ADDR_OFFSET1,0x00);             // Reg   79h
    #else
        SetReg(REG_SPECIAL_EFFECTS,0x41);                   // Reg   71h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR0,0x77);         // Reg   74h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR1,0x00);         // Reg   75h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR2,0x00);         // Reg   76h
        SetReg(REG_MAIN_WIN_ADDR_OFFSET0,0x78);             // Reg   78h
        SetReg(REG_MAIN_WIN_ADDR_OFFSET1,0x00);             // Reg   79h
    #endif

    #else
        SetReg(REG_SPECIAL_EFFECTS,0x40);                   // Reg   71h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR0,0x00);//0x9f); // Reg   74h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR1,0x00);         // Reg   75h
        SetReg(REG_MAIN_WIN_DISP_START_ADDR2,0x00);         // Reg   76h
        SetReg(REG_MAIN_WIN_ADDR_OFFSET0,0xa0);             // Reg   78h
        SetReg(REG_MAIN_WIN_ADDR_OFFSET1,0x00);             // Reg   79h
    #endif




    Also, no random pixels of random colour and no lines of pixels where they shouldn't be.

    It's all working perfectly now!


    Thanks again,
    iceneo2k.

    #16
    fajardiary
    Super Member
    • Total Posts : 245
    • Reward points : 0
    • Joined: 2009/02/19 03:51:17
    • Location: Indonesia
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2009/04/16 05:08:52 (permalink)
    0
    Dear All,

    my name is Fajar, i am working with the same LCD display, hitachi tx14d11. Can you guys help me? with the interfacing of the other pins.
    As I recall:
    DTMG -> LCD_DEN
    DCLK -> LCD_SHIFT
    how about the R0-R5,G0-G5,B0-B5, how to interface it with the SSD1906?

    Please Help me. . .

    #17
    fajardiary
    Super Member
    • Total Posts : 245
    • Reward points : 0
    • Joined: 2009/02/19 03:51:17
    • Location: Indonesia
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2009/04/16 05:22:55 (permalink)
    0
    Dear All, I have got the connection from the SSD1906 Datasheet. Smile
    And for the software mode? Which part in graphics config.h that i need to edit (because the default DISPLAY CONTROLLER is LG, do I have to change it to SSD1906?)

    #elif (GRAPHICS_PICTAIL_VERSION == 2)
    #define DISPLAY_CONTROLLER                LGDP4531
    #define DISP_HOR_RESOLUTION                240
    #define DISP_VER_RESOLUTION                320
    #define COLOR_DEPTH                        16
    #define DISP_ORIENTATION                90
    [\quote]
    post edited by fajardiary - 2009/04/16 05:58:37
    #18
    amrbekhit
    Junior Member
    • Total Posts : 95
    • Reward points : 0
    • Joined: 2006/04/23 13:32:34
    • Location: 0
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2009/04/16 07:10:51 (permalink)
    0
    Hello Fajar,

    I've looked through one of my graphics projects, and I cannot find a reference to DISPLAY_CONTROLLER - in the code I have, you do not need to explicity define which graphics controller you are using: all you need to do is include the ssd1906.c and ssd1906.h files into your project.

    However, I have noticed that the latest graphics library is at 1.65 whereas I am using version 1.4, so that might be the cause of the discrepancy. If you want, I can email you a copy the graphics test project I wrote if you want to use it as a reference. Just PM me your email address (I can't upload it to the forums due to size and filetype restrictions - no ZIPs allowed damnit!)

    --Amr


    #19
    fajardiary
    Super Member
    • Total Posts : 245
    • Reward points : 0
    • Joined: 2009/02/19 03:51:17
    • Location: Indonesia
    • Status: offline
    RE: Getting the Microchip Graphics Library to work with the SSD1906 2009/04/20 00:22:12 (permalink)
    0
    Dear Amr,
    Thank you for the quick response, I am getting confused about this part. It is nice if you would email me your working project. I am using Microchip Graphics Library version 1.6. I picked the quote from GraphicsConfig.h inside the main demo project. I attached it here if you'd like to check it (I changed the extension into txt).

    I have PM you my email, hope you can help me.
     
    Kindest Regards,
     
     
     
     
    Fajar Fathurrahman
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5