• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interfacing to displays with MCU/SBC

Status
Not open for further replies.

spec

Well-Known Member
Most Helpful Member
Recently I have been looking at driving cheap and simple 320 pix by 240 pix graphics displays with Arduino Meggas and Raspberry Pi Zeros and I noticed Nigel's comment:
...it's just a bare display for a Raspberry PI, and I can't get it to work.
@ http://www.electro-tech-online.com/threads/remote-green-house-monitor-pic-and-hc-12.149016/

Is it problematic: views appreciated.

spec

Display: http://www.ebay.co.uk/itm/2-2-LCD-2...935685?hash=item4649be8e05:g:CsEAAOSwzgRW0CeG
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Mine was from Bangood, is specifically for a Pi - and plugs directly on top of it.

I'm presuming my problems are to do with the wrong driver for it, but I've not had time (or the inclination :D) to get too deeply involved. Personally I've never had much success with the Pi, but again have never spent too long trying.

The display in your link looks interesting though?.
 

spec

Well-Known Member
Most Helpful Member
Ah, thanks for reply Nigel. I'm a bit relived that you didn't spend too much time trying to get your display working because if you had a struggle, it would not make me feel to confident, being a newbee on the MCU/SBC front.:eek:

The net is full of people with problems trying to interface to these simple displays and I have spent some time trying to eliminate the problems, but only on paper- I cant do bench work at the moment- no workshop and the missus objects if I get any kit near our nice oak table in the front room, which I think is a bit unreasonable.

It seems that the problems are in three broad areas as far as I can tell:

(1) Hardware, mainly interfacing 3V and 5V systems (at speed) and also the back light current overwhelming the host power supply
(2) Firmware
(3) Drivers (special driver required to go with the display for some hosts).

spec
 
Last edited:

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
1) Not a problem if the MCU is 3v and the LCD is 5 volt... as most MCU's have some 5V tolerant pins..

2) I have firmware, If I didn't I can easily write one..

3) ditto!!

What MCU are you going to use... SPI has to be run really fast, therefore short tracks and no stray capacitance..
SPI colour LCD's will always be slow... If you get an intelligent one, it make life easy as there is almost always an SD card on to blit images over to the screen... 4d systems do a 2.2 and a 4.3... I have both and it will do video at 30 FPS run straight from the SD..

I use the same screen (but parallel) and i get great results with my pic32.. I only run it with an 8bit interface, but it is still quite quick... I am putting a pic32mz together with 200Mhz clock and a 16 bit interface.... It should go quite fast..
 

spec

Well-Known Member
Most Helpful Member
Thanks Ian,

I am intending to design for:

(1) Raspberry Pi B

(2) Raspberry Pi Zero

(3) Arduino Megga 2560

(4) Arduino Uno

And possibly PICs

The objective is to design a low cost graphics sub-subsystem that can simply be cut and pasted into a larger system as required.

Yes, I did appreciate that you need to send a lot of data fast over the comms link to minimize latency.

And yes there is an SD reader on the back of the display PCB but it is completely separate electrically from the display electronics. Also there are the traces for a touch function but that part of the PCB is not populated on the units I have. The touch version is another £5 UK, if I remember correctly.

Let us know how you get on with your graphics developments.

spec
 
Last edited:

spec

Well-Known Member
Most Helpful Member
1) Not a problem if the MCU is 3v and the LCD is 5 volt... as most MCU's have some 5V tolerant pins..
With the Arduino, apart from the Due, which is now unfortunately deprecated, the MCU is 5V and the displays are 3.3V, although it is poorly documented. It appears that some displays will work OK with 5V inputs, but most will not. I have designed a circuit which hopefully overcomes the problems of interfacing Arduinos (or other 5V systems) to the display. Maybe I will post a rough sketch for comment.:)

spec
 

spec

Well-Known Member
Most Helpful Member
POST ISSUE 02 of 2016_10_24 Iss02

