Graphical Displays with PBP3


+ Reply to Thread
Results 1 to 40 of 115

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    I've just tried that but I'm confused: I can pick a standard font and make something up from that using the tool, but what do I do then? Do I "export" it? Exporting, produces the matrix of hex codes for the font graphics but that's all it produces. The largenum and bigchar files you included have many lines of headers? footers? whatever... above and below the font dot matrix codes and the export button that I'm clicking doesn't appear to generate any of that and it's not really clear what those lines are?

    Regards,

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Warning I'm not a teacher

  3. #3
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Thanks. That link eventually lead to the TFT export option needing to be visible to click on. Alas, that appears not useful without some kind of description of what those headers represent. Intuitively I would've thought they'd be some kind of memory addressing but they can't be. The 1st column looks like the font width but no idea what the second byte represents?

    Regards,

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    you need to be more explicit, i cannot see the problem

    here is the raw " C " code as exported for chrs 48 to 60 as 11 x 16 sized font

    you simply need to make it comply with pbp limitations , thats it you don't have to understand it
    its pretty simple anyway

    0x00, unused
    0x00, unused
    0x30,0x00, first chr
    0x3C,0x00, last chr
    0x10, height
    0x00,

    0x0B,0x3C,0x00,0x00, width of chr1. offset to font data for chr 1
    0x0A,0x5C,0x00,0x00, width of chr2. offset to font data for chr2
    0x0B,0x7C,0x00,0x00, width of chr3. offset to font data for chr 3
    ...



    Code:
    //Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
    //MikroElektrnika 2011 
    //http://www.mikroe.com 
    
    
    //GLCD FontName : Terminal11x16
    //GLCD FontSize : 11 x 16
    
    
    const unsigned short Terminal11x16[] = {
       0x00,
       0x00,
       0x30,0x00,
       0x3C,0x00,
       0x10,
       0x00,
       0x0B,0x3C,0x00,0x00,
       0x0A,0x5C,0x00,0x00,
       0x0B,0x7C,0x00,0x00,
       0x0B,0x9C,0x00,0x00,
       0x0B,0xBC,0x00,0x00,
       0x0B,0xDC,0x00,0x00,
       0x0B,0xFC,0x00,0x00,
       0x0B,0x1C,0x01,0x00,
       0x0B,0x3C,0x01,0x00,
       0x0B,0x5C,0x01,0x00,
       0x06,0x7C,0x01,0x00,
       0x06,0x8C,0x01,0x00,
       0x09,0x9C,0x01,0x00,
       0xF8,0x00,0xFE,0x03,0x06,0x03,0x03,0x07,0x83,0x07,0xC3,0x06,0x63,0x06,0x33,0x06,0x1B,0x06,0x0F,0x06,0x07,0x06,0x06,0x03,0xFE,0x03,0xF8,0x00,0x00,0x00,0x00,0x00, // Code for char num 48
       0x60,0x00,0x70,0x00,0x7C,0x00,0x7C,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0xFC,0x03,0xFC,0x03,0x00,0x00,0x00,0x00, // Code for char num 49
       0xFC,0x01,0xFE,0x03,0x07,0x07,0x03,0x06,0x03,0x07,0x80,0x03,0xC0,0x01,0xE0,0x00,0x70,0x00,0x38,0x00,0x1C,0x00,0x0E,0x00,0xFF,0x07,0xFF,0x07,0x00,0x00,0x00,0x00, // Code for char num 50
       0xFC,0x01,0xFE,0x03,0x07,0x07,0x03,0x06,0x00,0x06,0x00,0x07,0xF8,0x03,0xF8,0x01,0x00,0x03,0x00,0x06,0x03,0x06,0x07,0x07,0xFE,0x03,0xFC,0x01,0x00,0x00,0x00,0x00, // Code for char num 51
       0xC0,0x01,0xE0,0x01,0xF0,0x01,0xB8,0x01,0x9C,0x01,0x8E,0x01,0x87,0x01,0x83,0x01,0xFF,0x07,0xFF,0x07,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x00,0x00,0x00,0x00, // Code for char num 52
       0xFF,0x07,0xFF,0x07,0x03,0x00,0x03,0x00,0x03,0x00,0xFF,0x01,0xFE,0x03,0x00,0x07,0x00,0x06,0x00,0x06,0x03,0x06,0x07,0x07,0xFE,0x03,0xFC,0x01,0x00,0x00,0x00,0x00, // Code for char num 53
       0xE0,0x01,0xF0,0x01,0x38,0x00,0x1C,0x00,0x0E,0x00,0x06,0x00,0xFF,0x01,0xFF,0x03,0x07,0x07,0x03,0x06,0x03,0x06,0x07,0x07,0xFE,0x03,0xFC,0x01,0x00,0x00,0x00,0x00, // Code for char num 54
       0xFF,0x07,0xFF,0x07,0x00,0x03,0x00,0x03,0x80,0x01,0x80,0x01,0xC0,0x00,0xC0,0x00,0x60,0x00,0x60,0x00,0x30,0x00,0x30,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00, // Code for char num 55
       0xF8,0x00,0xFC,0x01,0x8E,0x03,0x06,0x03,0x06,0x03,0x8E,0x03,0xFC,0x01,0xFE,0x03,0x07,0x07,0x03,0x06,0x03,0x06,0x07,0x07,0xFE,0x03,0xFC,0x01,0x00,0x00,0x00,0x00, // Code for char num 56
       0xFC,0x01,0xFE,0x03,0x07,0x07,0x03,0x06,0x03,0x06,0x07,0x07,0xFE,0x07,0xFC,0x07,0x00,0x03,0x80,0x03,0xC0,0x01,0xE0,0x00,0x7C,0x00,0x3C,0x00,0x00,0x00,0x00,0x00, // Code for char num 57
       0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x00,0x00,0x00,0x38,0x38,0x38,0x00,0x00,0x00, // Code for char num 58
       0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x00,0x00,0x00,0x38,0x38,0x38,0x30,0x30,0x18, // Code for char num 59
       0x80,0x01,0xC0,0x01,0xE0,0x00,0x70,0x00,0x38,0x00,0x1C,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x00,0x38,0x00,0x70,0x00,0xE0,0x00,0xC0,0x01,0x80,0x01,0x00,0x00,0x00,0x00 // Code for char num 60
            };
    becomes

    Code:
    ;//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
    ;//MikroElektrnika 2011 
    ;//http://www.mikroe.com 
    ;
    ;//GLCD FontName : Terminal11x16
    ;//GLCD FontSize : 11 x 16
    ;
    ;const unsigned short Terminal11x16[] = {
       0x00,0x00
       
       0x30,0x00
       0x3C,0x00
       0x10,0x00
       
       0x0B,0x3C,0x00,0x00
       0x0A,0x5C,0x00,0x00
       0x0B,0x7C,0x00,0x00
       0x0B,0x9C,0x00,0x00
       0x0B,0xBC,0x00,0x00
       0x0B,0xDC,0x00,0x00
       0x0B,0xFC,0x00,0x00
       0x0B,0x1C,0x01,0x00
       0x0B,0x3C,0x01,0x00
       0x0B,0x5C,0x01,0x00
       0x06,0x7C,0x01,0x00
       0x06,0x8C,0x01,0x00
       0x09,0x9C,0x01,0x00
       0xF8,0x00,0xFE,0x03,0x06,0x03,0x03,0x07,0x83,0x07,0xC3,0x06,0x63,0x06,0x33,0x06,0x1B,0x06,0x0F,0x06,0x07,0x06,0x06,0x03,0xFE,0x03,0xF8,0x00,0x00,0x00,0x00,0x00 ; Code for char num 48
       0x60,0x00,0x70,0x00,0x7C,0x00,0x7C,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0xFC,0x03,0xFC,0x03,0x00,0x00,0x00,0x00 ; Code for char num 49
       0xFC,0x01,0xFE,0x03,0x07,0x07,0x03,0x06,0x03,0x07,0x80,0x03,0xC0,0x01,0xE0,0x00,0x70,0x00,0x38,0x00,0x1C,0x00,0x0E,0x00,0xFF,0x07,0xFF,0x07,0x00,0x00,0x00,0x00 ; Code for char num 50
       0xFC,0x01,0xFE,0x03,0x07,0x07,0x03,0x06,0x00,0x06,0x00,0x07,0xF8,0x03,0xF8,0x01,0x00,0x03,0x00,0x06,0x03,0x06,0x07,0x07,0xFE,0x03,0xFC,0x01,0x00,0x00,0x00,0x00 ; Code for char num 51
       0xC0,0x01,0xE0,0x01,0xF0,0x01,0xB8,0x01,0x9C,0x01,0x8E,0x01,0x87,0x01,0x83,0x01,0xFF,0x07,0xFF,0x07,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x00,0x00,0x00,0x00 ; Code for char num 52
       0xFF,0x07,0xFF,0x07,0x03,0x00,0x03,0x00,0x03,0x00,0xFF,0x01,0xFE,0x03,0x00,0x07,0x00,0x06,0x00,0x06,0x03,0x06,0x07,0x07,0xFE,0x03,0xFC,0x01,0x00,0x00,0x00,0x00 ; Code for char num 53
       0xE0,0x01,0xF0,0x01,0x38,0x00,0x1C,0x00,0x0E,0x00,0x06,0x00,0xFF,0x01,0xFF,0x03,0x07,0x07,0x03,0x06,0x03,0x06,0x07,0x07,0xFE,0x03,0xFC,0x01,0x00,0x00,0x00,0x00 ; Code for char num 54
       0xFF,0x07,0xFF,0x07,0x00,0x03,0x00,0x03,0x80,0x01,0x80,0x01,0xC0,0x00,0xC0,0x00,0x60,0x00,0x60,0x00,0x30,0x00,0x30,0x00,0x18,0x00,0x18,0x00,0x00,0x00,0x00,0x00 ; Code for char num 55
       0xF8,0x00,0xFC,0x01,0x8E,0x03,0x06,0x03,0x06,0x03,0x8E,0x03,0xFC,0x01,0xFE,0x03,0x07,0x07,0x03,0x06,0x03,0x06,0x07,0x07,0xFE,0x03,0xFC,0x01,0x00,0x00,0x00,0x00 ; Code for char num 56
       0xFC,0x01,0xFE,0x03,0x07,0x07,0x03,0x06,0x03,0x06,0x07,0x07,0xFE,0x07,0xFC,0x07,0x00,0x03,0x80,0x03,0xC0,0x01,0xE0,0x00,0x7C,0x00,0x3C,0x00,0x00,0x00,0x00,0x00 ; Code for char num 57
       0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x00,0x00,0x00,0x38,0x38,0x38,0x00,0x00,0x00 ; Code for char num 58
       0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x00,0x00,0x00,0x38,0x38,0x38,0x30,0x30,0x18 ; Code for char num 59
       0x80,0x01,0xC0,0x01,0xE0,0x00,0x70,0x00,0x38,0x00,0x1C,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x00,0x38,0x00,0x70,0x00,0xE0,0x00,0xC0,0x01,0x80,0x01,0x00,0x00,0x00,0x00 ; Code for char num 60
    ;        };
    Warning I'm not a teacher

  5. #5
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Thanks Richard. DUH [slapping forehead again]. I didn't read them properly, nevertheless, you told me everything and more with that description and I'm once again eternally grateful.

    Cheers,

    Troy

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


    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

  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

    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: 40542
