adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.06k stars 1.2k forks source link

Changes to displayio caused SSD1351 to stop working with CircuitPython 4.1.0 #2059

Closed makermelissa closed 5 years ago

makermelissa commented 5 years ago

It appears some of the displayio changes in 4.1.0 may have broken the SSD1351 driver. I just tested that the driver works fine in 4.0.1 and I will see if I can narrow down further with which iteration it actually stopped working. I'm wondering if it had anything to do with us removing that delay.

makermelissa commented 5 years ago

Ok, it seem to have broken between 4.1.0 Beta 0 (working) and 4.1.0 Beta 1 (not working).

makermelissa commented 5 years ago

The change was that the baudrate was added as a parameter to Fourwire and the default speed was increased. Manually passing in 16000000 for the baudrate has it working in 4.1.0.

tannewt commented 5 years ago

Is 16mhz the limit of the ssd1351 or of the wiring? If it's the chip, we should add a way for the driver to reduce the baudrate of the given bus.

makermelissa commented 5 years ago

Yes, that seems to be the limit of the SSD1351. Currently the driver is separate from the bus. We could do a driver sweep and add that to the driver and reversion them as 2.0. For now though, I'm working on the guide page and I will be putting that in there.

makermelissa commented 5 years ago

I'll also update the example.

ladyada commented 5 years ago

...technically.... many our displays have SPI limits, we just ignore them because they dont mind overclocking. the HX for example, doesn't like going over 32MHz, but the ST77 is happy up to 80MHz+!

makermelissa commented 5 years ago

Well, if I set it to 20MHz, it doesn't work.

tannewt commented 5 years ago

I'm thinking that we can expose a baudrate property on the bus and have the driver cap it to the max it can handle.

makermelissa commented 5 years ago

Can it be changed once the Fourwire object is declared?

makermelissa commented 5 years ago

Nevermind, I just reread what you typed. That's what you're proposing. Sounds good.

deshipu commented 5 years ago

I'm thinking that we can expose a baudrate property on the bus and have the driver cap it to the max it can handle.

That sounds like a magical side effect that will only cause problems at some point to someone. I know it's not as user-friendly, but perhaps just checking the baud rate and raising an exception when it's too high would be better?

tannewt commented 5 years ago

Sure, throwing an exception works too.

makermelissa commented 5 years ago

We would still need to expose the property so the driver can check what it’s set to. Also it would need to fail gracefully if used with an older version of CircuitPython.