Here is the interface circuit I came up with (excuse artwork :()

2016_10_123_ETO_ARDUINO_DISPLAY_INTERFACE_iss4.jpg
ERRATA


NOTES
(1) I am not sure about the display MISO signal. There are two views on the net: one view that the display needs to communicate with the host and another view that the display does not need to communicate with the host and the display MISO pin can simply be left unconnected.


DATASHEETS/INFO

http://www.ti.com/lit/ds/symlink/sn74lvc8t245.pdf
http://www.ebay.co.uk/itm/2-2-LCD-2...935685?hash=item4649be8e05:g:CsEAAOSwzgRW0CeG
 
Last edited:

spec

Well-Known Member
Most Helpful Member
Just some points about the ILI9340 and ILI9341 display boards that I have gleaned from the net and by examining the display boards that I have:

(1) The documentation is poor to nonexistent and most users have had to muddle their way through getting the display hooked up to a host. Some users have simply given up.
(2) The display board has a 2.2 inch, 340 by 240 pixel LCD color display on the front and an SD card reader on the rear. The display and card reader electronics are separate, but share a common 3.3V power line.
(3) There is a version of the display board that has touch screen control. In fact, both versions of the PCB are the same, on the display board I have anyway, but the touch screen components are not fitted to the PCB.
(4) The display boards have an AMS1117 three terminal regulator, so the display boards can be powered from either 5V or 3.3V.
(5) The boards have four LEDs for display back lighting. Each LED is around 2V Vf and 10 mA If for reasonable brightness. If you want to control the back-light brightness via the host you heed a 40mA, minimum, driver between the host and display board.
(6) It seems that many users have had problems by simply connecting the LED input on the display board to the 3.3V or 5V supply line on the host. This not only stresses the LEDs, especially with 5V, but can also overload the host 5V or 3.3V supply. So a current limiting resistor needs to be connected in the LED input line, and the current capability of the host power line needs to be checked. My view is that a separate power line for the back-light LEDs is preferable (it could still be derived from the host primary power supply but not via the host on-board regulator).
(7) Users have also had problems translating from the 5V logic levels of most Arduinos and the 3.3V logic of the display boards. My conclusion, from the net and by an analysis, is that a totem-pole output logic level translator chip is required to achieve a safe, fast, and reliable system. Ian Rogers in post #5 provides more information on the speed aspects of the SPI bus. Many users have got their displays working with various home-brew interfaces or automatic direction chips (TSX1010) but not reliably and consistently it seems, and some have even blown their displays.
(8) Theses color displays are dumb and, as Ian Rogers says in post #5, need a lot of data over the SPI bus to drive them. You need to consider this if you intend to display animation at any speed. A more powerful processor like the Arduino Due or Raspberry Pi Zero may be required. Incidentally, both of these boards are 3.3V, so no translator chips are required to interface to the display board.
(9) The SD card reader is full size so you need an adapter to use the popular micro SD cards.

spec
 
Last edited:

Nigel Goodwin

Super Moderator
Most Helpful Member

spec

Well-Known Member
Most Helpful Member
Well I've just ordered a couple, from China, so I'll have a play when they arrive :D

As regards your circuit, have you considered this simple module for the level conversion rather than the chip?.

http://www.banggood.com/10Pcs-8-Cha...irectional-Module-p-1030475.html?rmmds=search

They are simple FET's and offer bidirectional level conversion, it's really quite clever :D
Hi Nigel,

Great that you have ordered a couple of display boards- they typically take three to four weeks to arrive from China though, as you probably know. I will be really interested to know how you get on, especially as you have a lot of experience with MCUs.

The icing on the cake would be if you also got a Raspberry Pi Zero; they are only £4. I have a couple but never turned them on. As you probably noticed, I'm much better at yaking than doing.:grumpy:
https://thepihut.com/collections/raspberry-pi/products/raspberry-pi-zero?variant=14062715972
https://shop.pimoroni.com/products/raspberry-pi-zero

Yes, I have looked at pretty much all the translator approaches, ranging from simple resistors thru FETS, diodes, BJTs, and, bidirectional chips, like the TXS0108 series, and, as you say, the bidirectional FET approach is very clever. But, while it may be fine for low speed control type signals, it is not super fast and does not have good enough voltage levels and edges, especially, positive, for high speed lines, in my opinion. The output is also greatly affected by the load. The same for the TXS0108 series of bidirectional translation chips which produce a slow, exponential shaped, rising edge.

I came to the conclusion that these high speed translators would be best:
(1) 1 channel: SN74AVCH1T45
(2) 2 channel: SN74AVCH2T45
(4) 4 channel: SN74AVCH4T245
(5) 8 channel: SN74AVC8T245
(6) 16 channel: SN74AVC16T245

Like the ready assembled board that you mentioned, (2) thru (6) above are also available on ready made-boards.
I have:
(1) 8 channel versions: http://www.ebay.co.uk/itm/8-Channel...191676?hash=item3f5dc5ebbc:g:7QsAAOSwwpdW2UO7
(2) 16 channel versions: http://www.ebay.co.uk/itm/74LVC16T245-16-Channel-TTL-Stable-COMS-Level-Conversion-Module-Pinboard

Also got some 8 channel TSX1010BE based bidirectional interface boards: http://www.gearbest.com/other-accessories/pp_227270.html
http://www.ti.com/lit/ds/symlink/txs0108e.pdf

There are also many level translators based on the CD4504: http://www.ti.com/lit/ds/schs369/schs369.pdf

spec

REF:
http://www.ti.com/lsds/ti/logic/voltage-level-translation-overview.page
http://www.ti.com/lsds/ti/interface...e-translation-products.page?paramCriteria=no#
 
Last edited:

Nigel Goodwin

Super Moderator
Most Helpful Member
Great that you have ordered a couple of display boards- they typically take three to four weeks to arrive from China though, as you probably know.
That's why I ordered a couple of them :D

The icing on the cake would be if you also got a Raspberry Pi Zero; they are only £4. I have a couple but never turned them on. As you probably noticed, I'm much better at yaking than doing.:grumpy:
I've got three or 3 PI's now, and never had much luck with any of them - but I've spent a great deal of time with them.

I know a guy who's been using them for all kinds of clever projects, to do with his job in the railways - such as monitoring unmanned crossings etc.

Yes, I have looked at pretty much all the translator approaches, ranging from simple resistors thru FETS, diodes, BJTs, and, bidirectional chips, like the TXS0108 series, and, as you say, the bidirectional FET approach is very clever. But, while it may be fine for low speed control type signals, it is not super fast and does not have good enough voltage levels and edges, especially, positive, for high speed lines, in my opinion. The output is also greatly affected by the load. The same for the TXS0108 series of bidirectional translation chips which produce a slow, exponential shaped, rising edge.
I wasn't aware of any speed issues?, if I get time I'll do some tests one day :D
 

DirtyLude

Well-Known Member
I love these displays. They are my new favorite display. Easy to use and very readible. The touch is a great feature as well.
I do not need to worry about level shifting and I generally use 3v3 uC's so I can't really help you there.

Driving the SPI as fast as I can with 16bit writes on a 48mhz processor I can get a fairly quick full screen refresh. I might be able to get a little faster DMA'ing the data, but I haven't taken a hard core look at optimizing the speed. Just looked at a refresh and I would say about half a second for a full screen write.

I use both the touch and non-touch ones. The touch controller is a clone of an older chip that I used to use, so I use the drivers for those I made a long time ago. The SPI is strange and I've only seen software versions of it.

 

spec

Well-Known Member
Most Helpful Member
Hi DL,

Good to know that you find these displays OK.

Just a few questions:

Out of interest, what processor are you using?

How are you driving the backlight?

Do you have an MISO link, or have you left the display MISO open circuit.

spec
 

DirtyLude

Well-Known Member
I'm using ARM Cortex M0 or M3 processors. I don't think I've tried it with anything else. The one in the picture above is a 2.8" module with a small board on the back with an LPC1114 on it.

In testing I have driven the LED directly with 3.3V or with a p-channel mosfet controller by the uC. In the two final designs I did with it both use the mosfet so I can turn off the backlight. One is the remote above and I have to turn off the light and put it in sleep mode when it's not in use.

I do have the MISO line connected, but looking through the code it doesn't look like I use it at all. I have other things on the SPI line so I need that pin anyway and it's just connected to the bus, but it doesn't look like it's needed for the display.

 

spec

Well-Known Member
Most Helpful Member
I'm using ARM Cortex M0 or M3 processors. I don't think I've tried it with anything else. The one in the picture above is a 2.8" module with a small board on the back with an LPC1114 on it.

In testing I have driven the LED directly with 3.3V or with a p-channel mosfet controller by the uC. In the two final designs I did with it both use the mosfet so I can turn off the backlight. One is the remote above and I have to turn off the light and put it in sleep mode when it's not in use.

I do have the MISO line connected, but looking through the code it doesn't look like I use it at all. I have other things on the SPI line so I need that pin anyway and it's just connected to the bus, but it doesn't look like it's needed for the display.
Thanks for info DL.:)

spec
 
Last edited:
Status
Not open for further replies.

EE World Online Articles

Loading
Top