Menu

LCD Contrast GLC PCD8544 Controllers

Help
Gigi
2022-05-26
2022-05-31
  • Gigi

    Gigi - 2022-05-26

    Hi all,
    I am trying to use this LCD, I usually use PICs but since I have some Arduino nano left over, I must say that they are even more practical than PICs, I have comfortably compiled and programmed.
    This lcd has software contrast adjustment but i can't find the method to adjust it, i also read the datasheet but i didn't understand anything how to set the lcd registers.
    Thanks

     
  • David Stephenson

    I used these about 10 years ago. You need to set the "volts".
    This is an extract from my program...

    sub inilcd
    set portc.1 on 'reset pin
    wait 5 ms 
    set portc.2 on 'power on (LCD powered from C.2)
    wait 5 ms 
    set portc.1 off 'reset pulse 
    wait 5 ms 
    set portc.1 on 'reset off 
    set portc.0 off 'command mode 1=data,0=cmd
    for j=1 to 8 
    readtable st1,j,dataout 'initialize LCD
    shiftout 'shift register
    next j 
    set porte.1 on 'SCE pin - what does this do?
    end sub
    
    Sub shiftout
    set porte.1 off
    porta.7=0
    for kk=0 to 7  
    porta.6 = Dataout.7 ' read bit to dat pin. 
    porta.7 = 1 ' clk high, load bit.
    porta.7=0 'clk low
    Rotate Dataout left Simple ' Move to next bit in Dataout. 
    next kk 
    set porte.1 on
    End Sub 
    
    table st1    'setup data 
    b'00100001'  'extended instruction set
    b'00000110'  'temp coeff
    b'00010011'  'set bias n=4 for mux 1:48
    b'11000010'  'set volts alkaline 8 extra
    'b'11110000'  'set volts for NiMh
    b'00100000'  'basic instruction set
    b'00001100'  'normal mode
    b'10000000'  'set left
    b'01000000'  'set top
    end table
    

    the important thing is in the table ST1 you can see I have two different setting for alkaline an NHMh batteries. That said don't expect much contrast from the display.
    I stopped using them as they went bad - it appears that the connection from the PCD8544 to the LCD fails over time.

     
  • Gigi

    Gigi - 2022-05-27

    @David Stephenson
    in your code I don't really understand what I should change to vary the contrast, maybe the table values ​​but I don't know which ones. I have several of these LCDs and they work well despite being small you can see well, the contrast seems correct but I wanted to understand how to possibly change it in the arduino C library there is a simple method with which to pass read or write a variable.

    @Anobium
    On this LCD the contrast management is adjusted internally by the controller through software and completely different from the HD44780 family. reading help I see that there are two commands:
    GLCDWriteByte and GLCDReadByte to pass commands but I can't understand how they work. Is there any example?

     
  • David Stephenson

    The device has a charge pump to supply the LCD voltages. Depending on the supply voltage the level needs to be set so the blacks are as black as possible with the background still white.

    There could be some advantage to changing the bias, but I never found much difference.
    To access the charge pump you need to select the extended instruction set.

    with d/c set to cmd (pin off).
    send b'00100001' bit 5 selects option, bit 0 =1 puts device into extended instruction set.
    send b'1,v6,v5,v4,v3,v2,v1,v0' bit 7 selects charge pump voltage, v6-v0 are the values.
    send b'00100000' bit 5 again selects option and bit0=0 sets it back to normal instruction set.
    set d/c back to data, and set SCE pin.

    All these should be sent using I2C I was unaware of this at the time so wrote my own shift register toggling the clk pin with the data bit.
    See the Philips datasheet for the full list of instructions.

     
  • Anobium

    Anobium - 2022-05-28

    I am certain there are standard LCD controls for this.

    What the URL to the correct datasheet for your type of LCD ?

     
  • Gigi

    Gigi - 2022-05-28

    Thanks David I understood something more, I also do some tests to learn something, however without changing anything (3.3V input power supply) you can see quite well.

     
  • Gigi

    Gigi - 2022-05-28
     
    • Anobium

      Anobium - 2022-05-28

      Thank you - this was my first GLCD library!

      Use ExtendedCommand_PCD8544 ( PCD8544SendByte )where

      'Temperature control 0 0 0 0 0 0 1 TC1 TC0 sets the temperature Coefficient (TCx)

      So, you send 0b100. 0b101. 0b110 or 0b111 to set the temperature Coefficient

       
      • Gigi

        Gigi - 2022-05-30

        I did a lot of testing today and it doesn't work.
        I poked around in the library to better understand and tried some internal subs:
        contrast= 20 ' default(20) (min=16 - max=23)

        ExtendedCommand_PCD8544 (contrast) 'it does not work

        Write_Command_PCD8544(0x21)
        Write_Command_PCD8544(contrast) 'SET contrast Bias system
        Write_Command_PCD8544(0x20)
        this works fine, i don't know why !!!

         
  • Anobium

    Anobium - 2022-05-30

    If it works... then, job done! Well done.

     
  • David Stephenson

    If you are going into the extended commands (by entering 0x21).
    sending 128-255 (in extended command) will set the charge pump voltage.
    If calling "contrast" sets bit7=1 then the allowed values are 1-127, you may notice in my program I am sending 112 to deal with 2.4V from 2xNiMh cells (so clearly 16-23 is not correct or is that for 5V operation?).
    Where's the help file for this library?

     
    • Anobium

      Anobium - 2022-05-30

      Help file? In the Help. See the Windows Help, http://gcbasic.sourceforge.net/help/_pcd8544_controllers.html or any of the Help formats.

      ExtendedCommand_PCD8544 is not documented so that tells me that the method has not been tested / was not tested.

      This may work based on Gigi's experience.

      sub ExtendedCommand_PCD8544 ( in _PCD8544SendByte )
                          Write_Command_PCD8544(0x21);            LCD Extended Commands..
                          Write_Command_PCD8544(_PCD8544SendByte);         Set PCD8544SendByte
                            Write_Command_PCD8544(0x20);            LCD Standard Commands..
                    end sub
      
       

      Last edit: Anobium 2022-05-31
      • David Stephenson

        I'm sorry if it seems like I'm nitpicking (again), but if I go to http://gcbasic.sourceforge.net/help/
        then type in the search box pcd8544 it returns no results.

         
        • Anobium

          Anobium - 2022-05-31

          Works here.

          Is the search case sensitive?

           
          • David Stephenson

            Interesting... if I put in pcd85 I get no matches, yet if I put in pcd8544 it gives the expected result - strange.

             
            • Anobium

              Anobium - 2022-05-31

              The website search could be improved. Way beyond my abilities to resolve.

               
  • Gigi

    Gigi - 2022-05-31

    I use arduino nano 5V, GLCD PCD8544 3.3V from arduino.
    From datasheett use byte:
    Bias system 0 0 0 0 .1 0 BS2 BS1 BS0 set Bias System (BSx)
    bit4=1 set contrast bit 0,1,2
    to send use of the undocumented but freely available GLCD sub GCB library
    glcd_pcd8544.h
    --
    contrast= 20 ' default(20) (min=16 - max=23)
    Write_Command_PCD8544(0x21) ' LCD Extended Commands
    Write_Command_PCD8544(contrast) 'SET contrast Bias system
    Write_Command_PCD8544(0x20) ' LCD Standard Commands

    No use: Write_Command_PCD8544(0x0C)
    No use: ExtendedCommand_PCD8544 ( in PCD8544SendByte )

    Practically sub Write_Command_PCD8544(byte) it should send I2C data
    If you have the opportunity to do some confirmation tests

     
  • Anobium

    Anobium - 2022-05-31

    The correct sub follows:

    sub ExtendedCommand_PCD8544 ( in PCD8544SendExtendedByte as Byte )
                        Write_Command_PCD8544(0x21);                            LCD Extended Commands..
                        Write_Command_PCD8544(PCD8544SendExtendedByte);         Set PCD8544SendByte
                        Write_Command_PCD8544(0x20);                            LCD Standard Commands..
    end sub
    

    The issue was the variable name was clashing with another sub routine. All is good. I know this because I got my PCD8455 Test bed out, and, it works!

    I will update the library today.


    Worthy of note. The contrast control only works only new PCD8455 ICs; The original phone GLCDs do not support contrast - I can see this on the test bed as the test bed has multiple PCD8455 displays so I can test properly.


    Anyway.. the new library is here. https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/include/glcd_PCD8544.h?format=raw


    And, I am very pleased that the demo from 2014 worked! No changes. I am pleased!

     
  • Gigi

    Gigi - 2022-05-31

    OK OK OK
    You were right to test the operation, I have never used graphic displays always the old ones HD447870.
    In fact I suspected that something was interfering but I am not able to understand.
    Anobium you are truly a great person available and prepared.

     
    • Anobium

      Anobium - 2022-05-31

      My pleasure. Do enjoy!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.