Color STN module VP2188 and 51 single chip microcomputer interface

Publisher:BlossomBeautyLatest update time:2011-05-22 Keywords:VP2188 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:VP2188 Reference address:Color STN module VP2188 and 51 single chip microcomputer interface

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

51 MCU Overview and Design of Minimum System
What is a microcontroller? Before learning, you must understand what this thing is, how to use it, and why it can be used in this way. If you understand these three questions, then you can learn the 51 single-chip microcomputer very well. Comparison of microcontrollers Here we only compare 8051 and 8052: Model Fla
[Microcontroller]
51 MCU Overview and Design of Minimum System
MCS-51 microcontroller and CPLD/FPGA interface logic design
Functionally, microcontrollers and large-scale CPLDs are highly complementary. Microcontrollers have the advantages of high cost performance, flexible functions, easy human-machine dialogue, and good data processing capabilities; CPLD/FPGA has the advantages of high speed, high reliability, convenient development, and
[Microcontroller]
AT89C51 MCU drives 128x64 LCD display in C language
 /*******************************************************************  AT89C51 MCU drives 128x64 LCD display in C language **************************************************************/ #include AT89x51.h #define uchar unsigned char /********************************************* Circuit connection P1------DB0~
[Microcontroller]
51 MCU (XV) - Introduction to the Timer Module
     The STC89C516 microcontroller has three 16-bit programmable timers/counters, namely timers T0, T1 and T2. They have both timing and counting functions. By setting the relevant special function registers, you can choose to start the timing function or the counting function. It should be noted that this timer syste
[Microcontroller]
C51 MCU timer simulates single-channel output PWM
Preface This blog post is developed based on STC89C52RC and Keil5 C51 environment; If there are any deficiencies, please give me more advice; Things Needed Timer 0; Pin P1.0; code show as below: #include STC89C5xRC.H #define ENABLE 1 #define DISENABLE 0 typedef unsigned char uchar8; sbit P1_0 = P1^0; bit Flag
[Microcontroller]
8051 MCU (STC89C52) - Changing the buzzer sound frequency
Since the interrupt handler of timer 0 is triggered once every 50ms, the frequency of the buzzer sound can be changed by changing the critical value when tcount returns to zero.  When tcount = 40 and the level is flipped, the sound produced is similar to the effect sound when the bus turn signal is turned on. When
[Microcontroller]
51 single chip microcomputer realizes the operation of running water lamp
1. Use shift operation Use left shift instruction and negation operation to realize the pipeline lamp from the first diode to the last diode #include reg52.h // 200 millisecond interval water light void delayms(unsigned int xms)//function with parameters { unsigned int i,j; //Local variables, allocated when needed
[Microcontroller]
51 single chip microcomputer realizes the operation of running water lamp
The realization method of simulating serial communication by I/O port of 89C51 single chip microcomputer
The commonly used MCS51 and P IC series microcontrollers usually have only one (or no) UART asynchronous serial communication interface. If multiple serial interfaces are required in the application system (for example, in a multi-machine communication system, the host needs to communicate wi
[Microcontroller]
The realization method of simulating serial communication by I/O port of 89C51 single chip microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号