Page 2 of 3

Re: LCD display [Advise needed]

Posted: Wed Jun 14, 2017 11:34 am
by devnull
You should look at the 4D system intelligent displays:

http://www.4dsystems.com.au/

You can program the graphics into the device and just send it the data.

Re: LCD display [Advise needed]

Posted: Wed Jun 14, 2017 12:03 pm
by matto
One of the LCD factories told me about these intelligent displays. The problem is mainly the price. They look like a very good idea and by far the easiest way to implement them in any project, but they are way mor expensive that the alternatives.

Re: LCD display [Advise needed]

Posted: Wed Jun 14, 2017 12:51 pm
by mcauser
I tried my 128x64 graphic LCD (ST7920) using ShrimpingIt's driver:
https://github.com/ShrimpingIt/micropython-st7920

I connected using SPI mode:

Code: Select all

WeMos D1 Mini --- ST7920 LCD
G --------------- 1 VSS / GND
5V -------------- 2 VDD
5V --- POT ------ 2 V0
D8 GPIO15 SS ---- 4 D/I / RS
D7 GPIO13 MOSI -- 5 R/W
D5 GPIO14 SCK --- 6 E
G --------------- 15 CS1 / PSB
D1 GPIO5 -------- 17 RST
5V -------------- 19 BLA
G --------------- 20 BLK
You can also use a MCP23017 I2C backpack for this display (which uses parallel mode and needs a different driver).

Copy st7920.py and canvas.py to your board.

Code: Select all

from machine import Pin, SPI
import st7920
spi = SPI(1)
screen = st7920.Screen(slaveSelectPin=Pin(15), resetDisplayPin=Pin(5))
screen.plot(5, 5)
screen.line(10, 10, 15, 15)
screen.rect(20, 20, 25, 25)
screen.fill_rect(30, 30, 40, 40)
screen.fill_rect(32, 32, 38, 38, False)
screen.redraw()
Works, but is rather slow. Could be improved by leveraging the framebuf module.
screen.redraw() = 700ms
screen.fill_rect(0, 0, 128, 64, True) = 6725ms

My LCD model is the B version here:
http://forum.arduino.cc/index.php?topic=319705.0
"12864B V2.0" on the back.

Re: LCD display [Advise needed]

Posted: Wed Jun 14, 2017 1:03 pm
by matto
Wow! That's very good news!
I mean, it takes almost 7 seconds to draw a rectangle, but it woks haha.
It's a starting point. I'll buy one now and try to make it work.

mcauser, thanks again for taking the time for this!

Re: LCD display [Advise needed]

Posted: Wed Jun 14, 2017 1:32 pm
by mcauser
Well, it takes 7 seconds to draw 8192 pixels. screen.redraw() accepts dimensions, so you can do a partial redraw.
Moving the calculations to C would speed things up quite a bit. SPI is running at 800khz, so thats 2 orders of magnitudes more than there are number of pixels. The bus is not the bottleneck.

I'm going to fork the driver and give it an interface similar to my Nokia 5110 (uPCD8544) and SSD1327 drivers. You know, for fun.

Re: LCD display [Advise needed]

Posted: Wed Jun 14, 2017 1:40 pm
by matto
That's great!
If I can help you in any possible way that my limited knowledge allows me, just let me know.

Re: LCD display [Advise needed]

Posted: Wed Jun 14, 2017 2:51 pm
by matto
One question:
I see that there are a lot of versions of the ST7920 128x64 LCD display. Do all of them come with SPI mode available?
For instance, this one: https://www.aliexpress.com/item/Smart-E ... 56871.html
I don't want to buy the wrong version.

This is an interesting article about these displays: http://mssystems.emscom.net/helpdesk/kn ... article=56

If I understand correctly all of them support SPI, but some of them have the mode select pin (PSB) hard wired to VSS to force the parallel mode. In any case I could just remove the R9 resistor and it could work in SPI mode. Is this correct?

Re: LCD display [Advise needed]

Posted: Wed Jun 14, 2017 3:26 pm
by mcauser
From what I have read, that sounds correct.

This is the same model, only 20c cheaper:
https://www.aliexpress.com/item/Free-sh ... 15750.html

Re: LCD display [Advise needed]

Posted: Wed Jun 14, 2017 3:37 pm
by matto
Cool, I'll get that one then.

I think this is the perfect candidate for my project based on what I can see here: https://www.youtube.com/watch?v=Oj8yt8C-YSk

Re: LCD display [Advise needed]

Posted: Tue Jun 20, 2017 6:03 pm
by matto
mcauser wrote:that sounds correct.
Man, I came back just to say THANK YOU one more time.

Image

It's exactly what I wanted!

- Perfect readability on direct sunlight
- Very cheap (less than U$D5!)
- High availability
- Great size
- LED backlight
- SPI compatible
- WORKS WITH MICROPYTHON

This was stopping me and now at least can continue with the project.
Thanks a bunch :)