1.8 st7735r spi tft lcd display module quotation

Hi guys, welcome to today’s tutorial. Today, we will look on how to use the 1.8″ ST7735  colored TFT display with Arduino. The past few tutorials have been focused on how to use the Nokia 5110 LCD display extensively but there will be a time when we will need to use a colored display or something bigger with additional features, that’s where the 1.8″ ST7735 TFT display comes in.

The ST7735 TFT display is a 1.8″ display with a resolution of 128×160 pixels and can display a wide range of colors ( full 18-bit color, 262,144 shades!). The display uses the SPI protocol for communication and has its own pixel-addressable frame buffer which means it can be used with all kinds of microcontroller and you only need 4 i/o pins. To complement the display, it also comes with an SD card slot on which colored bitmaps can be loaded and easily displayed on the screen.

The schematics for this project is fairly easy as the only thing we will be connecting to the Arduino is the display. Connect the display to the Arduino as shown in the schematics below.

Due to variation in display pin out from different manufacturers and for clarity, the pin connection between the Arduino and the TFT display is mapped out below:

We will use two libraries from Adafruit to help us easily communicate with the LCD. The libraries include the Adafruit GFX library which can be downloaded here and the Adafruit ST7735 Library which can be downloaded here.

We will use two example sketches to demonstrate the use of the ST7735 TFT display. The first example is the lightweight TFT Display text example sketch from the Adafruit TFT examples. It can be accessed by going to examples -> TFT -> Arduino -> TFTDisplaytext. This example displays the analog value of pin A0 on the display. It is one of the easiest examples that can be used to demonstrate the ability of this display.

The second example is the graphics test example from the more capable and heavier Adafruit ST7735 Arduino library. I will explain this particular example as it features the use of the display for diverse purposes including the display of text and “animated” graphics. With the Adafruit ST7735 library installed, this example can be accessed by going to examples -> Adafruit ST7735 library -> graphics test.

The first thing, as usual, is to include the libraries to be used after which we declare the pins on the Arduino to which our LCD pins are connected to. We also make a slight change to the code setting reset pin as pin 8 and DC pin as pin 9 to match our schematics.

Next, we create an object of the library with the pins to which the LCD is connected on the Arduino as parameters. There are two options for this, feel free to choose the most preferred.

Next, we move to the void setup function where we initialize the screen and call different test functions to display certain texts or images.  These functions can be edited to display what you want based on your project needs.

Uploading the code to the Arduino board brings a flash of different shapes and text with different colors on the display. I captured one and its shown in the image below.

That’s it for this tutorial guys, what interesting thing are you going to build with this display? Let’s get the conversation started. Feel free to reach me via the comment section if you have any questions as regards this project.

1.8 st7735r spi tft lcd display module quotation

Is there a difference between the NANO and MEGA that would account for ST7735 displays working on NANO and not working on MEGA? I"m using the same pins on both....

1.8 st7735r spi tft lcd display module quotation

You can use TFT displays in HMI products such as room temperature controllers and attendance systems, weather monitoring devices, infotainment systems, and even video game consoles.

This article is part of our series on the different types of displaysthat you can use with Arduino, so if you’re weighing up the options, then do check out our guide to the best displays to use with Arduino.

Let us see a view of a TFT LCD module. In the following section, we will see the pin definition and the pin mapping table for the connection between Arduino and the TFT display.

A0 / DCData Command Select Pin / Analog PinMost of the time, you have to find the relevant termination needed from the LCD datasheet. Terminate this pin to Logic high using a 10 ㏀

You can see the tradeoff here. Going for a better color resolution provides vibrant display options, but memory usage will increase with the color resolution.

There is a tradeoff between the quality of the display, power consumption, and the simplicity of coding. The TFT displays consume more power and need more programming than a simple monochrome display.

TFT displays provide a faster refresh rate and provide smoother transitions. The quicker processing improves the look and feels of the so-called user experience for the user.

The Arduino doesn’t need any special hardware to drive the controllers. The SPI or I2C interface can also be bit-banged, making it portable to any Arduino Board.

