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,644


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    as in my demo
    Code:
        Pause  1500      ' LCD initialize time
        lcdout $FE,1
        gosub st7920_init    'graphic mode
    Warning I'm not a teacher

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    [mega facepalm] DUH!!!

    Thanks Richard.

    Troy

  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

    Well, the zeros are still appearing even with up to 5 consecutive commands to clear the character memory. However, probably not as often. Definitely is text in the character display memory that's causing it - no doubt about it, but I'm also sure I'm doing something wrong with either the wiring or initialisation. Probably tolerable for now.

    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

    at one stage i did init like this

    st7920_init:
    lcdout $FE,$24 'In same instruction cannot alter DL, RE and G at once. Make sure that change DL or G first and then RE.
    Pause 5
    lcdout $FE,$26
    Pause 5
    bgcolour = 0
    colour = 1
    return


    also look at defines' these may need a fiddle if you display is slower than mine
    DEFINE LCD_COMMANDUS 1000 'defines the delay after LCDOUT statement DEFINE LCD_DATAUS 40 'delay in micro seconds


    ps i changed to serial mode, perhaps thats why , i forget
    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

    Quote Originally Posted by richard View Post
    at one stage i did init like this

    st7920_init:
    lcdout $FE,$24 'In same instruction cannot alter DL, RE and G at once. Make sure that change DL or G first and then RE.
    Pause 5
    lcdout $FE,$26
    Pause 5
    bgcolour = 0
    colour = 1
    return


    also look at defines' these may need a fiddle if you display is slower than mine
    DEFINE LCD_COMMANDUS 1000 'defines the delay after LCDOUT statement DEFINE LCD_DATAUS 40 'delay in micro seconds


    ps i changed to serial mode, perhaps thats why , i forget

    No luck. Maybe 1 in 10 starts I still get the zeros. Tried increasing the DEFINE LCD_COMMANDUS 1000 to 1500 and DEFINE LCD_DATAUS to 100 and inserted the code you suggested. I didn't mention I need to call the graphic mode initialisation routine a few times to get a reasonably reliable initialisation which might trigger alarm bells? So, my hunch is the display might be slightly different or my wiring is missing something: I've wired up RS, E, RW and the 4 high bits of the data bus and 5V rails. I can't think of anything else?

    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

    does it make a difference if you power it down verses a reset >\?

    also if you look at the data sheet you can see what commands are needed to make a routine to revert to lcd mode, do a clear screen then return to graphics mode
    Warning I'm not a teacher

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Quote Originally Posted by richard View Post
    does it make a difference if you power it down verses a reset >\?

    also if you look at the data sheet you can see what commands are needed to make a routine to revert to lcd mode, do a clear screen then return to graphics mode
    Haven't tried 1st suggestion yet, but I've been playing around with your 2nd suggestion... well... I can't find a datasheet for my displays so I've been playing the old game of finding a ST7920 DS with commands that might be close enough. So, I found one that lists a command that turns the graphics display on / off. So, I've tried simulating the issue and it goes like this:

    init code
    ...
    run some st7920_init calls with pauses
    ...
    ...
    your extra LCD commands...
    ...
    pause 1000
    lcdout $FE, %00100100 'Command to turn off graphics mode
    pause 1000
    lcdout $FE,1,"123" 'clear screen and display 123 in top left corner in text mode - the numbers 123 *are* displayed in the top left
    pause 1000
    lcdout $FE,1 'Clear screen for text mode - screen *is* cleared
    pause 1000

    lcdout $FE, %00100110 'command to turn graphics mode back on - screen still cleared (replacing this with "gosub st7920_init" produces the same outcome)

    gosub grf_clr 'clear graphics display
    colour = 1
    FILLRECT 5,35,120,8
    ARRAYWRITE BUFF2,["WAITING FOR LOAD CELL",0]
    DMDSTR 5,10, BUFF2,1
    ARRAYWRITE BUFF3,["SERIAL STREAM",0]
    DMDSTR 5,25, BUFF3,1
    gosub show 'here the stuff just here (supposed to be displayed) is displayed BUT my 123 text in the top left has also reappeared which is supposed to be cleared whilst in text mode

    ?????

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