SSD1306 INCLUDE for PBP3


Closed Thread
Results 1 to 40 of 102

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Re: SSD1306 INCLUDE for PBP3

    Hello,

    I need help getting this to work. My oled display does not respond at all and appears off. I'm running the sd1306_demo_16.pbp program. Everything compiles fine. I'm using a 16F1619. Here is what I've tried so far.

    1. I tried both the old and newer i2c.inc files
    2. Confirmed the oled works by using it on an Arduino
    3. Confirmed the proper oled address with the Arduino (0x3C). I made the change in the demo.pbp file
    4. Ran blink LED program on the PIC16F1619 to verify functionality
    5. Tried at lower 4Mhz clock speed
    6. Checked Clock and Data pins with scope to make sure data was being output to the display, it is
    7. Tried two other oled

    I'm not sure what else to try. I've never used an include file before so maybe I'm doing something wrong. I put all the include files and font files in the same folder as the .pbp file location.

    Code:
     '****************************************************************
    '*  Name    : ssd1306_DEMO.PBP                                   *
    '*  Author  : richard                                            *
    '*  Notice  :                                                    *
    '*          :                                                    *
    '*  Date    : 19/11/2017                                         *
    '*  Version :                                                    *
    '*  Notes   :                                                    *
    '*          :FOR pic 16F1619             SSD1306                 *
    '****************************************************************
    #CONFIG
        __config _CONFIG1,  _FOSC_INTOSC & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
        __config _CONFIG2,  _WRT_OFF & _PPS1WAY_OFF & _ZCD_OFF & _PLLEN_OFF & _STVREN_ON & _BORV_HI & _LVP_ON
        __config _CONFIG3,  _WDTCPS_WDTCPS6 & _WDTE_OFF & _WDTCWS_WDTCWS100 & _WDTCCS_LFINTOSC
    #ENDCONFIG
    
    
    define      OSC             32
    'define      OSC             4
     
    ; --- *** Oscillator  *** ---------------------------------------------------
    OSCCON = %11110000           ;32 MHz, 
    'OSCCON = %01101000           ;4 MHz, 
    ANSELb = 0
    ANSELA = 0
    ANSELC = 0
    
    char var byte
    x    var byte  
    y    var byte    
    BUFF VAR BYTE[16]
    ;use this define for hw i2c 
    ;#define hwi2c 1 
    #DEFINE PIC16 1 
    ;set and uncomment these to use softi2c
    SCL var PortB.6      ' I2C Clock PICpin 11
    SDA var PortB.4      ' I2C Data PICpin 13
    
    ;set these  to match display
    ssdheight con 7      ; 7 = 8 PAGES  64*128 ,  3 = 4 pages 32*128
    ssdwidth  con 127    ; 128 PIXELS WIDE
    'sdd1306_addr con $78
    sdd1306_addr con $3C
    Include "ssd1306_I2C.INC"  ' bring it in
    include "font7x5_16.bas"
    '==========================    MAIN  Routine    ==============================
    
    gosub glcd_init
    BIG_TEXT = 0
    
    
    looper:
        GLCD_CLR
        GLCDDHL 0,0,75,1       ;x,y,len,patten
        GLCDDHL 0,2,75,128
        GLCDDVL 0,0,3           ;x,y,height [in pages]
        GLCDDVL 75,0,3
        ;GLCDSTR  5,1,"--SSD1306--"   ;x,y, cont string    PIC 18 ONLY
        ARRAYWRITE BUFF,["--SSD1306--",0]
        GLCDSTR  5,1,BUFF
        ARRAYWRITE BUFF,["ABCDEF",0]
        CHAR="!"
        GLCDC 100,1,CHAR             ;x,y , chr
        BIG_TEXT = 1
        if ssdheight > 3  then
            GLCDSTR  2,4,BUFF
            ARRAYWRITE BUFF,["@12456-=#",0]
            BIG_TEXT = 0
            GLCDSTR  2,7,BUFF          ;x,y ,str buffer [null terminated]
        else
            pause 1000
            GLCD_CLR
            GLCDSTR  2,0,BUFF
            ARRAYWRITE BUFF,["@12456-=#",0]
            BIG_TEXT = 0
            GLCDSTR  2,3,BUFF
        endif
        PAUSE 3000
    GOTO looper
    
    END

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,721


    Did you find this post helpful? Yes | No

    Default Re: SSD1306 INCLUDE for PBP3

    3. Confirmed the proper oled address with the Arduino (0x3C). I made the change in the demo.pbp file
    arduino use a 7 bit address pbp uses an 8 bit addresss , correct address to use is (arduino address)<<1
    0x3c<<1 = 0x78
    Warning I'm not a teacher

  3. #3
    Join Date
    Feb 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Re: SSD1306 INCLUDE for PBP3

    thanks Richard,

    I had no idea. I changed the address back to 0x78 just now and I still don't get anything on the screen. I get this ASM Warning in the results window after compiling. Not sure if it matters

    [ASM WARNING] SD1306_DEMO_16.ASM (400) : Found label after column 1. (GLCD_BAR?CCBWC)
    [ASM WARNING] SD1306_DEMO_16.ASM (432) : Found label after column 1. (GLCD_BAR?CCBWC)

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,721


    Did you find this post helpful? Yes | No

    Default Re: SSD1306 INCLUDE for PBP3

    I get this ASM Warning in the results window after compiling. Not sure if it matters

    [ASM WARNING] SD1306_DEMO_16.ASM (400) : Found label after column 1. (GLCD_BAR?CCBWC)

    [ASM WARNING] SD1306_DEMO_16.ASM (432) : Found label after column 1. (GLCD_BAR?CCBWC)
    it does matter, it means you are not compiling the code you posted.
    Found label after column 1 means the macro you are trying to compile does not exist.

    the GLCD_BAR usercommand does not exist in the original include it was added to for louis' setup and only a small subset of input var combinations are
    catered for. i have not tested the added code and am not sure what louis wound up with.

    get the demo working first



    Warning I'm not a teacher

  5. #5
    Join Date
    Feb 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Re: SSD1306 INCLUDE for PBP3

    thanks, I went back and used the original ssd1306_I2C.inc. Now no warning when I compile. With no changes to the demo I still can't get anything to show on the oled. To make sure the oled hardware is still good I just checked it with the arduino and it's working fine. I've triple checked my wiring and don't see any mistakes.

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,721


    Did you find this post helpful? Yes | No

    Default Re: SSD1306 INCLUDE for PBP3

    i havent used one of those displays for some time ,my other demo for a pic16f1619 used the mssp i2c module
    try this ,it worked on my curiosity board , plugged straight in to click socket
    Code:
     '****************************************************************
    '*  Name    : ssd1306_DEMO.PBP                                   *
    '*  Author  : richard                                            *
    '*  Notice  :                                                    *
    '*          :                                                    *
    '*  Date    : 19/11/2017                                         *
    '*  Version :                                                    *
    '*  Notes   : plugs into click port note !!!!sda/scl     swapped on click skt*
    '*          :FOR pic 16F1619             SSD1306                 *
    '****************************************************************
    #CONFIG
        __config _CONFIG1,  _FOSC_INTOSC & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
        __config _CONFIG2,  _WRT_OFF & _PPS1WAY_OFF & _ZCD_OFF & _PLLEN_OFF & _STVREN_ON & _BORV_HI & _LVP_ON
        __config _CONFIG3,  _WDTCPS_WDTCPS6 & _WDTE_OFF & _WDTCWS_WDTCWS100 & _WDTCCS_LFINTOSC
    #ENDCONFIG
    
    
    
    
    define      OSC             32
    
    
     
    ; --- *** Oscillator  *** ---------------------------------------------------
    OSCCON = %11110000           ;32 MHz, 
    ANSELb = 0
    ANSELA = 0
    ANSELC = 0
    
    
    char var byte
    x    var byte  
    y    var byte    
    BUFF VAR BYTE[16]
    ;use this define for hw i2c 
    #define hwi2c 1 
    #DEFINE PIC16 1 
    ;set and uncomment these to use softi2c
    'SCL var PortB.4      ' I2C Clock
    'SDA var PortB.6      ' I2C Data
    RB VAR WORD
    ;set these  to match display
    ssdheight con 7      ; 7 = 8 PAGES  64*128 ,  3 = 4 pages 32*128
    ssdwidth  con 127    ; 128 PIXELS WIDE
    sdd1306_addr con $78
    Include "ssd1306_I2C.INC"  ' bring it in
    include "font7x5_16.bas"
    '==========================    MAIN  Routine    ==============================
    TRISB = $F0;
    PPSLOCK = $55;
    PPSLOCK = $AA;
    PPSLOCK = 0 ;     unlock PPS
    SSPCLKPPS = $0C;   //RB4->MSSP:SCL;
    SSPDATPPS = $0E;   //RB6->MSSP:SDA;
    RB6PPS = $11;   //RB6->MSSP:SDA;
    RB4PPS = $10;   //RB4->MSSP:SCL;
    PPSLOCK = $55;
    PPSLOCK = $AA;
    PPSLOCK = 1; ; lock PPS   
    
    
    gosub glcd_init
    GLCD_CLR
    BIG_TEXT = 0
    ARRAYWRITE BUFF,["READY",0]
    GLCDSTR 10,1,BUFF
    Warning I'm not a teacher

  7. #7
    Join Date
    Feb 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Re: SSD1306 INCLUDE for PBP3

    unfortunately I don't get anything on the oled

Similar Threads

  1. SSD1306 Include example
    By timc in forum Code Examples
    Replies: 11
    Last Post: - 28th November 2017, 08:53
  2. SSD1306 start display problem
    By harryweb in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th December 2016, 19:16
  3. Using INCLUDE to add a text file in PBP3
    By Sumobob in forum PBP3
    Replies: 4
    Last Post: - 16th May 2016, 18:56
  4. PBP3 to include 18F97J94?
    By fowardbias in forum PBP3
    Replies: 1
    Last Post: - 18th December 2013, 16:42
  5. Help With OLED Display / 128X64 SSD1306
    By Denner in forum General
    Replies: 6
    Last Post: - 25th May 2013, 15:40

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts