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


    Did you find this post helpful? Yes | No

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

    If you're trying to write something totally generic that can be used with all the 8-bit PIC's then the most generic solution is to use the bit-banged I2C routines.

    If you want a faster method then using the MSSP hardware is the solution, but-
    a) not all PIC's have an MSSP module
    b) even if they do, they all don't work quite the same, so there may be some slight differences in programming

    SPI is simpler and faster than I2C but will take 4 pins instead of 2.
    Either way, you will be limited as to which pins can be used... bit-banged can use pretty much any pins but the MSSP uses fixed pins.

    If somebody required me to use a parallel EEPROM for something like this I'd laugh and say "no thanks".

  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 tried software SPI with MAX7219 and was not impressed at all - updating 32x8 pixels led display was quite slow....

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


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

    So if you have simple, clean to understand code for working with MSSP in PBP, I'd like to have a look...
    I'll just point to MELABS: https://melabs.com/samples/PBP-mixed/spimast.htm That example is what I used as a basis when I first used the MSSP module for SPI (for interfacing the W5100 (search the forum for that code if you want)). See, not a single line of assembly.

  4. #4
    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...

    Thanks, but that code is missing SSPBUF declaration?

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

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

    No.
    SSPBUF is the Synchronous Serial Port Receive Buffer/Transmit Register. It's the name of register to/from which you write/read whatever gets shifted out.

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

    Good.
    So I have to "learn" to use SPI eeprom 1st, and then use MSSP
    By the way, if I leave current setup as is - using I2C, but use PIC running at say 32mhz (instead of current 8mhz), will this result 4x times faster reading speed or not?

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

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

    Have you measure what clock speed you're getting?
    Standard "high speed" I2C clock is 400kHz, maximum clock speed of a Microchip 24C256 when run at >2.5V is 1MHz.
    SPI-interface flash chips usually has a maximum clock frequency of at least 33MHz.

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