You will need at least the SDA and SCK, possibly also A0 (which is actually data/command).
If you feel like experimenting, you could also copy the initialization sequence for the black board from that Arduino library into the Python library, and see if that makes it work...
I have ordered a bunch of different ST7735-based displays now, and will do some experiments once they arrive, but it can take a month (the Chinese New Year is nearing).
Unable to use SPI display. Help please.
Re: Unable to use SPI display. Help please.
I captured the screen init and few commands, channels look at least active.
Here is the Sigrok file, maybe its useful to you ?
https://dl.dropboxusercontent.com/u/319 ... 5-Black.sr
I'm not really a programmer, I doubt I can copy that init sequence, will have a look tomorrow.
Here is the Sigrok file, maybe its useful to you ?
https://dl.dropboxusercontent.com/u/319 ... 5-Black.sr
I'm not really a programmer, I doubt I can copy that init sequence, will have a look tomorrow.
Re: Unable to use SPI display. Help please.
One of my screens has a green protection film. The other one doesn't have any protective film - not sure if it came with one and I removed it!
Thanks a lot for all your willingness everyone. Even if this does not work, it is heart warming to see lengths people go to, to help others.
Thanks a lot for all your willingness everyone. Even if this does not work, it is heart warming to see lengths people go to, to help others.
Re: Unable to use SPI display. Help please.
I have pushed to https://github.com/adafruit/micropython ... gb-display a new version of the st7735.py file that contains an additional class, ST7735R, which does the altenate initialization sequence needed by some modules. I have also found a module in my drawer that didn't work with the original class, but works with the new one. I got it to work with the following code:
Note that I had to lower the SPI baudrate from the default 80000000 to make it work.
Please test. Note also, that I have hardcoded 127x127 resolution in the initialization sequence for now. That means that if your module is 128x144 or 128x160, you will have a fragment of the screen inaccessible. That will be fixed in subsequent updates, for now it's important to get the display to display anything.
UPDATE: I now fixed the resolution, and determined that the fastest baudrate with which it works for me is 40000000.
Code: Select all
from machine import Pin, SPI
import st7735
display = st7735.ST7735R(SPI(1, baudrate=10000000), dc=Pin(12), cs=Pin(15), rst=Pin(16))
Please test. Note also, that I have hardcoded 127x127 resolution in the initialization sequence for now. That means that if your module is 128x144 or 128x160, you will have a fragment of the screen inaccessible. That will be fixed in subsequent updates, for now it's important to get the display to display anything.
UPDATE: I now fixed the resolution, and determined that the fastest baudrate with which it works for me is 40000000.
Re: Unable to use SPI display. Help please.
I can confirm the new class works on my black pcb screen ! Thanks a lot !
Now, how can I display text on this thing ?
Now, how can I display text on this thing ?
Re: Unable to use SPI display. Help please.
There is some discussion about a standard font format here: http://forum.micropython.org/viewtopic.php?f=3&t=2667
Right now you would need to draw the letters pixel-by-pixel, which will probably be quite slow. I plan to add to this driver the ability to blit framebuffers to it, in order to have a fast way of drawing bitmaps such as letters, but the rgb framebuffer support was only merged recently, and I didn't have time to work on it yet.
Right now you would need to draw the letters pixel-by-pixel, which will probably be quite slow. I plan to add to this driver the ability to blit framebuffers to it, in order to have a fast way of drawing bitmaps such as letters, but the rgb framebuffer support was only merged recently, and I didn't have time to work on it yet.
Re: Unable to use SPI display. Help please.
I just added a "blit_buffer" and a "text" method to the library. It only uses the micropython's internal, built-in font, and you can't do things like rotating the text. You also have to handle wrapping yourself.
Re: Unable to use SPI display. Help please.
It works ! Thanks !
Somewhat :-p I have a problem displaying text past ~x:100, the text gets strangely overlaid by bg color.
Somewhat :-p I have a problem displaying text past ~x:100, the text gets strangely overlaid by bg color.