Skip to content

Arduino Due + ILI9341 TFT + Adafruit libs: Arduino SPI extended mode does not work #84

@shiftleftplusone

Description

@shiftleftplusone

Arduino Due + ILI9341 TFT + Adafruit libs (IDE 1.6.3): Arduino SPI extended mode does not work:
when I start the test sketch by the following code, the program shows no TFT output, screen is light grey, just the Serial output:

// Adafruit ILI9340 / ILI9341

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9340.h"

#if defined(__SAM3X8E__)
    #undef __FlashStringHelper::F(string_literal)
    #define F(string_literal) string_literal
#endif

#define    tft_cs     10
#define    tft_dc      9
#define    tft_rst     8

Adafruit_ILI9340 tft = Adafruit_ILI9340(tft_cs, tft_dc, tft_rst);

void setup() { 
  Serial.begin(9600);
  // Setup the LCD
  SPI.begin(tft_cs);
  SPI.setClockDivider(tft_cs,21); // 21==4MHz (standard)
  tft.begin();
  tft.setRotation(3);
  tft.setTextColor(ILI9340_WHITE); tft.setTextSize(1);  
  Serial.println("tft started");
}

nevertheless, in the normal (AVR?) mode it works:

// Adafruit ILI9340 / ILI9341

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9340.h"

#if defined(__SAM3X8E__)
    #undef __FlashStringHelper::F(string_literal)
    #define F(string_literal) string_literal
#endif

#define    tft_cs     10
#define    tft_dc      9
#define    tft_rst     8

Adafruit_ILI9340 tft = Adafruit_ILI9340(tft_cs, tft_dc, tft_rst);

void setup() { 
  Serial.begin(9600);
  // Setup the LCD
  tft.begin();
  tft.setRotation(3);
  tft.setTextColor(ILI9340_WHITE); tft.setTextSize(1);  
  Serial.println("tft started");
}

Is it an Arduino IDE SPI issue?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions