How do you have the backlight hooked up? Like what they show on product pageI have two different TFT ILI9341 touch displays, running on a teensy 4.0 using the ILI9341_t3n library.
The smaller 2.8 display runs exactly as expected and it's back lit correctly.
The larger 3.2 display runs ok, but it's like the back light is too bright?
I'm not sure where to start looking to figure this out. Anyone dealt with this before or have any pointers for things I can try?
Here is a short clip to show you what it looks like:
Thanks!
Thanks Kurt.How do you have the backlight hooked up? Like what they show on product page
could up the ohm of resisto. Could hook that pin to io pin and control using pwm…
void loop()
{
////////////////////////////////////////////////////////////
// INSTANCES //
////////////////////////////////////////////////////////////
// iMAINVIEW
dc.imainview();
if (dc.activeinstance != iMAINVIEW)
{
// iSTANDBY mode
dc.istandby();
// iMENUs
dc.imenu();
dc.imenuinput();
dc.imenusetup();
dc.imenuscreen();
dc.imenucolors();
dc.imenupreamp();
dc.imenuir();
dc.imenuir1();
dc.imenuir2();
// iSETs
dc.isetfixed();
dc.isetoffset();
dc.isetinputname();
dc.isetbrightness();
dc.isetbacklight();
dc.isetgainspeed();
// iMISCs
dc.iinfoview();
}
//////////////////////////////////////////////////////////////
// TASKS //
// housekeeping fuctions that run all the time //
//////////////////////////////////////////////////////////////
dc.tasks();
irread(); // sets dc.irresult to the currently pressed/received ir remote button/signal or to IDLE if not pressed/recognised
displayfb();
// to monitor performance
monitor();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// fuctions using IRremote.h
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This is used to set class myDisplayControl variable irresult to a CONTROLS enum using irrcommand
inline void irread()
{
static uint32_t wait = millis();
if (millis() - wait > 130) ////////////////////////////// CRITICAL - Below 125 does not seem to work! Don't know why; hate this
{
if (IrReceiver.decode())
{
if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT) // if repeat dont change ircomand
{
IrReceiver.decodedIRData.flags = 0;
IrReceiver.resume();
}
else
{
IrReceiver.resume();
IrReceiver.decodedIRData.flags = 0;
if (IrReceiver.decodedIRData.command != 0) // this beats an annoying conflict that happens when udating too much of the screen
dc.ircommand = IrReceiver.decodedIRData.command; // by ignoring the 0 command. Suprised it worked.
dc.irtrigger = true;
Serial.println(IrReceiver.decodedIRData.command);
}
}
else
{
dc.ircommand = 0;
dc.irtrigger = true;
IrReceiver.resume();
}
wait = millis();
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// screen
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline void displayfb()
{
static uint32_t fbtimer = millis();
if (millis() - fbtimer > 16)
{
if (IrReceiver.isIdle())
tft.update((uint16_t *)im.data());
fbtimer = millis();
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// all the other fuctions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline void monitor()
{
static uint32_t loopcount;
static uint32_t looptimer = 0;
if (millis() - looptimer > 1000)
{
Serial.printf("Loops per second: %d\n", loopcount);
loopcount = 0;
looptimer = millis();
}
loopcount += 1;
}
inline void displayfb()
{
static uint32_t fbtimer = millis();
if (millis() - fbtimer > 1)
{
tft.update((uint16_t *)im.data());
fbtimer = millis();
}
}
By this do you mean that literally cannot open the file or it is not displaying the data on the screen?I can't seem to get them to open .bmp files
ok = SD.sdfs.begin(SdSpiConfig(chipSelect, SHARED_SPI, SD_SCK_MHZ(24)));
ok = SD.sdfs.begin(SdSpiConfig(chipSelect, DEDICATED_SPI, SD_SCK_MHZ(16)));
I discovered with ST7789 OLED displays, I needed to use a 11Mhz SPI bus to prevent the display from being corrupted on some displays. I found of the displays I had, the Adafruit displays needed 11-12Mhz, while the Newhaven displays could run with 18Mhz. I was using a soldered prototype board with a pinout for jumper wires to connect the display. I tended to use 6" jumper wires. If there was anything else on the SPI bus, I tended to need pull-up resistors on each of the CS pins and maybe on the D/C pins.Try bumping SPI clock down to 10 MHz. I seem to recall that the SPI clock was set higher than the data sheet for many displays would support. But that memory may not be reliable. We made a buffered/differential display interface design specifically for a manufacturing test fixture where the display must be located a couple of feet from the unit under test. It works reliably over three+ feet of cable but if I recall we run SPI clock at 10 MHz. If I get a chance I will look this up. Now that I think about it, it may already be in our (systronix) Github code repo.
Bruce
if (!SD.begin(4)) {
Serial.println("No SD card!");
}
aFile = SD.open(filePath);
inside there is a Teensy 3.2 soldered to an Adafruit 1947 cap touch screen "shield". The issue is that I can not open most .bmp files. I assume the hardware is fine, because I can swap back to the Adafruit drivers and everything is fine. Oh, (reading Kurt's post) using whatever SD came with teensyduino. Arduino 1.8.16 - teensyduino 1.55
Sorry still only enough information to throw and hope something hitsAnyhow.. it's the actual ..
C++:aFile = SD.open(filePath);
setup() {
pinMode(TFT_CS, OUTPUT);
digitalWrite(TFT_CS, HIGH);
pinMode(SD_CS, OUTPUT);
digitalWrite(SD_CS, HIGH);
...
You might try updating to 1.59 maybe installed on Arduino 1.8.19 or 2.x and see if that helps.TeensyDuino current is 1.59 - so lots of long tested updates since 1.55 - not sure if any SPI or other changes might change the usability?
setup() {
pinMode(TFT_CS, OUTPUT);
digitalWrite(TFT_CS, HIGH);
pinMode(SD_CS, OUTPUT);
digitalWrite(SD_CS, HIGH);
...
Most libraries do their own, but they don’t know anything about other devices. Some devices put PU resistors on their CS pins. But some may not. So if strange starting up issues arise, I will do something like I mentionedI've never done this because I was under the understnading that the SPI library or possibly the display library was taking cre of this. Is this not the case? Is everyone doing it like this?