1 2 Previous Next 19 Replies Latest reply on Apr 2, 2015 11:59 AM by dakn_263916 Go to original post
      • 15. Re: Driving an OLED display, using Character LCD Component
        userc_41258

        I have just clocked your latest reply Dana.
        I have not noticed any unwanted artifacts with the LCD display, but
        your comment about using a buffer so that I only write characters that
        have changed seems like a much more efficient way of driving the display.
        So I will certainly try that when I get to the "optimising phase" later
        in the project.
        Many thanks,  Ken.

        • 16. Re: Driving an OLED display, using Character LCD Component
          dakn_263916

          If you look at section 15.2 in datasheet there are delays needed.

             

          You might check the code generated for the LCD module to see

             

          what delays the Cypress code does.

             

           

             

          Another quick check is get your hands on a 44780 declared compatible

             

          LCD, just to check no gremlins exist. And check with another OLED

             

          to make sure the module you have is OK.

             

           

             

          This code -

             

           

             

                  if (period >= 100000) {
                      div_per = 1000 ;  afterpt_per = 2 ;  units_per = " mS" ;
                  }
                  else if (period >= 10000) {
                      div_per = 1000 ;   afterpt_per = 3 ;  units_per = " mS" ;
                  }  
                  else if (period >= 1000) {
                      div_per = 1000 ;   afterpt_per = 4 ;  units_per = " mS" ;
                  }
                  else if (period >= 100) {
                      div_per = 1 ;   afterpt_per = 2 ;  units_per = " uS" ;
                  }
                  else if (period >= 10){
                      div_per = 1 ;   afterpt_per = 3 ;  units_per = " uS" ;
                  }
                  else {
                      div_per = 1 ;   afterpt_per = 4 ;  units_per = " uS" ;
                  }             

          .....

             

          you might consider storing in a struc array the settings and use a pointer

             

          in the decision  tree, just to save code space.

             

           

             

          Regards, Dana.

          • 17. Re: Driving an OLED display, using Character LCD Component
            ki.leung
                    Try to add a couple of mS delay (or upto 10ms , just to check) between each instruction to the LCD.   
            • 18. Re: Driving an OLED display, using Character LCD Component
              userc_41258

              Problem solved !

              After much poking around with the code, I have managed to get my OLED display
              working properly.  I have made two edits:

              To clear the display, I have modified code as follows:
                 LCD_ClearDisplay();   which is:   LCD_WriteControl(0x01);
                     is replaced with two lines:
                 LCD_WriteControl(0x00);
                 LCD_WriteControl(0x01);

              To write two lines on display, I have modified code as follows:
                 Insert:
                     LCD_WriteControl(0x28);
                 This overwrites the line in LCD_init() which says:
                     LCD_WriteControl(LCD_DISPLAY_2_LINES_5x10);   /* 2 Lines by 5x10 Characters */
                       which is same as   LCD_WriteControl(0x2C);
                  i.e. the one bit for N, number of lines, has to be flipped.
                  This makes it opposite from what the datasheet says!
                  I don't know if this is a mistake in the datasheet, or what?
                 
              Having done above, everything is now working as it should, except that there are
              signs of the "artifacts" that you mentioned -- occasional flickering of random pixels.
              It is very slight, but it would be nice to get rid of them -- I will investigate that.

              Perhaps what I describe above, or a proper tidy version of it, could be made available
              somewhwere for others who are trying to drive OLED character displays.

              Thanks for comment about using a struc array for multiple decisions.
              I'll give that some thought.

              Many thanks for your help.  Ken.

              • 19. Re: Driving an OLED display, using Character LCD Component
                dakn_263916

                Super, glad to have been of assistance.

                   

                 

                   

                If you have time file a CASE and report this, would be helpful to all.

                   

                 

                   

                    

                   

                          

                   

                To create a technical case at Cypress -

                   

                 

                   

                www.cypress.com

                   

                “Support”

                   

                “Technical Support”

                   

                “Create a Case”

                   

                 

                   

                You have to be registered on Cypress web site first.

                   

                 

                   

                 

                   

                 

                   

                Regards, Dana.

                1 2 Previous Next