Fast and compact driver for 1306 ILED


+ Reply to Thread
Results 1 to 9 of 9

Thread: Fast and compact driver for 1306 ILED76 days old

  1. #1
    Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    209
    Thumbs Up
    Received: 13
    Given: 15
    Total Downloaded
    3.27 GB

    3 Not allowed!

    Default Fast and compact driver for 1306 ILED

    This driver for SSD1306 LED display is based on Dompies driver but is simpler and less able.
    The graphics part is gone. Instead I have added simple routines for horizontal and vertical lines,
    rectangles, characters and strings.


    Hline(Xstart, Ystart,length,color)
    Vline(Xstart, Ystart,length,color)
    FillRectangle(Xstart, Ystart, Xend, Yend, color)
    DrawRectangle(Xstart, Ystart, Xend, Yend, color)



    PrintChar(ascii Byte) Prints one character
    PrintString(string) Prints string
    GetChrWidth(Char) Returns width of character in pixels
    GetStrWidth(String) Returns width of String in pixels
    LineFeed
    LineFeedUp
    SetMargins(x,y,right margin) Sets left,top and right margins. Needed by routines below.

    RightPrintString(String) Right justifies strings
    CenterPrintString(String) Centers strings between margins
    PrintSpacedString(String) Prints spaced String

    GotoXY(x,y)
    SetFont(font) Sets the address of font and dims variables
    Contrast(P1) Set contrast
    DisplayOn()
    DisplayOff()
    DisplayInverse()
    DisplayNormal()
    FlipDisplay()
    ClearVideoMem() Clear video ram
    RefreshDisplay() Send video ram to display
    ClearScreen() ClearVideoMem() + RefreshDisplay()

    The main routines are rewritten with procedures and SPI replaced with my simpler version at full speed.
    This all results in a leaner, faster code. Pointers are used instead of indirect addressing so thist should work with 16 bit pics.




    The driver defaults to IIC and full display. To set SPI or half display use defines:


    ' Define protocol: default is I2C. Uncomment as needed
    ' ----------------------------------------------------------------------------
    ' $define SSD1306_Protocol_SPI
    ' $define SSD1306_SPI1
    ' $define SSD1306_SPI2
    ' $define SSD1306_DisplayHalf


    I did some speed test and found that Clearscreen() takes 17.309mS with IIC and 2.317mS with SPI. RefreshDisplay() is 16.744mS and 2.304mS.
    I hope this is of use for someone.



    SSD1306simple.zip
    Flosi Guđmundsson
    Reykjavík

  2. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,478
    Thumbs Up
    Received: 51
    Given: 49
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: Fast and compact driver for 1306 ILED

    Good work Flosi, I am sure many of us will find it useful. Thanks.

    Charlie

  4. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,967
    Thumbs Up
    Received: 96
    Given: 34
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: Fast and compact driver for 1306 ILED

    Thanks Flosi and procedures make it much easier to read and understand. I'll use it. Thanks to Dompie too for his ground work.
    John
    Last edited by John Drew; 13th July 2020 at 08:44.

  6. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Member Dompie's Avatar
    Join Date
    Apr 2012
    Posts
    161
    Thumbs Up
    Received: 19
    Given: 15
    Total Downloaded
    5.19 GB

    0 Not allowed!

    Default Re: Fast and compact driver for 1306 ILED

    Nice work Flossi.
    Place it in the SSD1306 wiki with your text. Then all SSD1306 things are together in one topic and nothing gets lost on the forum.

    Johan

  8. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    209
    Thumbs Up
    Received: 13
    Given: 15
    Total Downloaded
    3.27 GB

    0 Not allowed!

    Default Re: Fast and compact driver for 1306 ILED

    Thanks for nice words. Regarding an article, would the opening post serve as one? While I belong to a clan where almost everybody is a writer I'm only a storyteller.
    Flosi Guđmundsson
    Reykjavík

  10. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,967
    Thumbs Up
    Received: 96
    Given: 34
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: Fast and compact driver for 1306 ILED

    G'day Flosi,
    Although there is a promote to article button I'm not sure where it ends up.
    Better to create the article in the WIKI in the best spot and slip in an extra line with your acknowledgment of those who came before. The post is too good to lose in the general forum, especially as people won't search for iled

    John

  12. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Member teo's Avatar
    Join Date
    Sep 2010
    Posts
    349
    Thumbs Up
    Received: 10
    Given: 1
    Total Downloaded
    7.90 GB

    0 Not allowed!

    Default Re: Fast and compact driver for 1306 ILED

    Good work Flosi,
    Teo

  14. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #8
    Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    209
    Thumbs Up
    Received: 13
    Given: 15
    Total Downloaded
    3.27 GB

    1 Not allowed!

    Default Re: Fast and compact driver for 1306 ILED

    Here is an update. Few things fixed, likeGetChrWidth which in turn means CenterPrintString and RightPrintString now work as intended. I have also added vertical character line scroll that only works well with 10 and 12 pt fonts.
    Attached Files Attached Files
    Flosi Guđmundsson
    Reykjavík

  16. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #9
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,478
    Thumbs Up
    Received: 51
    Given: 49
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: Fast and compact driver for 1306 ILED

    Thanks Flosi, very useful.

    Charlie

  18. Attention
    ×

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Compact Flash
    By Mike B in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 1st May 2007, 23:06
  2. [SOLVED !] compact flash
    By ADLIN SYSTEMS in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 20th July 2006, 11:46
  3. Compact Flash problem
    By Tim in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 24th August 2005, 06:58
  4. Compact Flash Adaptor
    By Lester in forum Wanted and For Sale
    Replies: 0
    Last Post: 19th August 2005, 16:38
  5. Compact Flash
    By swright in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 11th March 2005, 17:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts