Showing results for 
Search instead for 
Did you mean: 

Hi, I have this TFT SPI Touch Display ILI9341, program Arduino 1.6.5., and developement board STM32F103C8T6. And I need initialize the display.I have program, but all Power Mode, MADCTL Mode is 0xFF !!! on output.WHERE I HAVE PROBLEM ????? code is in deta


#include <Adafruit_GFX.h> // this line I have added

#include "SPI.h"

#include "Adafruit_GFX_AS.h"

#include "Adafruit_ILI9341_STM.h"

// For the Adafruit shield, these are the default.

#define TFT_DC   PA0   //  (Green) 

#define TFT_CS   PA1   //  (Orange) 

#define TFT_RST   PA2   //  (Yellow)

// STM32 - TFT

// 5v  - VCC

// GND  - GND

// PA0  - DC

// PA1  - CS

// PA2  - RST

// PA5  - SCK

// PA6  - MISO

// PA7  - MOSI

// 5v  - LED A

Adafruit_ILI9341_STM tft = Adafruit_ILI9341_STM(TFT_CS, TFT_DC, TFT_RST); // Use hardware SPI 

void setup() {


 Serial.println("ILI9341 Test!"); 


 // read diagnostics (optional but can help debug problems)

 uint8_t x = tft.readcommand8(ILI9341_RDMODE);

 Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);

 x = tft.readcommand8(ILI9341_RDMADCTL);

 Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);

 x = tft.readcommand8(ILI9341_RDPIXFMT);

 Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);

 x = tft.readcommand8(ILI9341_RDIMGFMT);

 Serial.print("Image Format: 0x"); Serial.println(x, HEX);

 x = tft.readcommand8(ILI9341_RDSELFDIAG);

 Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX); 


 Serial.println(F("Benchmark        Time (microseconds)"));

 Serial.print(F("Screen fill       "));



 Serial.print(F("Text           "));



 Serial.print(F("Lines          "));



 Serial.print(F("Horiz/Vert Lines     "));

 Serial.println(testFastLines(ILI9341_RED, ILI9341_BLUE));


 Serial.print(F("Rectangles (outline)   "));



 Serial.print(F("Rectangles (filled)   "));

 Serial.println(testFilledRects(ILI9341_YELLOW, ILI9341_MAGENTA));


 Serial.print(F("Circles (filled)     "));

 Serial.println(testFilledCircles(10, ILI9341_MAGENTA));

 Serial.print(F("Circles (outline)    "));

 Serial.println(testCircles(10, ILI9341_WHITE));


 Serial.print(F("Triangles (outline)   "));



 Serial.print(F("Triangles (filled)    "));



 Serial.print(F("Rounded rects (outline) "));



 Serial.print(F("Rounded rects (filled)  "));





void loop(void) {

 for(uint8_t rotation=0; rotation<4; rotation++) {









tft.readcommand8 probably does not work as you intend.

There's not much arduino help here. You may want to go the stm32duino forum.



please, in the ILI9341 on board is (microcontroller) PCD8544 or MIO283QT9A or what ???

PCD8544 is controller to drive old-style segment black and white LCDs, it has nothing to do with ILI9341.