Graphical Displays with PBP3


+ Reply to Thread
Results 1 to 40 of 115

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    bmp bug fix
    Attached Files Attached Files
    Warning I'm not a teacher

  2. #2
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Quote Originally Posted by richard View Post
    bmp bug fix
    Working much better, but in my case it is cropping 6 columns off of the right side of the image (110x64). Using the pbp file I uploaded here

    Here are 2 images of what it should look like (using SSDBM vs what is being displayed using DMDBMP.

    Name:  20240222_111640.jpg
Views: 41563
Size:  343.9 KB Name:  20240223_133312.jpg
Views: 41627
Size:  322.1 KB
    Shawn

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    the bmp image width needs to be a multiple of 8 by the look of it
    post the original bmp image if you want me to look further into it
    Warning I'm not a teacher

  4. #4
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Ok, I assume that is due to the horizontal vs vertical byte layout? I know on the SSDBM you said height must be multiple of 8 which I have been adhering to. I'll either stick to using the SSDBM with this driver as it seems to do exactly what I need or revise the bitmaps to make width a multiple of 8.
    Shawn

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    i have had a look at how those programs [lcdassist and glcd tool] manage the remainder bits when a bitmap is not an 8bit multiple in width
    and it defeats me , i cannot get how the "stray" bits of the image width are packed into the data
    if you lay the data out to match the actual width x height as i have done here
    [the last column i filled in manually only partially to get an idea of what the data needs to look like ]
    the "left over" 48 bytes at the end somehow represents the extreme rhs 6 bits , i don't see how to extract the data correctly.
    6 bits * 48 bytes is 384 bits , the stray 6 bits of width x 64 lines of height is 384 bits so there is enough information at least.
    [assuming i have not misconstrued the original image]

    Code:
    OneIcon: '110x64 horiz
    @ db 112, 0x40 
    @ db 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xfc
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0x00, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x80, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x80, 0x00, 0x00,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x80, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xC0, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xC0, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xE0, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xF0, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xF0, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xF8, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xF8, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFE, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0x80, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x80, 0x00  ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xC0, 0x00  ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xE0, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xF0, 0x00  ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFC, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFE, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0x80 ,0
    @ db 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0 ,0
    @ db 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8,0
    @ db 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC ,0
    @ db 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF  ,0
    @ db 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF  ,0
    @ db 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF  ,0
    @ db 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF  ,0
    @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00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ,0
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x04
    @ db 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,0xfc
    
    
    '@ db 0xFC, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x01, 0x00, 0x04, 0x00
    '@ db 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x11, 0x00, 0x00, 0x00, 0x18, 0x00, 0x01, 0x00
    '@ db 0x1A, 0x00, 0x04, 0x00, 0x28, 0x00, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00, 0x4A, 0x02, 0x00, 0x00
    Warning I'm not a teacher

  6. #6
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Is there a way to do 90 degree screen rotation (using the display in portrait mode) for the text using fonts to be displayed correct?

    Changing the SSDc $20 address to $01 seems to corrupt everything, so I'm not sure if I am going down the correct path with that, or if there is a simple way to accomplish this already built in?
    Last edited by spcw1234; - 24th February 2024 at 16:39.
    Shawn

  7. #7
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    The display layout still isn't quite right. Here is a simple program that displays a 16x16 image in all 4 corners the ones on the left side are good, but the right side locations are wrong.

    Code:
    'PIC18F26K22
    #CONFIG
      CONFIG  FOSC = INTIO67
      CONFIG  PLLCFG = ON
      CONFIG  PRICLKEN = ON
      CONFIG  FCMEN = OFF
      CONFIG  IESO = OFF
      CONFIG  PWRTEN = ON
      CONFIG  BOREN = SBORDIS
      CONFIG  BORV = 190
      CONFIG  WDTEN = ON
      CONFIG  WDTPS = 32768
      CONFIG  CCP2MX = PORTC1
      CONFIG  PBADEN = OFF
      CONFIG  CCP3MX = PORTB5                                
      CONFIG  T3CMX = PORTC0
      CONFIG  HFOFST = ON
      CONFIG  P2BMX = PORTB5
      CONFIG  MCLRE = EXTMCLR
      CONFIG  STVREN = ON
      CONFIG  LVP = OFF
      CONFIG  XINST = OFF
      CONFIG  DEBUG = OFF
      CONFIG  CP0 = OFF
      CONFIG  CP1 = OFF
      CONFIG  CP2 = OFF
      CONFIG  CP3 = OFF
      CONFIG  CPB = OFF
      CONFIG  CPD = OFF
      CONFIG  WRT0 = OFF
      CONFIG  WRT1 = OFF
      CONFIG  WRT2 = OFF
      CONFIG  WRT3 = OFF
      CONFIG  WRTC = OFF
      CONFIG  WRTB = OFF
      CONFIG  WRTD = OFF
      CONFIG  EBTR0 = OFF
      CONFIG  EBTR1 = OFF
      CONFIG  EBTR2 = OFF
      CONFIG  EBTR3 = OFF
      CONFIG  EBTRB = OFF
    #ENDCONFIG       
    DEFINE OSC 64
        clear
        ssd1306_addr con $78 
        #DEFINE colours 1   ;1 mono 2 rg or 3 rgb
        width  con 128      
        height con 64      
        h_offset con 0
        
        include "grx.pbpMOD" 
        include "SSD1306.pbpMOD"
        BUFF     VAR BYTE[32]
        ANSELB=0
        ANSELC=0
        ANSELA=0
        OSCCON=$70
        OSCTUNE.6=1
        gosub glcd_init
        gosub grf_clr
        gosub show 
    
    main:     ' Rotate icon clockwise around display corners
        DMDBMP 0,0,TestIcon       'top left 16x16 CORRECT PLACEMENT!
        gosub show
        pause 1000
        gosub grf_clr
        gosub show
        
        DMDBMP 111,0,TestIcon       'top right 16x16 WRONT PLACEMENT!
        gosub show
        pause 1000
        gosub grf_clr
        gosub show   
        
        DMDBMP 111,47,TestIcon       'bottom right 16x16 WRONG PLACEMENT!
        gosub show
        pause 1000
        gosub grf_clr
        gosub show   
    
        DMDBMP 0,47,TestIcon       'bottom left 16x16 CORRECT PLACEMENT!
        gosub show
        pause 1000
        gosub grf_clr
        gosub show   
    goto main 
     
    end
    
    TestIcon:
    @ db 0x10,0x10 ;16x16
    @ db 0xFF,0xFF;
    @ db 0xC0,0x03;
    @ db 0xA0,0x05;
    @ db 0x90,0x09;
    @ db 0x88,0x11;
    @ db 0x84,0x21;
    @ db 0x82,0x41;
    @ db 0x81,0x81;
    @ db 0x81,0x81;
    @ db 0x82,0x41;
    @ db 0x84,0x21;
    @ db 0x88,0x11;
    @ db 0x90,0x09;
    @ db 0xA0,0x05;
    @ db 0xC0,0x03;
    @ db 0xFF,0xFF;
    Name:  Untitled-1.jpg
Views: 42005
Size:  310.6 KB Name:  Untitled-2.jpg
Views: 41728
Size:  292.2 KB Name:  Untitled-3.jpg
Views: 42043
Size:  280.0 KB Name:  Untitled-4.jpg
Views: 41731
Size:  277.8 KB
    Last edited by spcw1234; - 24th February 2024 at 19:04. Reason: Added images
    Shawn

Similar Threads

  1. Replies: 3
    Last Post: - 1st January 2021, 21:28
  2. problem using Graphical LCD
    By Mostafa in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th July 2007, 18:15
  3. Graphical LCDs
    By T.Jackson in forum General
    Replies: 5
    Last Post: - 14th May 2007, 06:29
  4. Vb 6.0 Graphical plug in
    By rocky79 in forum Serial
    Replies: 0
    Last Post: - 8th March 2006, 18:42
  5. Graphical user interface
    By rocky79 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th October 2005, 12:25

Members who have read this thread : 26

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