Menu

Strange bevavior of ssd1306 Display

bed
2017-08-27
2017-08-28
<< < 1 2 (Page 2 of 2)
  • bed

    bed - 2017-08-28

    Let me share my investigation and telling about mystery:
    Anobiums Win Hex File does nothing, me be because chip ferequency is set to 64 an my board has no Quartz.
    I soldered one of the two displays with 2k7 Pullup, nothing changed.
    Resitance without any connectione between gnd and sca/scl about 4MegOhms.
    Now comes the surprise.
    When flashing the (wrong) 64 pix version, it runs direct (6 Seconds delay) after flash.
    When I disconnect power and PicKit I shortcircuit the Vcc-GND like the hint from Joseph. Reconnect 5V again, waiting 6 Seconds and the Display shows the Text, but 180° reverse! Upside down but it is readable, like it would be now in the correct 32 pix state.

    Same prodecudre with 32 mode, nothting happens.
    btw: When I set Constant LCD_TYPE_SSD1306_CHARACTER_MODE_ONLY
    none of the two modes are functional.

    And it is by far darker. This phaenomene had I watch for my earliest tries before, also, when powering only with 5V. (Yes the Voltage is 5.22Volts constant)

      'Set internal clock speed to 4 MHz:
        Set IRCF0 = 1
        Set IRCF1 = 0
        Set IRCF2 = 1
    
    did not change anything.
    
     
  • Anobium

    Anobium - 2017-08-28

    Try this. Copy and paste, test.

        #chip 18f25k20, 16
        #option explicit
    
        #define I2C_MODE Master
        #define I2C_DATA PORTC.4
        #define I2C_CLOCK PORTC.3
    
        #include <glcd.h>
        #define GLCD_TYPE GLCD_TYPE_SSD1306_32  'for 128 * 32 pixels support
        #define GLCD_I2C_Address 0x78
        #define vccstate 0
    
        #define GLCD_TYPE_SSD1306_CHARACTER_MODE_ONLY
    
        GLCDCLS
        GLCDPrint 0, 0, "Great Cow BASIC"
        GLCDPrint 0, 16, "Anobium 2017"
    
     

    Last edit: Anobium 2017-08-28
  • bed

    bed - 2017-08-28

    Sorry, nothing on the display

     
  • Joseph Realmuto

    Joseph Realmuto - 2017-08-28

    It's sounding to me like a problem I had with some of these displays. Basically, I put a delay of 255 ms at the start of the initialization procedure to allow the power supplies time to stabilize. That fixed the problem. The delay would be right at the beginning of the InitGLCD_SSD1306 subroutine in SSD1306.h:

    Sub InitGLCD_SSD1306
    
        'Colours //Set these first
        GLCDBackground = 0
        GLCDForeground = 1
        GLCDFontWidth = 6
        GLCDfntDefault = 0
        GLCDfntDefaultsize = 1
    
    'need delay here to allow power supplies to stabilize
    wait 255 ms
    
     #IFDEF HI2C_DATA
             HI2CMode Master
             Wait 15 ms  'wait for power-up and reset
     #ENDIF
    
     #ifdef S4Wire_DATA
          dir MOSI_SSD1306 Out
          dir SCK_SSD1306 Out
          dir DC_SSD1306 Out
          dir CS_SSD1306 Out
          dir RES_SSD1306 Out
          RES_SSD1306 = 0
          wait 10 us
          RES_SSD1306 = 1
        #endif
    
       'Setup code for SSD1306 controllers
        'Init sequence for 128x64 OLED module
        Write_Command_SSD1306(SSD1306_DISPLAYOFF)                    ' 0xAE
    
        Write_Command_SSD1306(SSD1306_DEACTIVATE_SCROLL)
        Write_Command_SSD1306(SSD1306_SETDISPLAYCLOCKDIV)            ' 0xD5
        Write_Command_SSD1306(0x80)                                  ' the suggested ratio 0x80
    
        Write_Command_SSD1306(SSD1306_SETMULTIPLEX)                  ' 0xA8
        #if GLCD_HEIGHT = 64
          Write_Command_SSD1306(0x3f)                                 '64 pixels
        #endif
    
        #if GLCD_HEIGHT = 32
          Write_Command_SSD1306(0x1f)                                 '32 pixels
        #endif
    
        Write_Command_SSD1306(SSD1306_SETDISPLAYOFFSET)              ' 0xD3
        Write_Command_SSD1306(0x00)                                   ' no offset
    
        Write_Command_SSD1306(SSD1306_SETSTARTLINE | 0x00)            ' line #0
        Write_Command_SSD1306(SSD1306_CHARGEPUMP)                    ' 0x8D
    
        if (vccstate = SSD1306_EXTERNALVCC) then
          Write_Command_SSD1306(0x10)
        else
          Write_Command_SSD1306(0x14)
        end if
    
        Write_Command_SSD1306(SSD1306_MEMORYMODE)                    ' 0x20
        'Write_Command_SSD1306(0x00)                                  ' 0x00 act like ks0108 - DO NOT SELECT!!
        Write_Command_SSD1306(0x10)                                  ' 0x01 act like PCD8544
    
        Write_Command_SSD1306(SSD1306_SEGREMAP | 0x1)
        Write_Command_SSD1306(SSD1306_COMSCANDEC)
        Write_Command_SSD1306(SSD1306_SETCOMPINS)                    ' 0xDA
    
        #if GLCD_HEIGHT = 64
          Write_Command_SSD1306(0x12)                                 '64 pixels
        #endif
    
        #if GLCD_HEIGHT = 32
          Write_Command_SSD1306(0x02)                                 '32 pixels
        #endif
    
        Write_Command_SSD1306(SSD1306_SETCONTRAST)                   ' 0x81
        if vccstate = SSD1306_EXTERNALVCC then
          Write_Command_SSD1306(0x9F)
        else
          Write_Command_SSD1306(0xCF)
        end if
        Write_Command_SSD1306(SSD1306_SETPRECHARGE)                  ' 0xd9
        if vccstate = SSD1306_EXTERNALVCC then
          Write_Command_SSD1306(0x22)
        else
          Write_Command_SSD1306(0xF1)
        end if
    
        Write_Command_SSD1306(SSD1306_SETVCOMDETECT)                 ' 0xDB
        Write_Command_SSD1306(0x40)
    
        Write_Command_SSD1306(SSD1306_DISPLAYALLON_RESUME)           ' 0xA4
        Write_Command_SSD1306(SSD1306_NORMALDISPLAY)                 ' 0xA6
    
       'Clear screen Here
        GLCDCLS_SSD1306
    
        Write_Command_SSD1306(SSD1306_DISPLAYON)                     '--turn on oled panel
    
    End Sub
    
     

    Last edit: Joseph Realmuto 2017-08-28
  • bed

    bed - 2017-08-28

    Hi Joseph, wait 255 ms does not help :-(

     
  • Anobium

    Anobium - 2017-08-28

    Case placed on Hold.

    This is a LINUX compiler bug. I have asked for the files to examine this issue in detail.

    Please do not comment further.

     
    • Anobium

      Anobium - 2017-08-28

      The root cause is the Linux Distribution not the SSD1306 or any component library.

      The Linux distribution of v0.98.00 RC1 will be replaced. The files have been resolved with respect the errors reported. Please only use v0.98.00 RC2 of the Linux Distribution.

      The Linux distribution of v0.98.00 RC1 should not be used any further.

      Anobium

       
  • bed

    bed - 2017-08-28

    Congrats and thanks to evan and Joe, they are doing a superior job here. Best I hire them for my employer ;-)

    btw: the 6 Secondswait is gone, and reset issue also!!

     

    Last edit: bed 2017-08-28
  • stan cartwright

    stan cartwright - 2017-08-28

    These displays stop working after a few weeks sometimes, static, cloudy day,duff soldering...takes a while to realise it's broken. I buy 5 at a time.

     
    • bed

      bed - 2017-08-29

      Oh, that's odd. Yes I'have 3 pieces, always buy som more as the Customs barrier will allow

       
<< < 1 2 (Page 2 of 2)

Log in to post a comment.