Lead

Jan 31 13 11:57 AM

Tags : :

First, the microcontroller connected to the 2.8" ili9341 is the NXP LPC1788.  It is connected in RGB 565 mode, DE Mode.  The LPC1788 has an itegraded Graphics Controller that will handle the display in RGB mode.  We are using an external static RAM chip to handle the screen buffer updates.  The GUI package is emWin version 5.16 that handles updating the screen buffer.  The model of ili9341 that was specified for our product is the 6 oclock viewing angle.  I have sent the SPI initialize commands that was give to me from DisplayTech.  I do have an image but it is oriented in Portrait (6 oclock) mode.  Is it possible for this display to show an image in Landscape by some special SPI command during setup?  The image is also shifted 2/3 off the screen.  Not sure what this is either.  Any help is appreciated.

Thanks,
Robert

Quote    Reply   

#1 [url]

Jan 31 13 1:37 PM

Robert-

Your best bet is to adjust the orientation of the output of your controller.  There are memory scan direction controls on-board the ILI9341, although they really only apply to the parallel connection (when the device is using its internal RAM).  The reason the image is only 2/3 of the display is that the RGB signal coming out is in the opposite orientation that the ILI9341 is expecting, i.e. you are writing 320 pixels in one direction when it should be 240 and vice-versa in the other direction.

Almost all graphics controllers allow you to swap the orientation of the frame buffer with one or two register settings, doing so on the NXP should be relatively trivial as well.  If not, you will need to change your primitive graphics functions (those that write pixels to the frame buffer) to flip the orientation by which they put pixels on the screen.

-Allan

Quote    Reply   

#2 [url]

Jan 31 13 1:59 PM

Hi Allan,
Thanks for the update.  I have looked at the LPC1788 registers for the LCD and Static RAM with no luck finding anything regarding orientation described.  I believe emWin can rotate an image in a buffer before showing but this seems like alot of overhead for each screen that has multiple strings and bitmaps.  I will keep looking into the register setup.

Robert

Quote    Reply   

#4 [url]

Feb 1 13 8:21 AM

Robert-

Have you modified the Memory Access Control register, 0x36?  If you have, I would revert to the default.  If you have not modified it, I would change the MV (D5) bit and see if that solves your problem.

-Allan

Quote    Reply   

#5 [url]

Feb 1 13 11:39 AM

Hi Allan,
These are the commands / parameters that I send currently.  I will test the suggestions.

  //Software Reset
  GfxTconWriteCommand(0x01);
  _DelayMs(200);
  //RGB
  GfxTconWriteCommand(0xB0);
  GfxTconWriteParameter(0xC0);
  //Interface control
  GfxTconWriteCommand(0xF6);
  GfxTconWriteParameter(0x01);
  GfxTconWriteParameter(0x01);
  GfxTconWriteParameter(0x06);
  //Pixel format
  GfxTconWriteCommand(0x3A);
  GfxTconWriteParameter(0x56);

  // Memory Access Control
  GfxTconWriteCommand(0x36);
  GfxTconWriteParameter(0x48); // Row-Col Exch, BGR color direction

  // Sleep Out
  GfxTconWriteCommand(0x11);
  _DelayMs(200);

  //Display On
  GfxTconWriteCommand(0x29);

Thanks
Robert

Quote    Reply   

#6 [url]

Feb 4 13 8:12 AM

I was able to get the image to shift by setting the micro registers to have the horizonatal axis as 240 and the vertical axis as 320.  There are still mulitple images on the screen.  Is there a model with the same driver / pinout that is 320x240?  I'm not sure if this is a LPC1788 issue or a horizontal / vertical sync timing issue.  The data sheet for ILI9341 had some values for horizontal and vertical settings based on QVGA I believe.  What values should we use for this ILI9341 display?  Here are my settings for the NXP LPC1788.

#define TIMH_HBP 64 // Horizontal Back Porch
#define TIMH_HFP 0 // Horizontal Front Porch
#define TIMH_HSW 35 // Horizontal Synchronization pulse width
#define TIMH_PPL 14 // Pixels per line for 240
#define TIMH_RSV 0 // Reserved

#define TIMV_VBP 2 // Vertical Back Porch
#define TIMV_VFP 4 // Vertical Front Porch
#define TIMV_VSW 2 // Vertical Synchronization pulse width
#define TIMV_LPP 319 //320-1

