I have designed and made my own board based on the STM32F103VC MCU. I have managed to program it through serial and the Arduino IDE to flash the backlight on and off. It has an ILI9341 based display connected to HW SPI2 of the STM32, as a nRF905 is connected to HW SPI1, and an SD card is on HW SPI3. I have used the following Arduino code to try and control the display:
#include <Adafruit_ILI9341_STM.h>
Adafruit_ILI9341_STM tft(PB12, PB11, PB10); // CS, DC, RST
void setup()
{
Serial.begin(9600);
delay(500);
pinMode(PB7, OUTPUT); // output to control backlight
pinMode(PC7, OUTPUT); // output to control power to RF IC and TFT
digitalWrite(PB7, LOW); // enable backlight mosfet
digitalWrite(PC7, LOW); // enable power to TFT and nRF905 IC
delay(1000);
Serial.println("test");
static SPIClass _spi(2);
tft.begin(_spi);
}
void loop(){
tft.println("Hello 1");
delay(1000);
tft.fillScreen(ILI9341_BLACK);
tft.println("Hello 2");
delay(1000);
}
This just flickers the display every now and then, probably when it tries writing to it. Are my pin assignments correct, and have I selected the SPI interface correctly?
According to the datasheet the interface select pins should be set like this to enable 4 wire 8 bit mode for the display's operation:
IM0: floating or 0
IM1: 2.8V or 1
IM2: 2.8V or 1
IM3: 2.8V or 1
Display module datasheet: https://cdn-shop.adafruit.com/datasheets/MI0283QT-11%20V1.1.PDF
I have attached the schematic of how it is connected to the MCU.
Could the SPI speed be too high? Could it be a power issue? The power rail is at 2.69V.
Thanks
Tom