VP2188 is a color STN LCD module produced by Jingdian Pengyuan. This module is a dot matrix transmissive color STN display screen with a color scale of 65 k colors and white LED backlight. Its core controller is PCF8837 in Philips COG package. PCF8837 is a single-chip color STN control driver with a storage capacity of 176*132*16=45 kB, 3 color display modes (RGB 565 or 444 or 332), and a drive capacity of 176 rows and 396 columns (132*RGB) output.
The PCF8837 features an internal integrated drive power supply function module and an OPT function module, an internal DC-DC boost, conversion, voltage, and frame frequency temperature compensation circuit, can manage the work of the drive power supply through software, and has flexible serial and parallel port connection methods, matrix memory management and the resulting convenient image management function, regional scrolling mode, in addition, there are software-programmable local display and color scale modes, and through the combination of PWM16 pulse width modulation and phase mixing, FRC4 multi-polar grayscale control, N-line inversion and overclocking inversion to reduce cross-color, etc.
1 Main features of PCF8837
The PCF8837 driving voltage and bias generating circuit includes a voltage multiplier, bias generating circuit 1, bias generating circuit 2, and a line voltage doubling circuit, which generate 7 voltage values, namely, V1, V2, V3, Vc, MV1, MV2, and MV3. The bias generating circuit 1 generates the voltage V2 by programming VPR through the SETVOP instruction. The formula is:
V2=a+b × VOP, (a=3.79, b=0.015, VOP=VT+VPR+(VCON-63)+ MVOP)
Where VT is an additional temperature compensation parameter, which is set by the sensor output and TCVOPAB and TCVOPCD instructions; VPR is the main reference, which is set by SETVOP instruction, with a range of 14~214 dec; VCON is the contrast parameter, which is set by SETCON, with a range of 7-bit binary number -63H~63H. MMVOP is the preset offset in OTP.
Bias voltage generating circuit 2 generates voltages V1, Vc, MV1, and the voltage doubling instruction SETBS generates voltages V3, MV3, and MV2 by programming the VB module in the VBIASGEN module, which is supplied by the power supply voltage Vss and has the same voltage as Vss.
In addition, PCF8837 can also set temperature compensation in segments and set the best contrast to eliminate interference from surrounding light. These functions are set through the one-time programmable (OTP) calibration function.
The PCF8837 display memory is a matrix addressing structure, and one unit is 16 bits, representing the three-color data RGB of one display pixel. Matrix memory management provides a simple method for partial image display and image rotation display.
The addressing of PCF8837 is determined by the row and column address pointers X and Y. Each set of pointers is equipped with two sets of programmable address registers: starting point address registers XS and YS, and ending point address register pointers XE and YE. The instruction PTLAR can set the starting address and ending address of the effective display area, and the instruction PTLON can turn on the local display mode. The instruction PTLMCTL controls the N-line inversion function and row selection pulse of the local mode to provide the effect of local display. The instruction MADCTL is used to set MY, MX, V, LAO, and RGB to realize the image rotation function. The relationship between the values of MY, MX, V, LAO, and RGB and the image display is shown in Table 1.
Table 1 Parameters to be set for image rotation
Parameter 01
MX image normal horizontal mirroring upside down
MY vertical mirroring reverse image normal
V horizontal addressing mode writes memory vertical addressing mode writes memory
The RGB display data sequence is R, G, B. The display data sequence is B, G, R.
Figure 1 shows the data transmission and display process when the memory realizes image rotation. X is the display data row and Y is the display data column. According to this flow chart, to realize the counterclockwise rotation of the image by 90°, it is only necessary to set the starting row and column and the ending row and column to be displayed, invert the values of MX, V and RGB, and then start the partial display. Other display effects can also be achieved by setting the corresponding bits of the MADCTL instruction. The definition of the scroll mode column and the top and bottom of the scroll column are set by the instruction VSCRDEF, and the SEP instruction sets the scroll mode starting row and starts the scroll mode. PCF8837 also provides a leisure mode switch. When the display is not needed, the leisure mode can be turned on. At this time, only MSN data is retained, and the frequency is reduced, so that the power consumption of the driver is reduced.
Figure 1 Program flow chart [page]
2 Hardware interface circuit
VP2188 has a total of 27 output pins, including control and data signal lines DB0-DB15, read signal RD (active at low level), write signal WR (active at low level), data and control signal selection RS (active at low level for control signal, active at high level for data signal), chip select signal CS (active at low level), reset signal RESETB (active at low level), power supply VDD, LCD driver power supply PS1, PS2, backlight positive LED, negative LED-, ground GND.
The interface mode is 3-wire 9-bit serial port or 8-bit/16-bit parallel port, which can meet the 80 series interface timing. When using the 51 series MCU 8-bit interface, the upper 8 bits of PCF8837 can be left floating.
The schematic diagram of the 8-bit parallel port interface with the 51 series single-chip microcomputer is shown in Figure 2: the single-chip microcomputer P0 is connected to the lower 8 bits of VP2188 data, and the upper 8 bits do not need to be left floating. Bits 0 to 4 of P2 port are used for read and write, data program selection, chip selection and reset signals respectively.
Figure 2 Hardware connection diagram
3 PCF8837 instruction system and software programming
PCF8837 supports two different instruction systems, which are selected by setting instruction 0 or 1 through the ISS pin. Here we only introduce instruction system 0. Instruction 1 is just different from instruction 1 in code, but its function is the same. The data transfer format is shown in Table 2.
PCF has 3 different data formats supporting different color scales:
(1) 64*210 colors (16 bits) RGB 5-6-5 bit input. The 16 bits of data from the interface are directly stored in RAM.
(2) 4*210 colors (12 bits) RGB 4-4-4 bit input. The data comes from the 12 bits of the interface, mapped to 16 bits according to the LUT diagram and stored in RAM.
(3) 256-color (8-bit) RGB 3-3-2-bit input. The data comes from the 8-bit interface, mapped to 12-bit according to the programmable LUT map (RGBSET instruction), and then mapped to 16-bit according to the LUT map and stored in RAM.
Table 2 Data transmission format
If the data is transmitted in 16-bit interface mode, then the 16-bit color scale information of one pixel in data format (1) can be transmitted to the display RAM in only one step. R4, G5, G4, and B4 transmitted in data format (2) are discarded, and the high 8 bits are discarded in data format (3). In the 8-bit interface mode, the 16-bit color scale information of one pixel needs to be transmitted to the data latch in two steps and then transferred to the display RAM. If only one byte is transmitted, the transmitted byte is not sent to the RAM. Using data format (2), the color scale information of two pixels can also be transmitted in three steps.
The parameters to be set in the OTP programming of PCF8837 include display identification information, segment temperature compensation parameters, drive voltage and bias generation circuit parameters, segment frame rate setting parameters, N-line inversion interval, row and column charging time, RGB phase mixing offset, oscillator adjustment, etc. The quantities that need to be set in the initialization program include local standard display mode, internal oscillator, display contrast, voltage bias value, interface mode, memory control, etc.
When the 8-bit interface mode is used to connect with the 51 single-chip microcomputer as shown above, the main programming is as follows (due to limited space, the settings of some control instructions are omitted here, and users can add settings according to actual needs):
//DEMO source program
//Write instruction function
void Write_com2188(unsigned char c1)
{RS=0;
CS2188=0;
LCD+RD=1;
WE=0;
P0=c1;
_nop_();
_nop_();
WE=1:
_nop_();
CS2188=1;
)
//Write 8-bit data function
void Write_data2188(unsigned char c1)
{RS=1;
CS2188=0;
LCD_RD=1;
WE=0;
P0=c1;
_nop_();
_nop_();
WE=1;
_nop_();
CS2188=1;
}
// Initialization routine
void Init_lcd2188(unsigned char contrast)
{Write_com2188(0x01); //Software reset
DelayX10ms(10); //delay 0.1s
Write_com2188(0x11); //End of sleep
Write_com2188(0x03); //Double pressure on
Write_com2188(0x29); //Display on
Write_com2188(0xc0); //Select internal oscillator
Write_com2188(0x13); //Standard mode on
Write_com2188(0x20); //Reverse off
Write_com2188(0x3a); //Pixel interface
Write_data2188(0x02); //8 bits
Write_com2188(0xb); //Set vop
Write_data2188(0x13); //vop value
Write_com2188(0x25); //Set the contrast
Write_data2188(contrast); //contrast value
Write_com2188(0xc7); //Set bias ratio
Write_com2188(0x01); //Bias ratio value
Write_com2188(0x36);//MADCTL
Write_data2188(0x00);//Forward
Write_com2188(Oxl1); //End of sleep
Write_com2188(0x29); //Open display
)
//Rotation function implementation
void Circum_lcd2188()
{Write_com2188(0x30); //Set the RAM address of the local display area
Write_data2188(0xxx); //Start of local display area RAM
Write_data2188(0xxx); //End of local display area RAM
Write_com2188(0x36); //Set MADCTL command
Write_com2188(0x11); //End of sleep
Write_com2188(0x29); //Open the display
Write_com2188(0x12); //Partial mode on
4 Conclusion
The VP2188 color STN LCD module introduced in this article is a product with advanced technology, powerful functions and convenient use in the field of color small and medium screen LCD display. It has been widely used in portable products, game consoles and industrial fields due to its strong module driving ability, clear display effect and low price. The program written in this article was successfully compiled in Keil uVision3 compiler. After adding the graphics and font codes to be displayed, it can be transplanted to the circuit board to correctly display the required graphics and texts. The image rotation function and local display can work correctly.
Previous article:51 MCU external ROM expansion method
Next article:51 single chip microcomputer DS18B20 temperature measurement experiment
Recommended ReadingLatest update time:2024-11-16 19:50
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Fundamentals and Applications of Single Chip Microcomputers (Edited by Zhang Liguang and Chen Zhongxiao)
- Single chip microcomputer control technology (Li Shuping, Wang Yan, Zhu Yu, Zhang Xiaoyun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Inverting proportional operational amplifier circuit
- Upper computer displays waveform acquisition
- Evaluation Weekly Report 20211129: There are 4 days left for Anxinke NB-IoT and domestic FPGA applications, and the wireless charging mouse pad is waiting to be disassembled (Extra)
- Are there any pmos and nmos tubes with working current |Ids|=1.2A;|Vds|<0.2V, which don't matter if they are enhanced or not, and have low leakage current when turned off?
- EEWORLD University Hall----TI 77GHz millimeter wave radar product introduction and solution display
- KiCad 5.1.5 latest stable version Chinese tutorial
- Understand C language pointers in 1 minute
- TMS320F28377S LaunchPad XDS100 V2 driver cannot be installed
- Question about the delay circuit composed of transistors and capacitors
- Building a Raspberry Pi Pico development environment under Windows