#define POL_PCD_HI 0 
#define POL_BCD     0 
#define POL_CPL     239 // 240-1 
#define POL_RSV     0 
#define POL_IOE     0 
#define POL_IPC     0 
#define POL_IHS     1 
#define POL_IVS  1 
#define POL_ACB     0 
#define POL_CLKSEL 0 
#define POL_PCD_LO 0x11 // divide by produces 6.4 MHz pixel clk

Thanks,
Robert


Quote    Reply   

#7 [url]

Feb 4 13 9:32 AM

Robert-

Unfortunately I don't have any example code for the NXP parts.  I think your best bet would be to connect a scope to your timing signals (HSYNC, VSYNC, ENABLE) and determine if the timing is correct for the landscape mode.

-Allan

Quote    Reply   

#8 [url]

Feb 5 13 1:45 AM

Hi All,

according to the datasheet of the ILI9341 the HBP = 20 and not 64, HFP  = 10 and HSW = 10.
but I am not sure that it'is working fine because I use the ILI9341 and I try to display an image with RGB interface after registers configuration with SPI interface (4 wires) without success.

(the microcontroller connected to the 2.8" ili9341 is the STM32F4. It is connected in RGB 565 mode, DE Mode, The STM32F4 has an itegraded Graphics Controller that will handle the display in RGB mode)

I configured the RGB interface registers as mentionned above but no life on LCD, so I displayed an image on the screen with SPI to check the hardware without probelem.

is that the sequence mentioned above is all that is necessary to enable and configure
the RGB interface?

Thanks,

Best Regards,
bennacef

Quote    Reply   

#10 [url]

Feb 5 13 7:55 AM

bennacef-

Yes, the above code should configure the iLI9341 for RGB.  Specifically, the commands 
GfxTconWriteCommand(0xB0);
  GfxTconWriteParameter(0xC0);
Put the device in RGB.  It sounds like your serial interface is working properly, but have you confirmed the IM pins are IM3:0 = 0001?

-Allan

Quote    Reply   

#11 [url]

Feb 5 13 8:15 AM

I had similar results but found the Pixel Clock from the LPC1788 was too fast (60MHz).  Once I slowed the pixel clock to 6.4 MHz there was a visible image I was trying to display.

RM

Quote    Reply   

#12 [url]

Feb 5 13 9:05 AM

Hi All,

I configured the (B0) register to set the RGB interface in DE mode and the pixel clock is configured at 6Mhz but without success.
I configured the IM3:0 pins as follow : 0110 to select the serial interface 4 wires to configure the ILI9341 registers.is that once the registers are configured I change the configuration of the IM3:0 pins ?
 
Bennacef.

Quote    Reply   

#13 [url]

Feb 6 13 8:23 AM

Bannacef-

You should never have to change the IM pins.  Have you verified that the B0 register is actually getting changed?  Have you read it back after writing it?

-Allan

Quote    Reply   

#14 [url]

Feb 6 13 9:11 AM

Hi Alan,
It turns out our external SRAM only has A0 - A15 connected giving an addressable range of only 2^16 or 65535 bytes.  The data seems to repeat every 65535 causing this muliple image effect.  Is it possible with the current RGB mode connection to move to the Parallel mode using the internal RAM of the ILI9341 chip?  Do you know if emWin GUI will work with this Parallel setup?

Thanks,
RMoss

Quote    Reply   

#16 [url]

Sep 25 13 3:09 PM

Hi All,

I try to rotate an image using an ILI9341 LCD_TFT (from portrait to landscope) without success.
according to the datasheet of the ILI9341,I modified the LCD timing and I modified some registers:

  /* colomn address set */
  LCD_WriteCommand(0x2A);
  LCD_WriteData(0x00);
  LCD_WriteData(0x00);
  LCD_WriteData(0x01);
  LCD_WriteData(0x3F);

  /* Page Address Set */
  LCD_WriteCommand(0x2B);
  LCD_WriteData(0x00);
  LCD_WriteData(0x00);
  LCD_WriteData(0x00);
  LCD_WriteData(0xEF);

  LCD_WriteCommand(0x36);
  LCD_WriteData(0xA8);

The result is only 2/3 of the image displayed.
Are there any other modifications to be done ?

Thanks,
Bennacef 

Quote    Reply   

#17 [url]

Jul 14 14 6:44 AM

For the ILI9341, RGB mode doesn't support landscape video. Register 0x36 is invalid in this mode.

If you want to rotate the video, you must use one of 2 methods.
1) First rotate landscape to portrait video using a buffer, and then send the data to the TFT module normally.
2) Change the interface from RGB mode to MCU mode.

Quote    Reply   
Add Reply

Quick Reply

bbcode help