Questions? Call us: +1 760-918-6722

Initializing LCD for RGB Mode

What initialization steps are required when running the display in either 16-bit or 18-bit RGB modes? I see that IM[2:0] is externally wired to either 0b001 (16-bit mode) or 0b011 (18-bit mode), but it's not clear what the difference is for "RGB interface(1)" and "RGB interface(2)" for setting RCM[1:0].

I've also seen example code for a display using the ILI9341 driver IC instead of the ILI9163C that sends some commands via SPI to finish configuring the display, and I see that the ILI9163C also has a large set of commands. What commands/other initializaiton steps are needed before I can start sending the RGB data?

Replies

engineering_seacomp's picture
engineering_seacomp
February 11, 2019

Hi,

Below applies to MCU and RGB.  For RGB, there is no initialization code to make this work out of the box, just pin configuration.

The IM[1:0] bits are used to set the MCU interface to either 16 or 18 bit (01 or 11). IM2 selects either Serial (0) or parallel (1) MCU interface. So for example, IM[2:0] = 011 would mean the MCU interface is running in 18-bit serial mode.

The RCM1 bit is used to select either the MCU (0) or RGB (1) interface modes (for writing display data to frame memory). 

If the RGB interface mode is selected (RCM1 = 1), then RCM2 selects either RGB interface 1 (0) or RGB interface 2 (1). So to use RGB interface 1 you would set RCM[1:0] = 10.

The differences between the two are:

RGB Interface 1 (RCM [1:0] = 10) - Writing data to frame memory is done by PCLK and the data bus when DE is High. The controller must transfer the PCLK, VS, HS and DE signals to the driver.

RGB Interface 2 (RCM [1:0] = 11) - When the DE pin is High, display data is stored directly to frame memory. Blank porch setting is done using the B5h command (see page 152 of the display driver datasheet)

In the case of using the RGB interface (RCM1 = 1) with the Serial MCU interface (IM2 = 0), you can use the SDA pin for serial communication between your microcontroller and the display driver.  

dwane.sample's picture
dwane.sample
February 11, 2019

I am trying to work with the DT028BTFT. I am interfacing this to an FTDI EVE processor. The EVE uses a parallel RGB bus. I see in the data sheet that the display says it will work with an RGB bus structure, and looking at the driver chip on the display I can guess how the busses match up. What is not clear is how to configure the display to support this. The above reference refers to IM0-3, while the display has IM0-4. Addtional, the DT028BTFT lacks pins labled RCM, which mens that the informatio above won't work.

 

The data sheet is VERY sparse when it comes to details of configuration

 

 

chase's picture
chase
February 11, 2019

While the RCM[1:0] and IM[2:0] bits do need to be set properly for the display to be used in RGN mode, there are a few registers that need to be written to via the SPI interface in order to use it in RGB mode (or any mode really). This is mentioned in section 2.1 of this document for the EMB018TFTDEV board that uses this display, although some of the registers that the document references don't exist in the ILI9163C datasheet. I have managed to figure out how to get the display running on my own (there is still flickering issues that need to be sorted out) and I'm uploading a copy of my code for reference.

The display itself won't show anything until you send it the sleep out command (0x11). You also have to send the LCD_NORMAL_MODE_ON (0x13), LCD_DISPLAY_ON (0x29), LCD_PIXEL_FORMAT (0x3A), and fix the RGB order by writing 0b00001000 as the parameter with the 0x36 command. It's also important to note that the "SPI" interface uses the same lines for MOSI and MISO (one read on the rising clock edge and the other on the falling edge), and that you have to send a 9th bit for the display to know if the data is a command or a parameter (the display returns 8 bit values).

The ILI9163C doesn't explicitly say anywhere what the widths should be for VSYNC/HSYNC/DOTCLOCK (or PCLK as it's also called), unlike the ILI9341 datasheet, which has a handy table for this (values are not the same). I came up with some values that are working and are included in the attached .h file.

I also found it was necessary to adjust the values for the VCOM offset to reduce the horrible flickering that the screen has with the default values. I started with the values given in the example code that Displaytech provided and tweaked them a bit, but still haven't found the exact values to use yet to completely eliminate the flickering.

All in all, I would say that it was rather an ordeal to use this display in RGB mode, mostly because the documentation is poorly worded and doesn't explicitly give you some of the information.

Attachment: 
engineering_seacomp's picture
engineering_seacomp
February 12, 2019

Chase,

Thank you for your input.

 

Dwane,

To avoid any further confusion please re-post your question in the DT028BTFT forum (this thread is for the DT018ATFT display), as this is a different display with a different driver and pin-out.

 

Thanks