10 Replies Latest reply on Dec 23, 2016 2:14 AM by Andreas42

    ST7735 1.8" TFT Display on Edison Mini Breakout Board

    Andreas42

      I try to run this display on the Edison mini breakout board. Here are the connections I made: 

       

      DisplayLevel ShifterEdison
      CSB4A4J17-10CS136
      RESB5A5J19-11GPIO4338
      RS/DCB6A6J19-10GPIO4037
      SDAB7A7J17-12MOSI11
      SCLB8A8J17-11SCK10
      GNDGNDJ19-3GND30
      VCCVCCBJ20-2V_V3P3043
      OEJ19-3GND30
      VCCAJ19-2V_V1P8029

       

      For the level shifter, I use this TXB0108 bidirectional module. Here is the test program, I use:

       

      #include <unistd.h>
      #include <iostream>
      #include <signal.h>
      #include <upm/st7735.hpp>
      
      int shouldRun = true;
      
      void sig_handler(int signo)
      {
        if (signo == SIGINT)
        throw std::exception();
      }
      
      int main (void) {
          signal(SIGINT, sig_handler);
          std::cout << "starting application" << std::endl;
          upm::ST7735 * lcd = new upm::ST7735(36, 6, 37, 38);
          std::cout << "lcd initialized." << std::endl;
          lcd->fillScreen (ST7735_RED);
          std::cout << "fill red" << std::endl;
          lcd->refresh ();
          std::cout << "fill green" << std::endl;
          lcd->fillScreen (ST7735_CYAN);
          lcd->refresh ();
          lcd->fillScreen (ST7735_BLACK);
          lcd->refresh ();
          lcd->drawLine(10, 10, 10, 100, ST7735_MAGENTA);
          lcd->drawLine(20, 20, 10, 100, ST7735_YELLOW);
          lcd->drawLine(30, 30, 50, 100, ST7735_WHITE);
          lcd->refresh ();
          lcd->drawPixel (20, 20, ST7735_GREEN);
          lcd->refresh ();
          lcd->drawTriangle (50, 50, 80, 80, 60, 90, ST7735_GREEN);
          lcd->refresh ();
          lcd->drawCircle (100, 110, 10, ST7735_BLUE);
          lcd->refresh ();
          std::cout << "Text" << std::endl;
          lcd->setTextWrap(0x0);
          lcd->setCursor(0, 30);
          lcd->setTextColor(ST7735_BLACK, ST7735_RED);
          lcd->setTextSize(1);
          lcd->print("Hello World!");
          lcd->setCursor(10, 50);
          lcd->setTextColor(ST7735_RED, ST7735_YELLOW);
          lcd->setTextSize(2);
          lcd->print("BIG");
          lcd->refresh ();
          sleep(5);
          std::cout << "exiting application" << std::endl;
          delete lcd;
          return 0;
      }
      
      
      
      
      

       

      Unfortunately, the display does not work. I can run the program, the backlight is on, but the display shows no reaction. I have tried to run the display on an ESP8266 and it works without any problems. I also tried different pins for the CS line, e.g. MRAA number 9 (J17-10, SPI-5-CS1) or MRAA number 23 (J18-10, SPI-5-CS0) without success.

       

      What could be the problem or how can I troubleshoot the problem?

       

      Many thanks for your help,

       

      Andreas

        • 1. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Thanks for your interest in the Intel Edison Platform.

           

          It is very strange that your code is not working. Can you try checking your signals with an oscilloscope or a logic analyzer, this in order to look if there is a delay due to the level shifter.

           

          Also I found this code sample (upm/st7735.cxx at master · intel-iot-devkit/upm · GitHub ), you can try it after you verify that your signals have no delay. Let me know your results.

           

          I will be waiting for your reply, have a nice day.

           

          Best Regards,
          -Jose.

          • 2. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
            Andreas42

            I used an oscilloscope to look at the signals and found out, that the frequency of the signals is 25 MHz, which is way too fast for the display. I then looked in the source for the upm st7735 library, where the frequency is set to 15 Mhz, but obviously, this does not work, since I still see 25 MHz. So the question is, how can I reduce the frequency of the SPI signals? I think the display would work with a lower frequency, say about 1 Mhz or so.

            • 3. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi Andreas,

              The way to set the SPI frequency is through coding, like in the example that I provided in my previous reply. Analyzing your results I can deduce that there is some sort of delay, can you check if this delay is generated by the level shifter?  Please let me know your results.

              I will be waiting for your reply, have a nice day.

              Best Regards,
              -Jose.

              • 4. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Hi Andreas,

                Were you able to lower the frequency in order to make work the display? Please let me know your results I will be waiting for your reply.

                We hope you have a nice day!

                Best Regards,
                -Jose.

                • 5. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
                  Andreas42

                  Sorry, but I cannot see where the frequency is changed in the example, but I found it in the code for libupm-st7735. After updating mraa and upm to the newest version, the frequency was actually reduced to the value given in the source code, but the display is still not working. I think I will give up on the Edison and try a different platform. As I can see on the forum, other people have tried this before and failed as well, so I give up. I am not a professional developer, just wanted to use the Edison for some simple demonstrator, but things just get to complicated for me.

                   

                  Thank you for your help,

                   

                  Andreas

                  • 6. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Hi Andreas,

                    I'm sorry to hear that you are given up on the Edison. If you still want to continue working with the Edison, we will be happy to help. I can recommend you to contact the creator of the sample code that I provided in my previous reply (yevgeniy.kiveisha@intel.com). If you have any more questions, please don't hesitate to contact us.

                    Have a nice day.

                    Best Regards,
                    -Jose.

                    • 7. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
                      Andreas42

                      Finally I got the display to work. Here is how:

                       

                      First, I bought the Sparkfun Console Block, the Battery Block and the OLED Block, which worked right out the box with the open source code provided by Sparkfun. Excellent job done by Sparkfun. I really like their blocks. Unfortunately, the OLED is to small for my application. After I saw the video on this page, I thought I should give the ST7735 display another try on the Edison mini breakout board.

                       

                      I started from scratch with a new mini breakout board and soldered some new pins on the board for connecting the display in the same way it was connected in the Sparkfun tutorial page. Soldering was easy, after I found this tip and using a bread board for holding the pins prior to soldering.

                       

                      In the upm example for the ST7735 I changed the initialization of the display to match the GPIO ports I used and added some delays to actually see, what is going on:

                       

                      /*

                      * Author: Yevgeniy Kiveisha <yevgeniy.kiveisha@intel.com>

                      * Copyright (c) 2014 Intel Corporation.

                      *

                      * Permission is hereby granted, free of charge, to any person obtaining

                      * a copy of this software and associated documentation files (the

                      * "Software"), to deal in the Software without restriction, including

                      * without limitation the rights to use, copy, modify, merge, publish,

                      * distribute, sublicense, and/or sell copies of the Software, and to

                      * permit persons to whom the Software is furnished to do so, subject to

                      * the following conditions:

                      *

                      * The above copyright notice and this permission notice shall be

                      * included in all copies or substantial portions of the Software.

                      *

                      * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,

                      * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF

                      * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND

                      * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE

                      * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION

                      * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION

                      * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

                      */

                       

                      #include <string.h>

                      #include <unistd.h>

                      #include <iostream>

                      #include "st7735.hpp"

                      #include <signal.h>

                       

                      int

                      main(int argc, char **argv)

                      {

                      //! [Interesting]

                          upm::ST7735 * lcd = new upm::ST7735(31, 38, 20, 14);

                          lcd->fillScreen (ST7735_RED);

                          lcd->refresh ();usleep(500000);

                       

                          lcd->fillScreen (ST7735_CYAN);

                          lcd->refresh ();usleep(500000);

                       

                          lcd->fillScreen (ST7735_WHITE);

                          lcd->refresh ();usleep(500000);

                       

                          lcd->drawLine(10, 10, 10, 100, ST7735_MAGENTA);

                          lcd->drawLine(20, 20, 10, 100, ST7735_YELLOW);

                          lcd->drawLine(30, 30, 50, 100, ST7735_WHITE);

                          lcd->refresh ();usleep(500000);

                       

                          lcd->drawPixel (20, 20, ST7735_GREEN);

                          lcd->refresh ();usleep(500000);

                       

                          lcd->drawTriangle (50, 50, 80, 80, 60, 90, ST7735_GREEN);

                          lcd->refresh ();usleep(500000);

                       

                          lcd->drawCircle (100, 110, 10, ST7735_BLUE);

                          lcd->refresh ();usleep(500000);

                       

                       

                          lcd->setTextWrap(0x0);

                       

                          lcd->setCursor(0, 30);

                          lcd->setTextColor(ST7735_RED, ST7735_RED);

                          lcd->setTextSize(1);

                          lcd->print("Hello World!");

                       

                          lcd->setCursor(10, 50);

                          lcd->setTextColor(ST7735_RED, ST7735_YELLOW);

                          lcd->setTextSize(2);

                          lcd->print("BIG");

                       

                          lcd->refresh ();usleep(500000);

                       

                          std::cout << "exiting application" << std::endl;

                       

                          delete lcd;

                      //! [Interesting]

                          return 0;

                      }

                       

                      And finally it worked!

                      • 8. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        Hi Andreas42,

                        I'm glad to hear that your display is working! Thanks for sharing your results with the community! We appreciate your contribution, since it may benefit other users. If you have any more questions regarding the Intel Edison, please don't hesitate to contact us. 

                        We hope you have a nice day!

                        Best Regards,
                        -Jose.

                        • 9. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
                          GDriscoll

                          Hi Andreas,

                           

                          This is my second attempt with a display and the edison.  Any documentation is quite unhelpful.  Did you just use standard GPIO pins and PWM to get this working as indicated below?

                           

                          upm::ST7735 * lcd = new upm::ST7735(31, 38, 20, 14);

                           

                          Or did you use the pins indicated in your first post?

                          Display

                          Level ShifterEdison
                          CSB4A4J17-10CS136
                          RESB5A5J19-11GPIO4338
                          RS/DCB6A6J19-10GPIO4037
                          SDAB7A7J17-12MOSI11
                          SCLB8A8J17-11SCK10
                          GNDGNDJ19-3GND30
                          VCCVCCBJ20-2V_V3P3043
                          OEJ19-3GND30
                          VCCAJ19-2V_V1P8029

                           

                          Thanks!

                          • 10. Re: ST7735 1.8" TFT Display on Edison Mini Breakout Board
                            Andreas42

                            Hello,

                             

                            I did not use PWM. I connected the backlight to 3.3V. The connections I made are those used in the Sparkfun example. I have tried three different displays. The easiest to use is the one from Adafruit. It does not need a level shifter. The second display I used was one that I got from ebay. It only worked with the level shifter.

                             

                            tft.jpg

                            The third one is from Joy IT. It did not work at all on the Edison (with or without level shifter), but it worked on an ESP8266.

                             

                            So although being quite expensive, I would recommend to use the Adafruit dipslay.

                            tft2.jpg

                            Don´t hesitate to ask again, if you need more help.

                             

                            Kind regards,

                             

                            Andreas