My "Library" for ST7920 Graphical displays, works fine, but...


Closed Thread
Results 1 to 32 of 32

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    453


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

    Default Re: My "Library" for ST7920 Graphical displays, works fine, but...

    using I2C, but use PIC running at say 32mhz (instead of current 8mhz), will this result 4x times faster reading speed or not?
    If you're running at 8MHz then no wonder everything is slow.

    32MHz (or 64MHz for something like an 18F26K22) would definitely be faster, way faster.
    The I2C won't necessarily be a lot faster on its own (that depends on how I2CREAD is written), but you can almost bet that it will be.
    One thing is for sure, everything else will be much faster.

    Getting the pic I2C to run at much more than 400KHz depends on the chip and your hdw.
    I2CREAD probably won't do it even running at 32MHz, but the MSSP can if you have pullups with a low enough value.
    You won't get 1MHz out of it, but it's possible to get about 800KHz or so given the right setup.

    The SPI on a pic tops out at about 8-10MHz, but the selection of available clocks depends on the chip.
    I've been able to get 16MHz on a few select 18F devices but that's about the max that the IO pins can do.

    There are a lot of benefits to switching to a more modern chip, esp a PIC18F.
    I usually like to use a K22, K40, or Q10 for general stuff.
    The more recent the chip the cheaper it will be (but I don't buy 2nd hand chips from china).

    Measure what, I2C clock frequency?
    That's where I always start. That'll let you know the max performance you're getting, and rules out a bunch of other stuff that can mask it.
    A few poorly placed delay calls can ruin everything, no matter what speed you're running at.

    For example, that SPI code has a totally unnecessary delay call in the read portion that does absolutely nothing but slow down the program (I think it was a 25us delay???).
    Last edited by tumbleweed; - 18th May 2022 at 12:04.

  2. #2
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: My "Library" for ST7920 Graphical displays, works fine, but...

    Well, I don't see anything to be slow at 8mhz, except I2C
    Had no time today, will measure I2C frequency tomorrow and post back....

  3. #3
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: My "Library" for ST7920 Graphical displays, works fine, but...

    Ok, measured I2C CLK speed. it is about 48khz. So I guess, this is the main issue, right?

  4. #4
    Join Date
    Aug 2011
    Posts
    453


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

    Default Re: My "Library" for ST7920 Graphical displays, works fine, but...

    Well, that's going to make I2C operations about ten times slower than what it could be running at.

    A while back you mentioned using software SPI and complained about it being slow too.
    You'd probably find the same sort of issue.

    The builtin high-level commands make things easy to use, but you pay a price for that.

  5. #5
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: My "Library" for ST7920 Graphical displays, works fine, but...

    So only one way to get the speed, is to use SPI, but with MSSP?

  6. #6
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: My "Library" for ST7920 Graphical displays, works fine, but...

    By the way, as PIC16F886 datasheet says:

    Master Synchronous Serial Port (MSSP) Module
    supporting 3-wire SPI (all 4 modes) and I2C™
    Master and Slave Modes with I2C Address Mask

    This means, I can use MSSP for I2C too, via PBP?

  7. #7
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: My "Library" for ST7920 Graphical displays, works fine, but...

    Yes, the MSSP does both.

Similar Threads

  1. Graphical Displays with PBP3
    By richard in forum PBP3
    Replies: 114
    Last Post: - 25th February 2025, 21:38
  2. How to do the "SerIN" and "SerOut " for the usb ?
    By vicce67 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 13th March 2015, 02:01
  3. Replies: 0
    Last Post: - 14th November 2013, 03:32
  4. Replies: 3
    Last Post: - 15th October 2012, 08:06
  5. Replies: 1
    Last Post: - 16th February 2005, 20:05

Members who have read this thread : 1

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