Graphical Displays with PBP3


+ Reply to Thread
Results 1 to 40 of 116

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    I've isolated the problem is somewhere within the "show" call. Not sure what it is, but that's definitely the issue. Also, I'm not totally convinced FILLRECT works properly either. DRAWRECT definitely works better for me.

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    post your code and i will have a look
    it works ok for me

    https://youtu.be/Jxd4a4XmuDo



    Code:
    '****************************************************************
    '*  Name    : UNTITLED.BAS                                      *
    '*  Author  : richard                                           *
    '*  Notice  : Copyright (c) 2022 caveat emptor                  *
    '*          : All Rights Reserved                               *
    '*  Date    : 11/10/2022                                        *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    #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 = OFF
      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
        DEFINE DEBUG_REG PORTB
        DEFINE DEBUG_BIT 7
        DEFINE DEBUG_BAUD 9600
        DEFINE DEBUG_MODE 0
        LATB.7=1
    
    
       
        #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 "st7920.pbpmod" 
        include "font.bas"
        include "bignum.bas"       
        include "bigchr.bas"
        BUFF       VAR BYTE[32]
        OSCCON=$70
        OSCTUNE.6=1
        while ! osccon2.7 :WEND    ;wait for pll
        ANSELB=0
        ANSELC=0
        ANSELA=0 
    '      serial   spi pins used
    '      e is sck        latc.3
    '      rw is sdo       latc.5
    '      rs is cs         latc.1
        '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
        gosub grf_clr
        n=0
        SETFONT bignum
        bgcolour=0
        
     main:   
        n= n+1
        colour=1
        fillrect 39,29,46,16 ; this is a guess about your font size
        ARRAYWRITE BUFF,[dec4 n,0]
        DMDSTR 40,30, Buff,0
        colour=0
        fillrect 39,9,46,16 ; this is a guess about your font size    
        DMDSTR 40,10, Buff,1
        gosub show 
        pause 1000
        
     goto main
    
    Warning I'm not a teacher

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Damn, maybe its my display modules. Your latest code doesn't appear to work properly either on mine.

    So close... everything appears to display correctly* but craps itself after a few screen redraws

    Troy

    *with the exception of FILLRECT

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    i fiddle with the files to suit other projects maybe what you have is out of date
    Attached Files Attached Files
    Warning I'm not a teacher

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    No luck. There is something I should've mentioned though: in post #31 you list the pin connections:

    for a 26k22 i used
    'spi pins used
    'st7920_rst var latc.0
    st7920_cs var latc.1
    'st7920_sck is latc.3
    'st7920_sdi is latc.4
    'st7920_sdo is latc.5

    Now, I don't have "st7920_sdi is latc.4" connected because I have no idea what to connect it to. Could that be the killer?

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    no it has no connection , but its best not to try and use that pin for other purposes the mssp module owns it
    the only other conn i have is psb is grounded
    are you using my exact code ?
    Warning I'm not a teacher

  7. #7
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Yeah, started out with the exact code, those latest graphics and LCD controller files and then (after running that) started tweaking the demo code in an attempt to get something working. Can post a video of the output if that helps or happy to send you a module if you're interested in trying one. I've ordered another flavour of st7920 controlled displays from China, so fingers crossed it's better behaved.

    Troy

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

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