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

Bottom rows of pixels are not aligning on Adafruit 2.13" Monochrome eInk #75

Closed
awallat opened this issue May 16, 2023 · 14 comments · Fixed by #80
Closed

Bottom rows of pixels are not aligning on Adafruit 2.13" Monochrome eInk #75

awallat opened this issue May 16, 2023 · 14 comments · Fixed by #80

Comments

@awallat
Copy link

awallat commented May 16, 2023

I purchased a Adafruit 2.13" Monochrome E-Ink Bonnet for Raspberry Pi (with 1680 based chipset). When trying the examples: E-Ink Weather Station](https://learn.adafruit.com/raspberry-pi-e-ink-weather-station-using-python/weather-station-code) or the examples/epd_bonnet.py the display does not update correctly. The bottom lines are distorted. The issue has come up before and it got a patch, but it does not appear to be working with the current library.

The problem was discussed and analyzed in the forum: https://forums.adafruit.com/viewtopic.php?p=972750#p972750

I tried with a Raspberry Pi Zero 2WH and 3b+. The interesting thing is that when switching to chipset 1675, where the screen cannot be controlled, and going back to 1680, the bottom lines are cleared, but still cannot be used for drawing correctly. There seems to be an offset problem. I'm using the current Adafruit CircuitPython EPD release (v2.11.0).

Here's a photo of the problem:
PXL_20230512_070255249

and here switching back and forth the mentioned chipsets:
PXL_20230515_202255522

@tannewt
Copy link
Member

tannewt commented May 17, 2023

Use the RAM dimensions from the SSD1680 datasheet: 176x296. The displayed area won't start at 0,0 because it depends on how the control chip is connected to the display itself. (In CP displayio this is handled with colstart and rowstart.)

@awallat
Copy link
Author

awallat commented May 17, 2023

I'm afraid I need more information since I'm quite new to this.
I'm working on a raspberry pi (zero 2wh) and only had examples using the modules digitalio, busio and board to setup the screen. The module displayio cannot be found.

@tannewt
Copy link
Member

tannewt commented May 18, 2023

Please post the full code you are running and I can suggest the edit.

@awallat
Copy link
Author

awallat commented May 22, 2023

Here's a simple example, which draws a square and a line. Here you can also see the offset problem again:

import digitalio
import busio
import board
from adafruit_epd.epd import Adafruit_EPD
from adafruit_epd.ssd1680 import Adafruit_SSD1680  # pylint: disable=unused-import

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
ecs = digitalio.DigitalInOut(board.CE0)
dc = digitalio.DigitalInOut(board.D22)
rst = digitalio.DigitalInOut(board.D27)
busy = digitalio.DigitalInOut(board.D17)

print("Creating display")
display = Adafruit_SSD1680(122, 250,
    spi,
    cs_pin=ecs,
    dc_pin=dc,
    sramcs_pin=None,
    rst_pin=rst,
    busy_pin=busy,
)

display.rotation = 1

print("Clear buffer")
display.fill(Adafruit_EPD.WHITE)

print("Draw Rectangles")
display.rect(0, 0, 30, 30, Adafruit_EPD.BLACK)

print("Draw lines")
display.line(0, 0, display.width - 1, display.height - 1, Adafruit_EPD.BLACK)

display.display()

@awallat
Copy link
Author

awallat commented May 22, 2023

PXL_20230522_183847484

@awallat
Copy link
Author

awallat commented Jun 12, 2023

Any help?

@tannewt
Copy link
Member

tannewt commented Jun 12, 2023

You'll want to add rowstart to the driver init. Similar to: https://github.com/adafruit/Adafruit_CircuitPython_SSD1680/blob/main/examples/ssd1680_four_corners.py#L35 (My guess is rowstart=8)

@tannewt
Copy link
Member

tannewt commented Jun 12, 2023

For example:

import digitalio
import busio
import board
from adafruit_epd.epd import Adafruit_EPD
from adafruit_epd.ssd1680 import Adafruit_SSD1680  # pylint: disable=unused-import

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
ecs = digitalio.DigitalInOut(board.CE0)
dc = digitalio.DigitalInOut(board.D22)
rst = digitalio.DigitalInOut(board.D27)
busy = digitalio.DigitalInOut(board.D17)

print("Creating display")
display = Adafruit_SSD1680(122, 250,
    spi,
    rowstart=8,
    cs_pin=ecs,
    dc_pin=dc,
    sramcs_pin=None,
    rst_pin=rst,
    busy_pin=busy,
)

display.rotation = 1

print("Clear buffer")
display.fill(Adafruit_EPD.WHITE)

print("Draw Rectangles")
display.rect(0, 0, 30, 30, Adafruit_EPD.BLACK)

print("Draw lines")
display.line(0, 0, display.width - 1, display.height - 1, Adafruit_EPD.BLACK)

display.display()

@awallat
Copy link
Author

awallat commented Jun 15, 2023

This does not work unfortunately.
TypeError: __init__() got an unexpected keyword argument 'rowstart'

The parameter does not exist in the library I use. Please see https://github.com/adafruit/Adafruit_CircuitPython_EPD/blob/main/adafruit_epd/ssd1680.py

@tannewt
Copy link
Member

tannewt commented Jun 20, 2023

Ah, right. Sorry for the confusion. I'm not sure what the right way to do it is with this library.

Maybe just pretend the display is larger than it actually is to account for the clipped pixels.

@makermelissa
Copy link
Contributor

Unfortunately I don't think there's a way to specify an offset with this library. I'm not sure when the offset issue started occurring or if it affects other displays as well, but likely additional testing will be needed to narrow down where to fix the issue in code.

@makermelissa
Copy link
Contributor

makermelissa commented Jul 6, 2023

Ok, I've been working on this. It appears you have the SSD1675 display (it has 2 tabs on the right as opposed to 1 with the 1680). I have both and verified the SSD1680 driver works fine with the newer one, but I wrote that guide when the bonnet first came out, which had the SSD1675 display. Anyways, the real issue is that the 1675 driver isn't working anymore on the 1675 display and that's what I'm going to try and fix.

@makermelissa
Copy link
Contributor

For reference, here are the 2 different displays:
SSD1675
SSD1680

@awallat
Copy link
Author

awallat commented Jul 16, 2023

Thanks a lot! It works now with the new version 😄

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 a pull request may close this issue.

3 participants