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

    Hi Richard,
    Ordered a couple of st7920 displays for this and in the mean time I'm revisiting the Nokia display. 1 question: you're driving the 18F26K22 @64MHz for the sample codes; is that necessary? Can I drive the display using the same processor at, say, 16 MHz?

    Thanks,

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    1 question: you're driving the 18F26K22 @64MHz for the sample codes; is that necessary? Can I drive the display using the same processor at, say, 16 MHz?
    no not essential any speed will work, its just slower. the hw 12c / spi speeds can be tweaked in some cases to compensate
    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

    Hi Richard,
    I've received my "st7920" displays from China (at least they're supposed to be) but I can't get anything from them from running your original code attachments in post #26. I haven't tried any of the code in #27 yet as I'm having problems with the "st7920.pbpmod" code having duplicate subroutines???
    Anyway, can you possibly post a link or example of the wiring to this display. So far, I've connected all the 4 data lines, E bit, RS & RW bits to the declared PortB pins in your code. I've connected the V0 pin via a 10K pot and I've pulled up the serial/parallel selection pin to parallel selection and of course connected the power rails.

    Thanks,

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    for parallel i/f the connections are as defined
    'LCD defines begin here
    ' DEFINE LCD_BITS 4 'defines the number of data interface lines (4 or 8)
    ' DEFINE LCD_DREG PORTB 'defines the port where data lines are connected to
    ' DEFINE LCD_DBIT 0 'defines the position of data lines for 4-bit interface (0 or 4)
    ' DEFINE LCD_RSREG PORTB 'defines the port where RS line is connected to
    ' DEFINE LCD_RSBIT 6 'defines the pin where RS line is connected to
    ' DEFINE LCD_EREG PORTB 'defines the port where E line is connected to
    ' DEFINE LCD_EBIT 4 'defines the pin where E line is connected
    ' DEFINE LCD_COMMANDUS 1500 'defines the delay after LCDOUT statement
    ' DEFINE LCD_DATAUS 60 'delay in micro seconds
    ' DEFINE LCD_RWREG PORTB ' LCD read/write port
    ' DEFINE LCD_RWBIT 5 ' LCD read/write pin bit
    ' 'END of LCD DEFINES

    for serial i/f the connections are the mssp sdi sdo sck pins plus what you pick for st7920_cs
    the st7920_rst pin was not required in my tests.

    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

    I'm having problems with the "st7920.pbpmod" code having duplicate subroutines???
    there is no problem pbp just doesn't understand conditional compilation, ignore the warnings
    Last edited by richard; - 20th September 2022 at 01:51.
    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

    there is no problem pbp just doesn't understand conditional compilation, ignore the warnings
    Maybe it's because I thought I needed to compile that include file (on its own) where I probably don't?

    Anyway... hmmm... I'll recheck everything and maybe try the serial option if I can't get the parallel working. So far I can't see anything I was doing wrong.

    Cheers,

    Troy

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


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Maybe it's because I thought I needed to compile that include file (on its own)
    include files will seldom if ever compile on their own
    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

    include files will seldom if ever compile on their own
    Cool. I think the parallel version did which probably gave me the wrong assumptions. Anyway... couldn't get the parallel option working after trying both displays and throwing everything at it. I'm guessing there was a jumper fuse on the display that needed soldering closed to configure the data lines from 8 to 4, but I couldn't find any datasheet for the display so gave up that and went to serial. Took a bit of head scratching to match up the I2C lines to completely different labelled pads on the display, and then I finally got something from the display - a bunch of plain (non graphical looking) 1s and 0s. Took me 5-10 mins to figure out that's actually what was supposed to be there for the serial code - I was expecting demo graphics and large text - but that simply required copying over that stuff from the parallel code.
    So, good stuff again Richard. Hats off and thanks again for the assistance.

    Cheers,

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