5 Replies Latest reply on Jul 29, 2016 1:21 PM by Pinnokkio

    Unable to get Adafruit 2.8" TFT display work for Arduino Edison

    X_Y

      I was trying out the Adafruit screen with KurtE's library, following the discussion from Support for the Adafruit 2.8" TFT display for Arduino Edison

       

      Everything was working fine, until I got my Edison semi-bricked when I was trying to use a servo. Things turned out really weird afterwards: I got a new Edison, followed the Edison getting started guide, using the same connection for the screen, uploaded the code, but it simply doesn't work anymore. I tried yet another Edison from scratch, with nothing coming up what so ever. So basically KurtE's library stopped working without me making any changes. Following are the serial output from the graphicstest:

       

      ILI9341 Test!

      Display Power Mode: 0x0

      MADCTL Mode: 0x0

      Pixel Format: 0x0

      Image Format: 0x0

      Self Diagnostic: 0x0

      Benchmark                Time (microseconds)

      Screen fill

       

      I tried the same screen and connection on a Galileo with the same code and library, it worked out fine.

       

      Have anybody tried the screen with KurtE's library?

        • 1. Re: Unable to get Adafruit 2.8" TFT display work for Arduino Edison
          Intel_Peter

          Hello X_Y,

           

          Unfortunately I don't have an Adafruit 2.8" TFT to test this library, but which version of the library are you using? The Arduino library or the MRAA library?

           

          I took a quick look at KurtE's github and I believe his library has been updated, maybe you were working on an older version.

          KurtE, what do you think about this?

           

          Peter.

          • 2. Re: Unable to get Adafruit 2.8" TFT display work for Arduino Edison
            KurtE

            @X_Y and Intel_Peter

            I am not sure?

             

            New board?  Or just new Edison?  did you update to latest firmware?

             

            Arduino library I think was last updated 3 months ago.  Assume you downloaded the Edison branch of the library.    If using MRAA side make sure you have updated MRAA libraries as I think the one that shipped with last firmware had issues.  If cross compiling on PC side, make sure libraries are up to date on that side as well.

             

            I have not made many changes in awhile  These days mostly doing stuff from Eclipse side...   My libraries for that are reasonably up to date and up on github (whole workspace edison_eclipse).  Note I don't have all of the eclipse settings being uploaded there, but the code is...

             

            Kurt

            • 3. Re: Unable to get Adafruit 2.8" TFT display work for Arduino Edison
              Intel_Peter

              X_Y,

               

              I understand that the library uses SPI did you enable it before trying to use it?

              If you didn't this is what you need to do to set it up:

               

              # echo 43 > /sys/class/gpio/export
              # echo 262 > /sys/class/gpio/export
              # echo 241 > /sys/class/gpio/export
              # echo 259 > /sys/class/gpio/export
              # echo 227 > /sys/class/gpio/export
              # echo 214 > /sys/class/gpio/export
              # echo low > /sys/class/gpio/gpio214/direction
              # echo high > /sys/class/gpio/gpio262/direction
              # echo low > /sys/class/gpio/gpio241/direction
              # echo mode0 > /sys/kernel/debug/gpio_debug/gpio43/current_pinmux
              # echo low > /sys/class/gpio/gpio259/direction
              # echo in > /sys/class/gpio/gpio227/direction
              # echo in > /sys/class/gpio/gpio43/direction
              # echo high > /sys/class/gpio/gpio214/direction
              

               

              Peter.

              • 4. Re: Unable to get Adafruit 2.8" TFT display work for Arduino Edison
                KurtE

                You should not need to manually do this.  The Arduino version uses the SPI library which the function

                void SPIClass::begin()

                {

                    /* Set the pin mux, for the SCK, MOSI and MISO pins ONLY

                     *

                     * Leave the SS pin in GPIO mode (the application will control it)

                     * but set it's direction to output and initially high

                     */

                    pinMode(SPI_SS_GPIO_PIN, OUTPUT);

                    digitalWrite(SPI_SS_GPIO_PIN, HIGH);

                    muxSelectSpi(1);

                 

                    this->fd = open(LINUX_SPIDEV, O_RDWR);

                    if (this->fd < 0) {

                        trace_error("Failed to open SPI device\n");

                        return;

                    }

                 

                    /* Load default/last configuration */

                    this->setClockDivider(this->clkDiv);

                    this->setBitOrder(this->bitOrder);

                    this->setDataMode(this->mode);

                }

                Should automatically do it as part of muxSelectSpi(1).    With the other versions, I use MRAA, which again should take care of this for you, depending on the which board...

                • 5. Re: Unable to get Adafruit 2.8" TFT display work for Arduino Edison
                  Pinnokkio

                  Hi,

                   

                  We are trying the ILI9341 display with Intel Edison for Arduoni Board.

                   

                  On Adafruit ILI9341 shield, we jump-soldered IM1, IM2 and IM3 (https://learn.adafruit.com/adafruit-2-dot-8-color-tft-touchscreen-breakout-v2/spi-wiring ) to enable SPI communication as indicated on their website.

                   

                  We are testing the upm example code (upm/ili9341.js at master · intel-iot-devkit/upm · GitHub ) could but received the 'Invalid GPIO Pin specified' error. I have attached pictures of the code and the hardware setup.

                   

                  Code.JPG

                   

                  Hardware connection.JPG

                   

                  Can you please help us in debugging this?

                   

                  Best,

                   

                  Pratik