how to control multiple lcds  - Page 1
Forum section: electronics / beginners

author: pomme
author_rank: Contributor
timestamp: January 31, 2022, 01:48:33 pm
content: first of all sorry if I make mistakes english is not my first languageHello guys it's my first time on EEVblog so please be lenient if I make a mistakeso I'm working on a project and I want to control multiple screens1) is for showing image with color2 and 3) is for text and basic colors like purple, red etc4 and 5) white txt on black screenfrom my understanding, I need µC to send instruction and an IC to control the screensif my understanding is true :is one IC enough for the 5 screensand are there any IC that you recommande (with documentation)if my understanding is false can you give me some advise or the direction I should look atI'm still a beginner but I'm willing to take my time to learnthanks

author: tooki
author_rank: Super Contributor
timestamp: January 31, 2022, 02:08:41 pm
content: When you buy an LCD, you'll usually buy one with a driver IC on the module. (I certainly recommend this.)Your microcontroller will send data to the display. There are many different connection types, and there are many kinds of displays, so the code varies wildly.For a graphical display, you typically use a graphics library for the actual drawing commands ("draw circle here, a line there, text over here", etc) and a pure "driver" for the display in question, which translates the drawn image into the commands for the display.In a character display, you essentially send text to the display.In a numeric display, you generally control the segments.I'd suggest buying an Arduino Due (because it's natively 3.3V, like the TFT display requires), plus two each of the following, because they're displays I have successfully used myself:- ILI9341-based color TFT display-1602 (16chars x 2 lines) character LCD-0.96", 0.91" or 0.66" monochrome OLED displayWith two of each, you can learn how to connect and address multiple instances of the same display type, as well as combine different display types. The Adafruit GFX graphics library supports a TON of graphical display types and is a great way to get started.FWIW, I've bought from this place a few times, and they've got a nice collection of displays with sample code for Arduino:https://www.buydisplay.com/arduino-display?product_list_limit=all

author: pomme
author_rank: Contributor
timestamp: January 31, 2022, 02:52:20 pm
content: thanks for your replaybut what I'm looking for is to make something for customized lcdfor the 1602 I know about them but I want to use lcd for the estheticso what I'm looking for is maybe some open source driver IC or something like that, I don't know if it existe

author: jpanhalt
author_rank: Super Contributor
timestamp: January 31, 2022, 04:11:23 pm
content: I would buy the displays with either an SPI or I2C interface. Then your MCU can select to which display it is writing. No additional chips needed. If you already have displays without serial interfaces, "backpack" adapters can be bought very cheaply. I think Adafruit and Sparkfun have them. I have bought from Digole on eBay too.

author: free_electron
author_rank: Super Contributor
timestamp: January 31, 2022, 04:26:01 pm
content: plenty of digit drivers around. holtek , oki , hitachi and various others. look for lcd driver 1 2 or 4 backplanes.some are even serially controllable( spi or i2c )

author: pomme
author_rank: Contributor
timestamp: January 31, 2022, 08:43:11 pm
content: from the answers I've got it seems like I need to document myself about spi and i2cdo you have a good book to ease my journey on the road of spi and i2c

author: jpanhalt
author_rank: Super Contributor
timestamp: January 31, 2022, 09:12:28 pm
content: I would chose SPI. It is much faster than I2C. It's major disadvantage is that slaves are addressed with a pin (slave select, SS) not a digital address. Technically, four pins are needed for the bus, clock, data out ("master out slave in" aka MOSI), data in (master in slave out, MISO) and slave select (SS). Each device needs its own SS. However, unless you are reading data on the LCD, you do not need MISO. So, only 2 lines are needed for the bus plus one line for each device. Caution: LCD's on SPI or I2C may not be readable.I2C is a slower, requires fewer pins, allows addressing a larger number of slaves, and includes an ACK for acknowledge of a successful receipt.Either can be done with software, but but I use hardware available in PIC devices.Have you decided on the MCU? If so, refer to its datasheet.

author: pomme
author_rank: Contributor
timestamp: January 31, 2022, 09:35:52 pm
content: i was thinking about raspberry pi zero but I don't know if it's enoughwhene you say I2C is slower, is it notibale to the naked eye ?

author: jpanhalt
author_rank: Super Contributor
timestamp: January 31, 2022, 09:59:45 pm
content: I haven't pushed either interface to the extreme. I think I2C tops out at about 500k baud. SPI is in the millions (about as fast as you can exchange two registers). Of course, the LCD makes a difference too. That difference would not be apparent for a character display, ASCII is only 7-bits. My concern is that a color, graphical LCD would need a lot more data. As one example, blanking a 64 x 128 monochrome graphical display (writing zeros to every byte) with SPI takes between 2ms and 4ms at 8 MHz or 4MHz clock, respectively, which is barely noticeable. When I rewrite the entire screen for scrolling, it's a little longer due to calculations, and there is a noticeable blink with SPI. I assume I2C would also blink, but be just a little longer. How that would be reflected with a color, graphical LCD, I don't know.

author: tooki
author_rank: Super Contributor
timestamp: January 31, 2022, 10:10:13 pm
content: Quote from: pomme on January 31, 2022, 09:35:52 pmFor graphics, it definitely can be. An I2C 1602 character display is limited to maybe 10 updates per second, vs dozens and dozens via parallel. But I suspect that depends on the software too.With the little bit (i.e. practically none) of information you’ve provided about your intentions, it’s impossible to say whether it’d be suitable for your application or not.Quote from: jpanhalt on January 31, 2022, 09:59:45 pmStandard I2C is clocked at 400KHz*, but various other modes go up to 5MHz, though that’s rare. I’ve never encountered anything faster than the 1MHz “fast mode plus”.*technically this is “fast mode”, but very few things actually use the actual 100KHz “standard mode”.But it doesn’t hold a candle to the 10-80MHz that one commonly sees on SPI. But even SPI isn’t fast enough for fast updates on full-color displays of any significant size, hence the parallel interfaces and really high speed serial display buses used for larger displays.

author: pomme
author_rank: Contributor
timestamp: January 31, 2022, 10:34:30 pm
content: for the project I want a lcd that shows an image and two monochrome oled (one big and the other small) that shows txt (some sort of enigma)for the other two lcds they white txt on color background (red, purple, etc) depending of the enigmaall of this is new to me so if you know a lcd driver that I can use to learn the concepets it will really help (or if you have any better idea for me to learn these concepts)I'm open to your advices

author: Manul
author_rank: Super Contributor
timestamp: January 31, 2022, 10:56:58 pm
content: Sorry, but do you absolutely need 5 screens? Personally I would really try to avoid such design. How about one big screen behind a frame which is cut to give impression of separate screens? You could draw pictures and texts to predefined rectangles on the big screen and at least it will be one screen with one connection and one graphics library. Easy to connect and write code.

author: pomme
author_rank: Contributor
timestamp: January 31, 2022, 11:13:25 pm
content: unfortunately yes I will be placing them in each side of a cubeto summarize what I understood for nowthere are IC that use SPI, I2C, parallel interface, ... which are protocoles to communicate with the lcdand we use some kind of language(maybe) to program the communicationdid I miss something ?

author: jpanhalt
author_rank: Super Contributor
timestamp: January 31, 2022, 11:23:28 pm
content: Of course, one can split a larger screen into sections. Here's an example on a graphical LCD with numerical data on one side and graphical on the other that I did a couple of years ago. It's the same screen I described in my earlier post. Interface is SPI, LCD controller is ST7567. MCU is enhanced mic-range (8-bit) at 32 MHz.However, I see no problem in using separate LCD's as the TS proposed, especially since he seems new to this. Changing !SS for graphical versus character might be simpler, since several character displays seem to be wanted.Edit: Scrolling the left side only affects that side. The right side s handled separately.

author: pomme
author_rank: Contributor
timestamp: January 31, 2022, 11:40:13 pm
content: did I make a good summarize ?

author: Manul
author_rank: Super Contributor
timestamp: January 31, 2022, 11:44:39 pm
content: Quote from: pomme on January 31, 2022, 11:13:25 pmYes, SPI, I2C, parallel are electrical standards of communication. On top of that there are specific software protocols. You can find software libraries for different screens where all these things are wrapped into easy to use functions. Then you write code using these functions to draw things on a screen and write text.Anyway, if you are beginner with all of this, I would strongly suggest to make some compromises and "optimisations". It is not fun when you bite too much and get overhelmed.For example here I would suggest to take 5 identical screens. So if you make one work, you will have all 5 working. Programming will be same. If update speed is not super important, go with I2C. Easier to wire and use.

author: pomme
author_rank: Contributor
timestamp: January 31, 2022, 11:55:17 pm
content: okey thankscan you give me the name of a screen with a software I can use to get started

author: Manul
author_rank: Super Contributor
timestamp: February 01, 2022, 12:22:22 am
content: Well, depends what size, resolution you need. IPS LCDs are really nice to look at, have a wide viewing angle. You may take a look at waveshare:https://www.waveshare.com/product/displays/lcd-oled/lcd-oled-3/1.54inch-lcd-module.htmhttps://www.waveshare.com/product/displays/lcd-oled/lcd-oled-3/2.4inch-lcd-module.htmThese are quite small. There are other reputable LCD module supliers. Just don't buy no names.

author: tooki
author_rank: Super Contributor
timestamp: February 01, 2022, 11:10:55 am
content: Quote from: pomme on January 31, 2022, 10:34:30 pm(Thanks for replying, but why can't you be specific and explicit? We shouldn't need to ask question after question after question to get yourbasicrequirements out of you.)By image, do you mean color TFT? (Images can also be shown on monochrome or grayscale graphical displays...) What size? What kind of refresh rate do you need?White text on background: so... graphical LCD, or character LCD? Both of those can show text on colored backgrounds. What size?And what kind of MCU do you plan to use?

author: pomme
author_rank: Contributor
timestamp: February 01, 2022, 12:38:43 pm
content: for you it may be evident to talk about all those details but I barely started learning about the conceptsit's not that I don't want to be explicit it's just it's all new to mefor the image I was thinking IPS because I read it's batter than TFT, the size I hesitate between 2.8" and 2.4"the refresh rate I have no idea (it's my first project so I don't know the refresh rate that I need)for the text on background: graphical LCD and character LCD don't correspond to the need of my projectso I was thinking about 2 oled for the text on black background and 2 tft for the text on color backgroundfor the MCU I don't know

author: jpanhalt
author_rank: Super Contributor
timestamp: February 01, 2022, 12:39:05 pm
content: Quote from: pomme on January 31, 2022, 11:55:17 pmFirst off, I have no hands on experience with color LCD's. I do have experience with graphical and character displays. Of course, writing characters to a graphical display is simply a matter of having a table for the characters somewhere in your code. Everything I say is with respect to those displays. The character displays were all "standard" HD44780 (Hitachi) compatible. Graphical displays have been more variable, but most recently I have used displays with the ST7567A controller. It is fast, and like most, one cannot read the display when using any serial communication protocol. I have used both SPI and I2C, and prefer the SPI. I am reluctant to say either is "easier." There are more instructions in I2C; whereas, in SPI one needs to control slave select for each device rather than use a slave address. What it boils down to is following instructions.I second the advice to start simple (i.e., monochrome), then develop from that. None of my LCD's allow writing to a single pixel per se. That is, you cannot use an instruction to set a specific bit (e.g., bsf <location coordinates> in Assembly). I have heard that some graphical displays and controllers do allow single bits to be written, but that person did not post his code.On graphical displays I have used, and character displays too for that matter for special characters, one must write a full 8-bit byte. A 64x128 pixel display will be arranged with 128 columns horizontally. Each column will have 8 bytes vertically (often called pages). You set the "page" with code, then send a byte. 0x01 will set the bottom bit of that page. 0xFF will make set every bit in that page. Drawing a picture is easy, but what about moving the picture or scrolling? If you can read the display, one could recall the byte, OR the change, and then resend the byte. I do that with character displays. With a display that cannot be read, how to you know the byte you need to change? One method is to mirror your display in RAM and work with that. What do you do with scrolling? You can see it gets a bit complicated or requires a whole lot of memory particularly if color is involved.. In the example I posted, the buffer for the graphics is just 64 bytes. Time in minutes is plotted L-->R. The vertical axis is not so limited as my vertical data are compressed to single bytes (i.e., 256 values are stored). Hence, I can scroll up or down, but only to the left easily (increasing time). That buffer could easily be increased to 128 bytes to allow more horizontal scrolling.The forgoing is not intended to be detailed instructions. My intent is to illustrate some of the challenges in drawing to a graphical display. That is why some of us have recommended that you start simple, say a 128x64 monochrome graphical display and an HD44780-compatible character display. Once you have code working for them, it will be easy to extend to more complicated arrangements.As for names, a standard 16x2 character display will suffice. A 20x4 is really not that much more complicated. You might want to look for one that allows a limited number of special characters, such as a degree symbol or Ω. I think most do. As for graphical, I use an EastRising one from BuyDisplay.com, ERM1604SYG-1-3.3V

author: pomme
author_rank: Contributor
timestamp: February 01, 2022, 01:04:09 pm
content: thanks a lotsince it's my first with lcds I was ignorant of the challenges I'd will face but now I understand a little bit moreI will follow your advice and start with a monochrome graphical display and when I'm comfortable I will try more advanced things

author: Watth
author_rank: Frequent Contributor
timestamp: February 01, 2022, 09:34:36 pm
content: So the device will display a static image on one of the screen and text on the others. If these don't need to be changed that often (they stay the same for more than a second, for example), you won't need something faster than an arduino. I'd recommend Arduino because it's easy to find libraries; I lately bought a few small screens (LCD, OLED) to play with. (Made by waveshare, if I remember correctly).This could be a good solution for you as these libraries allow you to quite easily display static images and text.But first, I'd have a look at the screen and what connections they require from the µCU. Because in addition to serial data, you sometimes also have to connect other I/O.Once you know what serial protocols and IO ports you need, you can chose a µCU that would make it all work. If you have pictures to display, you'll need extra memory.

author: MarkF
author_rank: Super Contributor
timestamp: February 02, 2022, 04:39:16 am
content: I would try to only use one type of display.The programming will be much easier if you only need to know how to talk to one display type.Just because you only want to have a black & white text doesn't mean you can't use a color display.I would suggest two identical large color displays side-by-side.Left display for your image and right display divided into areas for your text in any colors you want.The advantage of one large display instead of four is that the layout is totally flexible.Like two of the Waveshare displays Manul linked to:https://www.waveshare.com/product/displays/lcd-oled/lcd-oled-3/2.4inch-lcd-module.htm