Sharp Memory Display with RP2040 - Pi Pico

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
ns3d
Posts: 6
Joined: Mon Dec 06, 2021 5:13 pm

Sharp Memory Display with RP2040 - Pi Pico

Post by ns3d » Mon Dec 06, 2021 5:16 pm

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.

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Sharp Memory Display with RP2040 - Pi Pico

Post by scruss » Mon Dec 06, 2021 6:23 pm

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.

ns3d
Posts: 6
Joined: Mon Dec 06, 2021 5:13 pm

Re: Sharp Memory Display with RP2040 - Pi Pico

Post by ns3d » Mon Dec 06, 2021 11:34 pm

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.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Sharp Memory Display with RP2040 - Pi Pico

Post by pythoncoder » Tue Dec 07, 2021 9:58 am

My MicroGui and NanoGui libraries support Sharp displays via this driver.
Peter Hinch
Index to my micropython libraries.

ns3d
Posts: 6
Joined: Mon Dec 06, 2021 5:13 pm

Re: Sharp Memory Display with RP2040 - Pi Pico

Post by ns3d » Fri Dec 10, 2021 5:56 pm

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!

ns3d
Posts: 6
Joined: Mon Dec 06, 2021 5:13 pm

Re: Sharp Memory Display with RP2040 - Pi Pico

Post by ns3d » Fri Dec 10, 2021 10:15 pm

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)



User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: Sharp Memory Display with RP2040 - Pi Pico

Post by mattyt » Sat Dec 11, 2021 5:34 am

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

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Sharp Memory Display with RP2040 - Pi Pico

Post by pythoncoder » Sat Dec 11, 2021 9:20 am

What about machine.SoftSPI? This should work.
Peter Hinch
Index to my micropython libraries.

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: Sharp Memory Display with RP2040 - Pi Pico

Post by mattyt » Sat Dec 11, 2021 9:43 am

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.

ns3d
Posts: 6
Joined: Mon Dec 06, 2021 5:13 pm

Re: Sharp Memory Display with RP2040 - Pi Pico

Post by ns3d » Sat Dec 11, 2021 3:48 pm

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.

Post Reply