adafruit / Adafruit_CircuitPython_SharpMemoryDisplay

CircuitPython library for SHARP Memory monochrome displays
MIT License
9 stars 12 forks source link

Default baud rate incorrect? #13

Closed zeroping closed 4 years ago

zeroping commented 4 years ago

https://github.com/adafruit/Adafruit_CircuitPython_SharpMemoryDisplay/blob/3860f11bebcf4df94e2c180a26a809adaa4ccac6/adafruit_sharpmemorydisplay.py#L77

It looks like the default 'baudrate' (which is also used in the examples) is set to 8 MHz. When this is passed into busio.SPI.configure(), it's stated that it's the desired clock rate in Hertz.

The displays seem to be spec'ed for 1 MHz or 1.1 MHz though: 144x168 96x96

Should this default be 1MHz? Or am I missing something?

ladyada commented 4 years ago

looks like 2 MHz should be the max, did you try it at 8?

zeroping commented 4 years ago

I did, or at least, I've asked my hardware to do so, although I have not yet confirmed the output clock frequency with a scope or logic analyzer. It does appear to work just fine.

I'm more worried about running it outside of the spec, which I'm still reading as 1.1 MHZ (page 12 of the LS013B7DH05 datasheet, fSCLK) or 1 MHz (page 12 of the LS013B4DN04 datasheet, fSCLK). I'm curious where you're seeing 2 MHz - maybe an updated version of the datasheet, since the displays appear to handle running faster?

I'm just initializing adafruit_sharpmemorydisplay.SharpMemoryDisplay with a baudrate argument in my code for now, but I figured I'd mention that the default is technically too fast.

ThomasBurgess2000 commented 4 years ago

I'm just initializing adafruit_sharpmemorydisplay.SharpMemoryDisplay with a baudrate argument in my code for now, but I figured I'd mention that the default is technically too fast.

What is the exact argument you used?

zeroping commented 4 years ago

adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, scs, WIDTH, HEIGHT, baudrate=1000000)

I have it working quite nicely in my project. Cute little display. I love that it can hold state with almost no power consumption.

ladyada commented 4 years ago

tweaked to 2mhz :)

caolan commented 4 years ago

This change makes a huge difference to the screen update speed. It seems very sensible to set the default value to match the maximum in the datasheet - but now I'd like to draw on your experience to see how far I can push my luck.

@ladyada, @zeroping have you had any reports of hardware problems using the higher clock frequency over the last 11 months?

@makermelissa I notice you decreased the speed to 8MHz at one point. Was that in response to any hardware problems that you can recall? Did you make any measurements to arrive at the 8Hz number?

I'm asking because I have some applications that really benefit from higher clock speed, but I don't want to damage people's other peoples displays if they try to run them!

ladyada commented 4 years ago

it seems to vary by screen. 2mhz is always recommended!

makermelissa commented 4 years ago

I think I was having problems with speeds over 8MHz. Like @ladyada said, it can vary by screen.

caolan commented 4 years ago

Thank you for your responses.

I also contacted someone at Sharp. They obviously cannot warrant anything outside the specified limits, but said it may be ok if the operating temperature can be controlled. The standard mean time between failures is 50KHrs at 25C, but increasing the clock speed will increase the internal temperatures and ultimately lower the functional life of the display.

I completely agree this library should follow the spec (at least by default). But I might suggest Adafruit update the video demo of this display on their website to use the lower clock speed from the datasheet. Otherwise, people will buy this screen with an unrealistic expectation of it's performance.