adafruit st7735 tft display 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.

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.

testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", ST7735_WHITE);

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.

adafruit st7735 tft display quotation

If anyone has one of these displays that you thought was broken, here is a working sketch based on an 8051 driver example I received from the Chinese vendor. Perhaps it will help get someone started... I took the function initial() from this sketch and added it to Bodmers ST7735_init.h for my "BLUETAB" version which is the subject of this topic.

adafruit st7735 tft display quotation

This Bare Basic deals with connecting an Arduino with a breakout, serial SPI interfaced, 160×128 pixel color TFT display with a screen diagonal of 1.8 inch. The controller chip is a ST7735S.

The Sitronics ST7735 is a versatile display controller chip used to drive affordable, Arduino compatible TFT screens with moderate dimensions (1.8 inch display diameter; 160×128 pixels; 16-bit color). Displays with this chip can be applied as output color graphics / text display in an Arduino environment. An interesting library written by Adafruit exits that provides sufficient tools to create colorful, attractive presentation of data.

Once an Arduino has collected and manipulated data, display of the output is obvious. Reporting can be arranged via the Arduino IDE and Serial Monitor, but in this situation the Arduino must be connected to a computer while there is no way to directly produce graphical output. A separate display can be very handy for graphical data display and is especially recommended in standalone applications.

Displays for the Arduino are available in all kinds and price classes. I distinguish three groups: LCD, OLED and TFT. Well known is the monochrome LCD display with a blue or green background, usually with two lines of 16 characters or 4 lines of 20 characters, with each ‘character’ created in its own 8×5 pixel matrix. These LCD displays are good for displaying short messages or numerical values while they lack graphical capabilities and colors. Special LCD displays are the 128×64 monochrome numerical/graphical LCD display whose library offers a few primitive graphics, and the Nokia 5110 84×48 LCD display with a PCD8544 controller. LCD displays do not offer colors other than background versus character.

Figure 1: 1.8 inch 160×128 color TFT display with SPI interface on a breakout board (ST7735 compatible). Left: simple sketch showing text mode; right: graphics test mode.

A special kind of LCD is the OLED display. This family includes small, programmable graphical displays (64×32 or 128×32 pixels) in monochrome or full color.

More versatile than the LCD displays, as well as larger, are TFT displays (fig 1). These are capable of graphics and a spectrum of colors (65,536 up to 256,000 colors) to the degree that they support realistic display of color pictures. TFT displays can be bought in a dazzling array of sizes, resolution, interfaces and prices.

TFT displays for the Arduino microcontroller boards can be accessed via an 8-bit parallel data interface – fast but consuming at least 8 pins of the Arduino. An alternative is the serial SPI interface which needs only five pins.

Figure 2: Wiring of the 160×128 SPI 1.8 inch color TFT display. Note that more expensive displays have a voltage level shifter on board. This makes it possible to connect VCC with 5V instead of 3.3V as in this clone situation.

Here is a no-frills sketch that does what is needed; display some message on the display, with some color and two graphic element (one visible: the frame rectangles and one invisible: the rectangles filled with the same color as the background used to wipe out text).

ST7735 controller based TFT displays are very handy displays for use in Arduino applications. One typical application is a standalone weather station built around an Arduino platform and decorated with temperature, humidity and barometric pressure sensors. The ST7735 is less sophisticated as the bigger parallel TFT screens but displays based on this chip form a nice intermediate between the ‘big’ TFTs and the basic LCD displays.

adafruit st7735 tft display quotation

The 1.8" display has 128x160 color pixels. The TFT driver (ST7735) can display full 18-bit color. The breakout has the TFT display soldered on (it uses a delicate flex-circuit connector)

In the above example, Node32-Lite and this 1.8-inch LCD.  Please refer to the tutorial here: ST7735S interfacing with ESP32 to make the connections, Arduino library installation, and modification needed for it to works on this LCD.

adafruit st7735 tft display 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.

Though you guys would most likely want some dump of my setup. My latest attempt has been with wheezy distro and Kamal"s branch. To setup the config I did as per his guide and used "make bcmrpi_defconfig", followed by the SED command to modify the config file so that the make oldconfig would run through setup questions relating to 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.

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.

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"?

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"?

No, my suggested map setting (fbcon=map:10) is correct: it maps tty1 to fb1 (the ST7735 panel) and tty2 to fb0 (the Pi"s native GPU framebuffer). See http://www.kernel.org/doc/Documentation/fb/fbcon.txt for more details.

adafruit st7735 tft display quotation

Does anyone happen to have any code (the simpler the better, bit-banging is fine) for driving an ST7735 TFT display via SPI on an MSP430 Launchpad? For example, one of these:

I have one (although not the Adafruit model). It came with some really dubious and badly written Arduino sample code. After doing a simple conversion to MSP430 assembly, it of course doesn"t work, and debugging is going to be a pain as there are no diagnostics.

adafruit st7735 tft display quotation

The TFT isn’t ‘plug & play’ with the Raspberry, a patch has to be applied to the kernel to be able to interface via SPI with the ST7735R controller chip on the TFT. Once working, the display will act as a framebuffer device.

-Get Kamal’s source which has the patch for ST7735R controller and the branch for the kernel that is used in 2013-02-09-wheezy-raspbian, which is 3.6.y;

If you are planning on displaying the console on the TFT, then enabling these options in .config will allow you to change the font size and rotate the display later on.

If you build the st7735 driver pair as built-in, add these options to the end of the line in /boot/cmdline.txt. This will display the console on the TFT.