adafruit / adafruit/TFTLCD-Library

reset issue

Open
#18 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
377
Forks
262
Avg merge
1m
Merged PRs (30d)
1

Description

I encountered an issue using the graphicstest sketch with an ILI9341 controller.

If readID() is called directly after reset() ( as the graphicstest sketch does )
the ILI9341 does not have enough time to properly reset before readID() is called.
In my case this caused an erroneous id of: 0xC0C0 to be reported.
Adding a delay of 2 ms. between readID() and reset() resolves this issue.

Rather than modifying each sketch, a better solution would of course be to add the
delay to the reset() function within Adafruit_TFTLCD.cpp as follows:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void Adafruit_TFTLCD::reset(void) {

CS_IDLE;
// CD_DATA;
WR_IDLE;
RD_IDLE;
# ifdef USE_ADAFRUIT_SHIELD_PINOUT

digitalWrite(5, LOW);
delay(2);
digitalWrite(5, HIGH);
# else

if(_reset) {
digitalWrite(_reset, LOW);
delay(2);
digitalWrite(_reset, HIGH);
}
# endif

```
delay(2); // add delay here
```

// Data transfer sync
CS_ACTIVE;
CD_COMMAND;
write8(0x00);
for(uint8_t i=0; i<3; i++) WR_STROBE; // Three extra 0x00s
CS_IDLE;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Cheers,
Russ

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in Adafruit_TFTLCD.cpp and inspect Adafruit_TFTLCD::reset(), then compare its timing with the graphicstest sketch's immediate readID() call. Confirm the ILI9341 reset sequence has enough delay and verify that graphicstest reports the expected controller ID after reset.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.