I am confident that the article was beneficial and easy to understand. I have used TFT displays in my hobby projects to learn more about the available libraries.

1.8 st7735r spi tft lcd display module quotation

The TFT liquid display is provided with a semiconductor switch for each pixel, and each pixel can be directly controlled by a point pulse, so each mode is relatively independent and can be continuously controlled, which not only improves the reaction speed of the display screen, but also can accurately control.

1.8 st7735r spi tft lcd display module quotation

This lovely little display breakout is the best way to add a small, colorful, and bright display to any project. Since the display uses 4-wire SPI to communicate and has its own pixel-addressable frame buffer, it can be used with every kind of microcontroller. Even a very small one with low memory and few pins available! The 1.8″ display has 128×160 color pixels. Unlike the low-cost Nokia 6110 and similar LCD displays, which are CSTN type and thus have poor color and slow refresh, this display is a true TFT! The TFT driver (ST7735R) can display full 18-bit color (262,144 shades!). And the 1.8 Inch SPI 128×160 TFT LCD Display Module will always come with the same driver chip so there are no worries that your code will not work from one to the other. The breakout has the TFT display soldered on (it uses a delicate flex-circuit connector) as well as an ultra-low-dropout 3.3V regulator and a 3/5V level shifter so you can use it with 3.3V or 5V power and logic. It features a microSD card holder so you can easily load full-color bitmaps from a FAT16/FAT32 formatted microSD card.

1.8 st7735r spi tft lcd display module quotation

TFT displays are full color LCDs providing bright, vivid colors with the ability to show quick animations, complex graphics, and custom fonts with different touchscreen options. Available in industry standard sizes and resolutions. These displays come as standard, premium MVA, sunlight readable, or IPS display types with a variety of interface options including HDMI, SPI and LVDS. Our line of TFT modules include a custom PCB that support HDMI interface, audio support or HMI solutions with on-board FTDI Embedded Video Engine (EVE2).

1.8 st7735r spi tft lcd display module quotation

