Dear Sparkfun members,
is there anyone who can direct me or teach me how to interpreter datasheets of Chip Drivers.
I want to understand the register thing.
I’ll give an example, with this please enlighten me.
For convenience, let’s focus on the ILI932X_DISP_CTRL1
I get was is written in register.h → the 0x07
but i don’t get how that makes → 0x0133 in the adafruit_GFX.cpp.
I can’t make heads or tails from the given information or from the datasheet.
How do they work together? What am i missing here?
kind regards
And thanks in advance for the time you’re giving.
Lorcan
taken from adafruit_GFX.cpp, register.h and the ILI9325 datasheet.
adafruit_GFX.cpp
static const uint16_t ILI932x_regValues PROGMEM = {
ILI932X_START_OSC , 0x0001, // Start oscillator
TFTLCD_DELAY , 50, // 50 millisecond delay
ILI932X_DRIV_OUT_CTRL , 0x0100,
ILI932X_DRIV_WAV_CTRL , 0x0700,
ILI932X_ENTRY_MOD , 0x1030,
ILI932X_RESIZE_CTRL , 0x0000,
ILI932X_DISP_CTRL2 , 0x0202,
ILI932X_DISP_CTRL3 , 0x0000,
ILI932X_DISP_CTRL4 , 0x0000,
ILI932X_RGB_DISP_IF_CTRL1, 0x0,
ILI932X_FRM_MARKER_POS , 0x0,
ILI932X_RGB_DISP_IF_CTRL2, 0x0,
ILI932X_POW_CTRL1 , 0x0000,
ILI932X_POW_CTRL2 , 0x0007,
ILI932X_POW_CTRL3 , 0x0000,
ILI932X_POW_CTRL4 , 0x0000,
TFTLCD_DELAY , 200,
ILI932X_POW_CTRL1 , 0x1690,
ILI932X_POW_CTRL2 , 0x0227,
TFTLCD_DELAY , 50,
ILI932X_POW_CTRL3 , 0x001A,
TFTLCD_DELAY , 50,
ILI932X_POW_CTRL4 , 0x1800,
ILI932X_POW_CTRL7 , 0x002A,
TFTLCD_DELAY , 50,
ILI932X_GAMMA_CTRL1 , 0x0000,
ILI932X_GAMMA_CTRL2 , 0x0000,
ILI932X_GAMMA_CTRL3 , 0x0000,
ILI932X_GAMMA_CTRL4 , 0x0206,
ILI932X_GAMMA_CTRL5 , 0x0808,
ILI932X_GAMMA_CTRL6 , 0x0007,
ILI932X_GAMMA_CTRL7 , 0x0201,
ILI932X_GAMMA_CTRL8 , 0x0000,
ILI932X_GAMMA_CTRL9 , 0x0000,
ILI932X_GAMMA_CTRL10 , 0x0000,
ILI932X_GRAM_HOR_AD , 0x0000,
ILI932X_GRAM_VER_AD , 0x0000,
ILI932X_HOR_START_AD , 0x0000,
ILI932X_HOR_END_AD , 0x00EF,
ILI932X_VER_START_AD , 0X0000,
ILI932X_VER_END_AD , 0x013F,
ILI932X_GATE_SCAN_CTRL1 , 0xA700, // Driver Output Control (R60h)
ILI932X_GATE_SCAN_CTRL2 , 0x0003, // Driver Output Control (R61h)
ILI932X_GATE_SCAN_CTRL3 , 0x0000, // Driver Output Control (R62h)
ILI932X_PANEL_IF_CTRL1 , 0X0010, // Panel Interface Control 1 (R90h)
ILI932X_PANEL_IF_CTRL2 , 0X0000,
ILI932X_PANEL_IF_CTRL3 , 0X0003,
ILI932X_PANEL_IF_CTRL4 , 0X1100,
ILI932X_PANEL_IF_CTRL5 , 0X0000,
ILI932X_PANEL_IF_CTRL6 , 0X0000,
ILI932X_DISP_CTRL1 , 0x0133, // Main screen turn on
};
register.h
// Register names from Peter Barrett’s Microtouch code
#define ILI932X_START_OSC 0x00
#define ILI932X_DRIV_OUT_CTRL 0x01
#define ILI932X_DRIV_WAV_CTRL 0x02
#define ILI932X_ENTRY_MOD 0x03
#define ILI932X_RESIZE_CTRL 0x04
#define ILI932X_DISP_CTRL1 0x07
#define ILI932X_DISP_CTRL2 0x08
#define ILI932X_DISP_CTRL3 0x09
#define ILI932X_DISP_CTRL4 0x0A
#define ILI932X_RGB_DISP_IF_CTRL1 0x0C
#define ILI932X_FRM_MARKER_POS 0x0D
#define ILI932X_RGB_DISP_IF_CTRL2 0x0F
#define ILI932X_POW_CTRL1 0x10
#define ILI932X_POW_CTRL2 0x11
#define ILI932X_POW_CTRL3 0x12
#define ILI932X_POW_CTRL4 0x13
#define ILI932X_GRAM_HOR_AD 0x20
#define ILI932X_GRAM_VER_AD 0x21
#define ILI932X_RW_GRAM 0x22
#define ILI932X_POW_CTRL7 0x29
#define ILI932X_FRM_RATE_COL_CTRL 0x2B
#define ILI932X_GAMMA_CTRL1 0x30
#define ILI932X_GAMMA_CTRL2 0x31
#define ILI932X_GAMMA_CTRL3 0x32
#define ILI932X_GAMMA_CTRL4 0x35
#define ILI932X_GAMMA_CTRL5 0x36
#define ILI932X_GAMMA_CTRL6 0x37
#define ILI932X_GAMMA_CTRL7 0x38
#define ILI932X_GAMMA_CTRL8 0x39
#define ILI932X_GAMMA_CTRL9 0x3C
#define ILI932X_GAMMA_CTRL10 0x3D
#define ILI932X_HOR_START_AD 0x50
#define ILI932X_HOR_END_AD 0x51
#define ILI932X_VER_START_AD 0x52
#define ILI932X_VER_END_AD 0x53
#define ILI932X_GATE_SCAN_CTRL1 0x60
#define ILI932X_GATE_SCAN_CTRL2 0x61
#define ILI932X_GATE_SCAN_CTRL3 0x6A
#define ILI932X_PART_IMG1_DISP_POS 0x80
#define ILI932X_PART_IMG1_START_AD 0x81
#define ILI932X_PART_IMG1_END_AD 0x82
#define ILI932X_PART_IMG2_DISP_POS 0x83
#define ILI932X_PART_IMG2_START_AD 0x84
#define ILI932X_PART_IMG2_END_AD 0x85
#define ILI932X_PANEL_IF_CTRL1 0x90
#define ILI932X_PANEL_IF_CTRL2 0x92
#define ILI932X_PANEL_IF_CTRL3 0x93
#define ILI932X_PANEL_IF_CTRL4 0x95
#define ILI932X_PANEL_IF_CTRL5 0x97
#define ILI932X_PANEL_IF_CTRL6 0x98
The ILI9325 datasheet
page 50 registry description
No. Registers Name R/W RS D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
07h Display Control 1 W 1 0 0 PTDE1 PTDE0 0 0 0 BASEE 0 0 GON DTE CL 0 D1 D0
page 57-58 Display Control 1
7.2.7. Display Control 1 (R07h)
R/W RS D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
W 1 0 0 PTDE1 PTDE0 0 0 0 BASEE 0 0 GON DTE CL 0 D1 D0
D[1:0] Set D[1:0]=”11” to turn on the display panel, and D[1:0]=”00” to turn off the display panel.
A graphics display is turned on the panel when writing D1 = “1”, and is turned off when writing
D1 = “0”.
When writing D1 = “0”, the graphics display data is retained in the internal GRAM and the
ILI9325 displays the data when writing D1 = “1”. When D1 = “0”, i.e. while no display is shown on the
panel, all source outputs becomes the GND level to reduce charging/discharging current, which is
generated within the LCD while driving liquid crystal with AC voltage.
When the display is turned off by setting D[1:0] = “01”, the ILI9325 continues internal display
operation. When the display is turned off by setting D[1:0] = “00”, the ILI9325 internal display
operation is halted completely. In combination with the GON, DTE setting, the D[1:0] setting controls
display ON/OFF.
D1 D0 BASEE Source, VCOM Output ILI9325 internal operation
0 0 0 GND Halt
0 1 1 GND Operate
1 0 0 Non-lit display Operate
1 1 0 Non-lit display Operate
1 1 1 Base image display Operate
Note: 1. data write operation from the microcontroller is performed irrespective of the setting of D[1:0] bits.
-
The D[1:0] setting is valid on both 1st and 2nd displays.
-
The non-lit display level from the source output pins is determined by instruction (PTS).
CL When CL = “1”, the 8-color display mode is selected.
CL Colors
0 262,144
1 8
GON and DTE Set the output level of gate driver G1 ~ G320 as follows
GON DTE G1 ~G320 Gate Output
0 0 VGH
0 1 VGH
1 0 VGL
1 1 Normal Display
BASEE
Base image display enable bit. When BASEE = “0”, no base image is displayed. The ILI9325 drives
liquid crystal at non-lit display level or displays only partial images. When BASEE = “1”, the base
image is displayed. The D[1:0] setting has higher priority over the BASEE setting.
PTDE[1:0]
Partial image 2 and Partial image 1 enable bits
PTDE1/0 = 0: turns off partial image. Only base image is displayed.
PTDE1/0 = 1: turns on partial image. Set the base image display enable bit to 0 (BASEE = 0).