Page 1 of 2

Sharp Memory Display with RP2040 - Pi Pico

Posted: Mon Dec 06, 2021 5:16 pm
by ns3d
I am looking for someone to help with updating current libraries, or creating a new library, for the Sharp Memory Display line of products to work with the Pi Pico/RP2040 in MicroPython. We have a project that currently uses them with Arduino, but are looking to move code for this project over to MicroPython. This seems to be the last portion of the code not yet working. I'm not sure how to go about hiring someone for the project, or if this forum is strictly non commercial, but either is fine.

Re: Sharp Memory Display with RP2040 - Pi Pico

Posted: Mon Dec 06, 2021 6:23 pm
by scruss
Awesome MicroPython lists pramasoul/micropython-SHARP_Memory_Display: micropython driver for SHARP memory display.

It might be a little PyBoard-specific, given it's a few years old, but it could be a good start.

Re: Sharp Memory Display with RP2040 - Pi Pico

Posted: Mon Dec 06, 2021 11:34 pm
by ns3d
That's a really good resource, I've been looking over it the last few days, but to be honest I feel a bit in over my head when it comes to modifying libraries.

Re: Sharp Memory Display with RP2040 - Pi Pico

Posted: Tue Dec 07, 2021 9:58 am
by pythoncoder
My MicroGui and NanoGui libraries support Sharp displays via this driver.

Re: Sharp Memory Display with RP2040 - Pi Pico

Posted: Fri Dec 10, 2021 5:56 pm
by ns3d
pythoncoder wrote:
Tue Dec 07, 2021 9:58 am
My MicroGui and NanoGui libraries support Sharp displays via this driver.
Thank you for sending this over @pythoncoder - I think that's the single most helpful thing I've found in the last week I've been doing some research. I'll try and report back on my progress, thank you again!

Re: Sharp Memory Display with RP2040 - Pi Pico

Posted: Fri Dec 10, 2021 10:15 pm
by ns3d
pythoncoder wrote:
Tue Dec 07, 2021 9:58 am
My MicroGui and NanoGui libraries support Sharp displays via this driver.
I've spent the morning working through the code, and have gotten snagged with an error that may be an easy fix for someone more experienced. Have you seen the following error?

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 16, in <module>
  File "color_setup.py", line 11, in <module>
  File "/lib/drivers/sharp/sharp.py", line 31, in __init__
NotImplementedError: LSB
This happens after I load the drivers, the GUI, format the color_setup.py (included below) and adjust the resolution to match my display at 168x144.

Code: Select all


## color_setup.py for Pico and sharp memory display ##

import machine
import gc

from drivers.sharp.sharp import SHARP as SSD

pcs = machine.Pin(9, machine.Pin.OUT, value=1)  # Active high
spi = machine.SPI(1, 30_000_000, sck=Pin(10), mosi=Pin(11))
gc.collect()
ssd = SSD(spi, pcs)



Re: Sharp Memory Display with RP2040 - Pi Pico

Posted: Sat Dec 11, 2021 5:34 am
by mattyt
It appears that the rp2 port doesn't support the LSB option for SPI. ie, data is always sent with MSB ordering.

Glancing over the rp2040 datasheet, sending in LSB order doesn't even seem supported in hardware. So MicroPython may need to reverse the bit ordering in software before handing the data over to SPI. But that's not implemented yet...

In the meantime I think you're going to need to modify the driver to convert the bit ordering yourself. :(

Re: Sharp Memory Display with RP2040 - Pi Pico

Posted: Sat Dec 11, 2021 9:20 am
by pythoncoder
What about machine.SoftSPI? This should work.

Re: Sharp Memory Display with RP2040 - Pi Pico

Posted: Sat Dec 11, 2021 9:43 am
by mattyt
pythoncoder wrote:
Sat Dec 11, 2021 9:20 am
What about machine.SoftSPI? This should work.
Oh, that's a much better idea! :P

May not be able to achieve 2MHz with SoftSPI (anyone know the max actual baud rate?) but at least it will be functional.

Re: Sharp Memory Display with RP2040 - Pi Pico

Posted: Sat Dec 11, 2021 3:48 pm
by ns3d
Thank you both for adding some context, those are areas I need to spend some time learning more. For now, can you elaborate on the SoftSPI? Should I essentially modify the code to use that everywhere it’s referenced? I’d love to get this working with the pico and send an example file over for you to include in the git repository for Nano and Micro GUI.