I just wanted to share that I"ve soldered an Adafruit 1.8" TFT (http://adafruit.com/products/358) onto an Adafruit Proto Pi Plate (http://adafruit.com/products/801) and written code to display some info on it from the Pi. I"ve uploaded a video of it in action to http://www.flickr.com/photos/ngreatorex/7672743302/. I used pygame to produce the simple display show in the video.

The kernel module source is at https://github.com/ngreatorex/st7735fb if anyone is interested in doing the same. The module is based on the excellent work of Matt Porter at TI (see http://elinux.org/images/1/19/Passing_T ... Driver.pdf).

It is quite simple to wire up. It"s very similar to the Arduino (see http://learn.adafruit.com/1-8-tft-displ ... spi-wiring). Instead of using the Arduino pin numbers, you use the Raspberry Pi pin numbers as found at http://elinux.org/images/2/2a/GPIOs.png. For the TFT_CS and D/C pins, you should just pick unused GPIOs and ensure they are referenced in the code.

Been really impressed with the work you lot have been doing. Have an ST7735 based 1.8" LCD from Sainsmart that came as part of an Arduino UNO package.

Over the last few days I"ve been trying to get the 1.8" LCD working with the RPi for a project that I"m working on as it"ll mean I can possibly eliminate the use of an Atmel MCU / Arduino. However I"ve had no such luck with the ST7735 driver.

So far I"ve attempted to compile Kamal"s branch using the Occidentals 0.2 distro aswell as the wheezy-raspbian (2012-10-28). I"ve followed Kamal"s guide from "Configuring the kernel build", which goes through asking questions about configuring the ST7735 driver. I"ve used the same GPIO"s as Kamal for RST/DC, and just hit enter on the others. Even wired up the LCD the same.

This is an issue that I"ve been discussing with Kamal. The problem is that if you build in the ST7735 driver you also have to build in the BCM2708 SPI driver.

The two things that I thought might be a problem is the fact that I"ve built the ST7735 module into the kernel, but Kamal doesn"t seem to have a problem with this. My other thought was the BCM2708 conflicting with the ST7735.

The two things that I thought might be a problem is the fact that I"ve built the ST7735 module into the kernel, but Kamal doesn"t seem to have a problem with this. My other thought was the BCM2708 conflicting with the ST7735.

This is an issue that I"ve been discussing with Kamal. The problem is that if you build in the ST7735 driver you also have to build in the BCM2708 SPI driver.

The two things that I thought might be a problem is the fact that I"ve built the ST7735 module into the kernel, but Kamal doesn"t seem to have a problem with this. My other thought was the BCM2708 conflicting with the ST7735.

This is an issue that I"ve been discussing with Kamal. The problem is that if you build in the ST7735 driver you also have to build in the BCM2708 SPI driver.

Just an update. Followed Mark"s guide and cross compiled the kernel with the drivers as modules on my laptop and copied them across and now have the hobbit trailer running on the RPi.

Have recompiled so that spi_bcm2708 and st7735 are builtin to the kernel. Have had success with fbterm displaying the login and using mplayer. However still no luck with fbcon, adding the options to cmdline.txt seems to prevent the RPi from booting. Have checked .config and fbcon seems to be builtin:

It will not. To use fbcon, you must build the pair of drivers (st7735fb and st7735fb_map) as built-ins, not as modules (you must set their configs to "=y", not "=m").

And, as Neil mentioned, whenever you build the st7735 pair as built-ins you also need SPI_BCM2708 to be built-in... Currently, you must manually set CONFIG_SPI_BCM2708 to "=y". We"re working on determining a proper way to get that bit to happen automatically.

Since following Mark"s guide into building the kernel with the drivers as modules I followed Neil"s initial advice about changing CONFIG_SPI_BCM2708 to "Y" instead of "M" so that it"s a builtin. Did the same for the ST7735 driver aswell and rebuilt the kernel on the laptop. Which is great as the compile times don"t take all day

I"ve been getting a bit sidetracked and have been writing some test C/C++ code to display pixels on the framebuffer device. Seems to be working fine. Have noticed with the code that I"m using that the device gets returned as 16bpp in an RGB565 format. I know the LCD is sold as 18bit but I"m guessing the driver makes the fbdev into 16bit for some reason.

Just remembered something aswell, in the example you had "fbcon=map:10 fbcon=rotate:1 fbcon=font:ProFont6x11". After reading some docs on fbcon, I did wonder if the map was right as I would of thought to get tty1 to display on fb1 shouldn"t it be "fbcon=map:11"?

darryl wrote:Have noticed with the code that I"m using that the device gets returned as 16bpp in an RGB565 format. I know the LCD is sold as 18bit but I"m guessing the driver makes the fbdev into 16bit for some reason.

Just remembered something aswell, in the example you had "fbcon=map:10 fbcon=rotate:1 fbcon=font:ProFont6x11". After reading some docs on fbcon, I did wonder if the map was right as I would of thought to get tty1 to display on fb1 shouldn"t it be "fbcon=map:11"?

1.8 st7735r spi tft lcd display module quotation

This lovely little display breakout is the best way to add a small, colorful and bright display to any project. Since the display uses 4-wire SPI to communicate and has its own pixel-addressable frame buffer, it can be used with every kind of microcontroller. Even a very small one with low memory and few pins available!

The 1.8" display has 128x160 color pixels. Unlike the low cost "Nokia 6110" and similar LCD displays, which are CSTN type and thus have poor color and slow refresh, this display is a true TFT! The TFT driver (ST7735R) can display full 18-bit color (262,144 shades!). And the LCD will always come with the same driver chip so there"s no worries that your code will not work from one to the other.

The breakout has the TFT display soldered on (it uses a delicate flex-circuit connector) as well as a ultra-low-dropout 3.3V regulator and a 3/5V level shifter so you can use it with 3.3V or 5V power and logic. We also had a little space so we placed a microSD card holder so you can easily load full color bitmaps from a FAT16/FAT32 formatted microSD card. The microSD card is not included.