Size:  343.9 KB Name:  20240223_133312.jpg
Views: 40603
Size:  322.1 KB
    Shawn

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    one more thing
    both pbp and mpasm have limitations on line length , exceed them at your peril

    and always have an even number of bytes ie not odd on every line line other wise pbp will pad the odd byte with an extra 00 the offset indexing will fail.
    do not add or delete any byte to the file or else the offset indexing will fail.
    Warning I'm not a teacher

  9. #9
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Got it and working perfectly

    Thanks again,

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Quote Originally Posted by richard View Post
    and always have an even number of bytes ie not odd on every line line other wise pbp will pad the odd byte with an extra 00 the offset indexing will fail.
    do not add or delete any byte to the file or else the offset indexing will fail.
    Good info! Thanks.
    Is this referred to somewhere?

    Ioannis

  11. #11
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Richard,
    I'm just starting to experiment with displaying a simple number count ie. clearing the screen, incrementing a number and displaying that number using the larger numerical font and looping that process. So, everything's good until I'm getting to either 6 or 7 loops (doesn't matter what number I start with) and then something happens. The count stops where it should be displayed and appears to continue... like... 20 or so pixels above the nominated location and the font is now only 1 pixel high.
    Any ideas what's happening or what I'm doing wrong?


    Code:
        DEFINE OSC 64
    
    
       
        #DEFINE colours 1   ;1 mono 2 rg or 3 rgb
        width  con 128      ;
        height con 64      ;
        'use serial i/f
        #define  stserial 1
        include "grx.pbpMOD" 
        include "st7920b.pbpmod" 
        include "font.bas"
        include "bignum.bas"       
        include "bigchr.bas"
        BUFF       VAR BYTE[4]
        ani_h var word  bank0
        ani_r var byte
        ani_c var byte
        OSCCON=$70
        OSCTUNE.6=1
        while ! osccon2.7 :WEND    ;wait for pll
        ANSELB=0
        ANSELC=0
        ANSELA=0 
        
        'trisc = %11010101 ;cs,sck,sdo are output
        trisc = %11010101 ;cs,sck,sdo are output
        TRISB = %11111111
        TRISA = %11111111
    
                  
    n var word
    
        gosub st7920_init    'graphic mode
    
        OSCCON=$70
        OSCTUNE.6=1
        while ! osccon2.7 :WEND    ;wait for pll
        
        ANSELB=0
        ANSELC=0
        ANSELA=0 
        
        Pause  500      ' LCD initialize time
        lcdout $FE,1
        gosub st7920_init    'graphic mode
    
        n=0
        
     main
     
        gosub grf_clr
        n= n+1
        SETFONT bignum
        ARRAYWRITE BUFF,[dec4 n]
        DMDSTR 40,30, Buff,1
        gosub show 
        pause 1000
        
     goto main

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 : 25

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