Sharp Memory Display with RP2040 - Pi Pico
Sharp Memory Display with RP2040 - Pi Pico
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
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.
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
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.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Sharp Memory Display with RP2040 - Pi Pico
My MicroGui and NanoGui libraries support Sharp displays via this driver.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Sharp Memory Display with RP2040 - Pi Pico
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!pythoncoder wrote: ↑Tue Dec 07, 2021 9:58 amMy MicroGui and NanoGui libraries support Sharp displays via this driver.
Re: Sharp Memory Display with RP2040 - Pi Pico
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?pythoncoder wrote: ↑Tue Dec 07, 2021 9:58 amMy MicroGui and NanoGui libraries support Sharp displays via this driver.
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
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
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.
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.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Sharp Memory Display with RP2040 - Pi Pico
What about machine.SoftSPI? This should work.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Sharp Memory Display with RP2040 - Pi Pico
Oh, that's a much better idea!
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
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.