Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add page addressing mode #57

Merged
merged 6 commits into from
Feb 23, 2021

Conversation

adamcandy
Copy link
Contributor

@adamcandy adamcandy commented Feb 20, 2021

This fixes #56.
After investigating the behaviour of these new 64x32 displays it was possible to confirm the hardware was OK through successful interaction using plain C code linked to this C bcm2835 library.
It is still strange that identical-looking hardware works sometimes and sometimes not with this Adafruit Circuit Python library.
CaptainJack on this Arduino forum discussing use of U8Glib helped point me in the correct direction:

Adafruit uses Horizontal Addressing Mode (command 0x20, then send 0x00)
U8Glib uses Page Addressing Mode (command 0x20, then send 0x10)

-- and they found some displays are able to operate using either and some only on the latter.
This would explain why there were no issues on all displays tested using the C code above which uses Page Addressing Mode.

The solution: Implement Page Addressing Mode in this Adafruit Circuit Python library to ensure it can operate with a larger number of SSD1306 OLED displays.

Existing behaviour is maintained. To switch to Page Addressing Mode just add the optional option page_addressing=False when initialising the main class.

Note this has not been tested on SPI displays. It is not clear there is a need (and I do not have any displays to test on). The structure is there, it would just need some additional changes to write_framebuf in the SSD1306_SPI class.

These changes mean that all the displays I have now work where they did not previously.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do all displays support page addressing mode? Maybe we should just use that always.

adafruit_ssd1306.py Show resolved Hide resolved
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit 2b7fe36 into adafruit:master Feb 23, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 26, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_DS18X20 to 1.3.4 from 1.3.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_DS18X20#21 from adafruit/dherrada-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 2.8.0 from 2.7.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_EPD#45 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.7.0 from 3.6.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#54 from lesamouraipourpre/parse-gsa-and-gsv

Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.10.6 from 3.10.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#90 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.11.0 from 2.10.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#57 from adamcandy/add-page-addressing-mode

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Button to 1.5.2 from 1.5.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#27 from FoamyGuy/resizeable_button

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.15.0 from 2.14.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#111 from FoamyGuy/wrap_by_pixels

Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.5.3 from 2.5.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#75 from adafruit/REUSE
  > Hardcoded Black and REUSE versions
  > Added pre-commit-config file
  > Added pre-commit and SPDX copyright

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.0.3 from 5.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#65 from brentru/update-cpython-example
@jposada202020 jposada202020 mentioned this pull request Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Displays random patterns on show() for some screens
2 participants