Go to previous topic
Go to next topic
Last Post 19 Jan 2006 10:46 PM by  bethel
LCD Questions
 5 Replies
Author Messages
totalslacker
New Member
New Member
Posts:


--
13 Jun 2003 04:16 PM
    Hello,

    I'm trying to get a STN 320 x 240 4bpp display working and the lcd controller seems to be hating me. It looks like the pl110fb.c driver is really only set up for color TFT panels, so I'm sure that's the source of my problems.

    I have been going through what the driver is setting the lcd registers to and either making changes to the panel's lh_info struct or, in some case, modifying code to get it to do what looks to be the right thing (in cases where the code only supports tft panels).

    Right now, the crux of my problem is that unless I set the LcdTFT bit in LCDcontrol, the controller doesn't output any clocks whatsoever (frame pulse, pixel clock, etc).

    My lh_info structure is:


    bpp: 4,
    xres: 320, yres: 240,
    hsync_len: 13, /* hsw */ vsync_len: 0, /* vsw */
    left_margin: 21, /* hbp */ upper_margin: 1, /* vbp */
    right_margin: 11, /* hfp */ lower_margin: 1, /* vfp */
    sync: 0,
    LCDtiming2: 0,
    LCDtiming3: 0,
    LCDcontrol: LCD_CTRL_BW_MONO,
    LCDICPcontrol: LCDICP_CONTROL_CLSEN | LCDICP_CONTROL_SPSEN,
    LCDICPsetup: LCDICP_SETUP_VERT_NORMAL | LCDICP_SETUP_HORIZ_NORMAL,
    LCDICPtiming1: LCDICP_TIMING1_PSDEL(9) | LCDICP_TIMING1_REVDEL(3) | LCDICP_TIMING1_LPDEL(14),
    LCDICPtiming2: LCDICP_TIMING2_PSDEL2(209) | LCDICP_TIMING2_SPLVALUE(34),


    The hex values for the various registers:


    real LCDupbase = 20260000
    real LCDlpbase = 00000000
    real LCDtiming0 = 0x140a0c4c
    real LCDtiming1 = 0x010100ef

    real LCDtiming2 = 0x004f1808
    real LCDtiming3 = 0x00000000
    real LCDcontrol = 0x00000815
    real LCDICPsetup = 0x000013fc
    real LCDICPcontrol = 0x00000003
    real LCDICPtiming1 = 0x0000082d
    real LCDICPtiming2 = 0x000042d0


    which I parsed out to be:


    LCDcontrol:
    WATERMARK: 0
    Ldma-FIFOTIME: 0
    LcdV-Comp: 0
    LcdPwr: 1
    BEPO: 0
    BEBO: 0
    BGR: 0
    LcdDual: 0
    LcdMono8: 0
    LcdTFT: 0
    LcdBW: 1
    LcdBPP: 2
    LcdEn: 1
    LCDtiming0:
    HBP: 20
    HFP: 10
    HSW: 12
    PPL: 19
    Reserved: 4
    LCDtiming1:
    VBP: 1
    VFP: 1
    VSW: 0
    LPP: 239
    LCDtiming2:
    BCD: 0
    CPL: 79
    Reserved: 0
    IOE: 0
    IPC: 0
    IHS: 1
    IVS: 1
    ACB: 0
    Reserved: 0
    PCD: 8


    From reading sharps' documentation (both the LCD interfacing guide and the processor guide), I think I'm setting up everything correctly. Obviously this is not the case...

    As I mentioned earlier, if I set the LcdTFT bit in the control register I do get clocks out (they're not correct, but that's better than nothing).

    Does anyone have any idea as to what I'm doing wrong here?

    Thanks for any help!

    Shannon
    totalslacker
    New Member
    New Member
    Posts:


    --
    14 Jun 2003 07:51 PM
    So my problems got much simpler when I noticed that the lcd mux was not being set up for a stn display - all the lcd output pins were still being set as GPIO's.

    Fixing that and changing some pixel timings got me too a basic running display, although it looks like the pixel depth or something is wrong - patterns appear to be replicated or have gaps and text is missing chunks. Might be timing or it maybe the frame buffer device isn't being set up properly.

    Is there a simple way to open up the frame buffer and set pixels?

    Thanks!

    Shannon
    totalslacker
    New Member
    New Member
    Posts:


    --
    15 Jun 2003 11:11 AM
    Well, as usual, figured it out soon after posting...

    Writing to the frame buffer is really easy, once I got a regular pattern out there it was obvious one of the data lines wasn't right - re-checking my wiring revealed that I can't count and all my data lines were off by one... Fixed that and all better!

    Still need to adjust the output voltage of my lcd supply circuit - not generating enough voltage and so the display is very low contrast. But that part's easy!

    Is anyone else using or planning on using an STN display? The pl110fb.c driver needs quite a few changes to support them properly. I've hacked it to do the right thing for mine, but there are still several things that need to be fixed and other things that need to be more generic (and I'm sure some things I've missed).

    Shannon
    evgenek@hotmail.com
    New Member
    New Member
    Posts:


    --
    22 Jun 2003 03:12 AM
    Hi Shannon,
    I'm trying to bring alive 480x640 dual scan mono stn display - with no success so far.
    If you can send me the hacked source of pl110fb.c driver (btw, what is this - Linux device driver?), I'd really appreciate that.
    Currently I'm using Sharp's LCD driver that could be downloaded from their site. It does not help, since the examples they provide are related to TFT 16bpp panels.
    I passed through Sharp's AppNote but still have questions. For instance, how the LCDPalette register should be set up to work with 1bpp display? I hope, the driver source can help.

    Thanks!

    Evgeny.
    noonan
    New Member
    New Member
    Posts:


    --
    16 Sep 2003 01:24 PM
    This is a bit late to the party, I know, but perhaps someone can make good use of the info going forward.

    I have a spreadsheet that can simplify the pain of going through the LH79520 User Guide to figure out the following register settings for a LCD display:

    LCDtiming0
    LCDtiming1
    LCDtiming2
    LCDtiming3
    LCDcontrol
    LCDICPsetup
    LCDICPcontrol
    LCDICPtiming1
    LCDICPtiming2

    The spreadsheet was developed for the Sharp LH75400, LH75401, LH75410, and LH75411 MCUs, but the LCD Controller these MCUs is very, very close to that found in the LH79520 and LH7A400 MCUs, which have a few extra bit fields. The spreadsheet includes a decode sheet that is useful in understanding the bitfields in the main set of registers when you are looking at them with a debugger. It also includes an encode sheet that provides some error checking and common sense boundary checking when setting various values for a LCD.

    Since I'm not aware of a mechanism for attaching the file to this post, drop me a line and I'll send you a copy.

    Regards,
    Chris Noonan
    MCU Field Technical Manager (our term for "FAE")
    Sharp Microelectronics of the Americas
    bethel
    New Member
    New Member
    Posts:


    --
    19 Jan 2006 10:46 PM
    Could you please send me a copy of this spreadsheet? Thanks.

    Brianna
    -bethel@colorado.edu


    ---