Diagnostics Read
@GuitarHack: Please first take a look at this thread
https://forum.pjrc.com/threads/27860-ILI9341_t3-readRect()-writeRect()-bug and test if lowering SPI clock solves your problem.
Hi bkausbk - thanks so much! - that helped. I suspected that the SPI clock was too fast yesterday, but didn't test well enough with a slower clock. I have bumped it arbitrarily down to 10 MHz. and now I seem to be getting consistent results.
A couple of things I found:
on line 40 of ILI341_t3.h: the value for ILI9341_RDIMGFMT is incorrect at 0x0A (I was wondering why I always saw the same value as ILI9341_RDMODE). The line should be:
#define ILI9341_RDIMGFMT 0x0D
Here are the results:
ILI9341 Test!
Display Power Mode: 0x9C
MADCTL Mode: 0x48
Pixel Format: 0x5
Image Format: 0x0
Self Diagnostic: 0xC0 (or sometimes 0x0)
The Display Power Mode looks correct - indicating the following: Booster On, Idle Mode off, Partial Mode Off, Sleep Out Mode, Display Normal Mode, Display On. So it appears to me that 0x9C is the right value people should expect. (and not what I get on my other display, so a clue to my problem)
MADCTL: 0x48 is what we sent to it, so again this looks correct
Pixel Format: Still something weird here - we should get 0x55. The 5 for DBI is correct, MCU interface mode is 16 bit color mode. I tried changing the bottom nibble in the init code, and sure enough the read function followed what I changed in the init code, so this seems good. FWIW, the default value for DPI on reset shows as 000b (reserved) in the read function and 110b (18 bit mode) in the write function. Weird. Anyone know the right answer here? Chip Bug?
Image Format: 0x0 - This indicates Gamma Curve 1, seems this is the right answer
Self Diagnostic: Multiple reset sequences give me either 0x0 or 0xC0. 0xC0 indicates that register loading is working and the display is functional. Getting 0x00 indicates a problem, but I don't see any difference off hand in the display itself - it is possible that there is a latent problem here
Anyone else care to try themselves and report on Pixel Format and Self Diagnostics?
thanks everyone!