Go Down

Topic: ILI9341(new)SPI library for Due supporting DMA transfer(Uno, Mega,.. compatible) (Read 56262 times) previous topic - next topic



I tested the following configurations:

1          -                X               X                   |            NO                    YES             1
2          X                -              X                   |            YES                   YES             1
3          X                -               -                   |            YES                   YES             1
4          -                X               -                   |            NO                    NO             2

The test 4 crashed, you can see the value 99 which was initially 100 to decrease.

My configuration:

Arduino DUE
Arduino Ethernet with w5100
Arduino IDE 1.6.11



Those YES/NO means whether it worked or not? So for example line 1, DMA ON, TRANSACTION ON and Ethernet did not work but the graphics/ILI9341 worked?



.. sorry ... but:




Well I guess the good thing is that the graphics worked when transactions were on in ILI9341_due. If transactions are not used then SPI settings are basically set to whichever library initializes it last.


Sep 22, 2016, 03:30 am Last Edit: Sep 22, 2016, 05:42 am by julyjim
I am posting here because it pertains to the library this discussion has been going on for a while.
I suppose it could be in its own thread.

Last command send to the ILI9341 in  getDisplayStatus(void) function is ILI9341_RDSELFDIAG.
I have verified all commands and they report correct data.
However , I am getting "not working" responses from selfdiagnostoic command.
Could someone double check this. It may be nothing or bogus commend.
I would appreciate that. 
Here is code snippet I use.


PS This  getDisplayStatus function is what separates boys from men. Very nice work !

I am, also getting  bogus bits per pixel - should be 16 and I  am getting "reserved " value.
I would not ruled out error in doc, so I am not getting too concerned about that..
But I also get no product ID . 
Neither one of these will affect the works anyway.

Code: [Select]
  x = readcommand8(ILI9341_RDSELFDIAG);
/*  commented out for forum post
  TraceTree_ellipses(1, 0, 0, (char*)__func__, __LINE__ , __FILE__, " uint8_t x = readcommand8(ILI9341_RDMODE); ",
                     4, "x status ", x , "command ILI9341_RDSELFDIAG", ILI9341_RDSELFDIAG);
  Serial.print(F("Self Diagnostic: 0x")); Serial.println(x, HEX);
  Serial.print(F("  Register Loading: ")); Serial.println(x & 0x80 ? F("working") : F("not working"));
  Serial.print(F("  Functionality: ")); Serial.println(x & 0x40 ? F("working") : F("not working"));
  if (!(x & 0x80 ) | !(x & 0x40))
      Serial.println("WARNING Did not passed selfdiagnostic ");
      // while(1); debug temp stop


Hey Jim,

here's my getDisplayStatus:

Code: [Select]
Display Power Mode: 0x9C
  Booster: On and working OK
  Idle Mode: Off
  Partial Mode: Off
  Sleep Mode: Off
  Display Normal Mode: On
  Display: On
MADCTL Mode: 0x48
  Top to Bottom
  Right to Left
  Reverse Mode
  LCD Refresh Top to Bottom
  LCD Refresh Left to Right
Pixel Format: 0x5
  16 bits/pixel
Image Format: 0x0
  Gamma curve 1
Display Signal Mode: 0x0
  Tearing effect line: Off
  Tearing effect line: mode 1
  Horizontal sync: Off
  Vertical sync: Off
  Pixel clock: Off
  Data enable: Off
Self Diagnostic: 0xC0
  Register Loading: working
  Functionality: working

Try to increase ILI9341_SPI_CLKDIVIDER to 10, I was getting some bogus reads when set to 1 or 2.


the issue I am having is that uint8_t readcommand8(uint8_t c) I am using only reads 8 bits send by ILI9341 and misses "parameters" when they are send.
So - you  cannot get ID because only the parameters carry the data.
I'll eventually ether find the correct "SPI transfer " function or fix it, not to worry

You must be reading 16 bits from the SPI register - this  is how you are getting the self diagnostic repose which comes in second  parameter

I am still looking for someone to  answer the "what is D9 command"?

I need to know that to figure out what is it doing  uint8_t readcommand8(uint8_t c) .
The "preamble" sequence write command D9 and write last 10 is the key.

Code: [Select]
    uint8_t readcommand8(uint8_t c) {

      writecommand_cont(0xD9);  // woo sekret command?

      writedata8_last(0x10);        // ?

      writecommand_cont(c);      // actual command

      return readdata8_last();

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131