1 Introduction to the SED1335 controller
The AT-320240Q1 LCD display is an LCD display with a built-in SED1335 controller produced by Taipei Crystal Technology Co., Ltd. It consists of a 320×240 dot matrix and has the advantages of high resolution (dot pattern is 0.225mm×0.225mm), convenient interface (5V or 3.3V), simple design (embedded controller), low power consumption, and cheap price. , often used in various portable device display front-ends and daily home appliance display modules. The display screen based on 320×240 dot matrix has a variety of extended functions for users to choose from, which greatly facilitates users and improves the integration and practicality of the system.
The SED1335 controller is an LCD display controller produced by the Japanese EPSON company. Compared with similar products, it has the most powerful functions. Its main features include:
an I/O buffer with strong functions;
rich command functions;
four-bit data sent in parallel;
and mixed display of graphics and text.
The instruction set of the SED1335 controller is shown in Table 1. The SED1335 controller has 13 instructions, most of which have parameters. The parameter values can be set by the user according to the characteristics of the controlled LCD module and the display needs.
Table 1 SED1335 controller instruction list
The SED1335 controller is a control chip used between the MPU system and the LCD module. It receives instructions and data from the MPU system and generates corresponding timing and data control module displays. A0 is the selection input of the LCD control register, which gates the command input buffer and the data input buffer respectively, similar to the RS or D/I of the usual character dot matrix LCD module. The MPU writes the instruction code into the instruction input buffer (i.e. A0=1), and the parameter data of the instruction is subsequently written through the data input buffer (A0=0). One of the functions of the instruction code with parameters is to strobe the corresponding parameter register. The execution of any instruction (except SLEEPIN, CSRDIR, CSRR and MREAD) occurs after the input of the auxiliary parameters is completed. The MPU can also write new parameters and effectively combine them with the remaining old parameters to form a new parameter group. It should be noted that when actually using the instruction, if the instruction has multiple parameters, each parameter must be written in order and cannot be omitted at will. Especially when the MPU operates SED1335 and the LCD module it controls, the SYSTEN SET (40H) command must be written first. If there is an error in the setting of this command, the display must be abnormal.
Here we focus on the CPSDIR instruction. The function of this instruction is to specify the direction in which the cursor address pointer automatically moves. The cursor address pointer controlled by SED1335 actually also displays the current address pointer of RAM. After the controller completes the read and write operations, the cursor address pointer will be automatically modified. This command has four parameters: 4C/4D/4E/4FH, which respectively represent the four directions of modification, so it has a strong drawing function, which many LCD controllers do not have. In the design of the AT-320240Q1 LCD display, the order of display is from right to left, that is, an 8×1 dot matrix on the display screen corresponds from left to right to the high bit to the low bit of 1 bit data in the memory unit. Therefore, for conventional fonts, the display will be reversed. This problem can be solved by controlling the movement direction of the cursor address pointer.
2 Design of hardware interface between DSP and LCD display
Since this LCD display is embedded with SED1335 controller and directly leads out the interface circuit, the overall design is greatly simplified for users, and only the differences between the DSP and the interface circuit need to be considered. Just connect.
The following is a design scheme for the interface between DSP and the LCD display hardware, as shown in Figure 1.
In the design process of this system, TI's TMS320C5402 chip was selected. Since its internal ROM cannot be written, a 32K 27256 EEPROM is plugged in as an external program area to store programs and external fonts. Considering that the TMS320C5402 chip has an external expansion space of up to 1Mbit, users can change the size of the ROM as needed during actual applications. For the data interface of the LCD display, because both the DSP and the LCD display are powered by 3.3V, the data lines of the two can be directly connected, so that the DSP can directly send the data in the ROM or RAM to the controller's cache for display. . The control signal of the LCD screen is decoded by the 16th and 9th bits of the DSP address line. Therefore, in the design of the program, the instruction port address is 8100H and the data port address is 8000H. Since the read and write pins of the DSP are multiplexed, when the pin is high, the read signal of the LCD screen is strobed with a low level through the NOT gate; when the read pin is low, the read signal of the LCD screen is strobed directly. Write pin.
3 Software design for DSP control of LCD display.
Here, the software design of DSP for controlling LCD display is explained in detail through the initialization process of LCD display and how to display a picture. The picture to be displayed is shown in Figure 2. You can create such a 320×240 black and white bitmap through the drawing tool that comes with WINDOWS. In view of the fact that this display screen displays from right to left, it needs to be flipped vertically symmetrically, and finally the processed image is burned into the external 27256 in the form of a hexadecimal file. The starting address of the picture data file in the DSP external space is: 0C000H.
It can be seen from the flow chart (Figure 3) that after the system hardware is powered on and reset, the software automatically sets various controller command codes and parameters according to the user's needs, thereby completing the parameters of the liquid crystal module (such as the behavior of the liquid crystal). number, column number, scanning frequency, cursor position, etc.) and a series of initialization processes such as display mode. After the system is correctly initialized, the data in the external ROM can be sent directly to the SED1335 display buffer through the DSP, and the controller can control the LCD screen to display the picture required by the user. At the same time, users can also change the form of picture display during the running of the main program according to their own needs. They only need to select the corresponding instruction code and parameters in Table 1.
The method of setting the system command and its parameters is as follows: According to the design of the user's hardware circuit, first send the command code to the command port address of the SED1335 controller; then send the parameters of the command to the data port address in turn, and after the system command and its parameters After setting, the data can be sent to the data port address. The specific syntax is as follows:
Instruction setting statement:
STM #XXH, AR0; XXH is the instruction code
PORTW AR0, #8100H; 8100H is the command port address
parameter setting statement:
STM #XXH, AR0; XXH is the instruction parameter
PORTW AR0, #8000H; 8000H is the data port address
...
Data input statement:
STM #XXH, AR0; XXH is user data
PORTW AR0, #8000H; 8000H is the data port address
...
The initialization procedure of the LCD display is as follows:
INIT:
STM # 40H, AR0; System setting command, command code: 40H
PORTW WR0, #8100H
STM #10H, AR0; Standard setting
PORTW AR0, #8000H
STM #87H, AR0; Set cursor width to 8
PORTW AR0, #8000H
STM #07H, AR0; Set the cursor height to 8
PORTW AR0, #8000H
STM #27H, AR0; Set the number of bytes required for each line of the LCD,
PORTW AR0, #8000H 320 points per line, the number of lines is 320/8=40
STM #36H , AR0; Set the scanning frequency of the LCD to about 70Hz
PORTW AR0, #8000H
STM #0F0H, AR0; Set the number of dot lines of the LCD to 240
PORTW AR0, #8000H
STM #28H, AR0; Set the display buffer occupied by one line of the display Number of bytes
PORTW AR0, #8000H
STM #00H, AR0
PORTW AR0, #8000H
STM #44H, AR0; SCROLL instruction, instruction code: 44H
PORTW AR0, #8100H
STM #00H, AR0; Determine the first address of the first display area
PORTW AR0, #8000H
STM #00H, AR0
PORTW AR0, #8000H
STM #240D, AR0; Set the number of rows in the first display area
PORTW AR0, #8000H
STM #00H, AR0; Determine the first address of the second display area
PORTW AR0 , #8000H
STM #40H, AR0
PORTW AR0, #8000H
STM #0F0H, AR0; Set the number of lines in the second display area
PORTW AR0, #8000H
STM #00H, AR0; Determine the first address of the third display area
PORTW AR0, # 8000H
STM #80H, AR0
PORTW AR0, #8000H
STM #4CH, AR0; Set the cursor to automatically move from left to right
PORTW AR0, #8100H
STM #5BH, AR0; Set the display screen to two-layer overlay display
PORTW AR0, #8100H
STM #0DH, AR0
PORTW AR0, #8000H
…………
STM #42H, AR0; LCD display buffer instruction
PORTW AR0, #8100H
LD #240D, A; Clear screen program
LOOP1: LD #40D, B
LOOP2: STM #00H, AR0
PORTW AR0, #8000H
SUB #1H, B
BC LOOP2, BNEQ
SUB #1H, A
BC LOOP1, ANEQ
RET;
The main program to display the picture after initialization is as follows:
AMIN: STM #800H, SP
CALL INIT; Call the LCD screen initialization program
STM #0C03EH, AR1; Bitmap data relative to the address of the BMP file header
STM #42H, AR0
PORTW AR0, #8100H; Send the LCD screen buffering instruction
LD # 240, A
CMP: LD #40, B
CMP1: PORTW AR1+, #8000H; write the 320×240 bitmap data to the buffer area
SUB #1, B
BC CMP1, BNEQ
SUB #1, A
BC CMP, ANEQ
B in sequence $; End of main program.
The above is the software design of the system. Due to limited space, the settings of some control instructions are omitted here, and users can add settings according to actual needs. In actual software design, the data loss caused by the delay during the execution of DSP assembly language can be solved by appropriately adding a null instruction (NOP). At the same time, the example of using picture display in this program is only used to illustrate the use of the controller, which seems a bit wasteful and has poor flexibility. For those systems with limited storage space and high efficiency requirements, font templates can be made and stored in external ROM for multiple calls.
The basic DSP-controlled LCD screen proposed in this article has been successfully used in practical applications as an oscilloscope display front-end. The SED1335 controller with a 64K large-capacity buffer area is selected in this system, which is suitable for display screens with various dot matrix specifications. In addition, its internal solidified character generator can produce 160 kinds of fonts, and it can be realized by changing the command parameters. The characteristics of image flickering, flipping, moving, etc., make it much stronger than other controllers of the same type in terms of overall performance, and is very suitable for the design of display front-ends for various portable systems.
Previous article:Interface design between ADSP2181 and LCD module SMC1602B
Next article:Design of intelligent lighting controller based on LPC2104
Recommended ReadingLatest update time:2024-11-17 05:39
- Popular Resources
- Popular amplifiers
- Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Viewpoint Comparison, and Real-time Performance
- Machine Learning and Embedded Computing in Advanced Driver Assistance Systems (ADAS)
- Intelligent program synthesis framework and key scientific problems for embedded software
- arm_embedded_machine_learning_design_dummies_guide
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- Regarding the number of bits of the microcontroller, the number of bits of the ADC, and the number of bits of the PWM, ADC and PWM are both indicators that reflect the resolution...
- Please teach me an op amp circuit - RMS to DC circuit
- 【Silicon Labs Development Kit Review】+ PWM Example Test
- Porter-3: Will this topology work?
- Problem with the abs function
- Xunwei i.MX6ULL development board-Transplant OpenCv2.4.9-QT program compilation
- [Me and Arteli] DIY an AT32 board, full of favorability
- MSP430 watchdog usage notes && how to use the watchdog monitoring program to run away in low power mode
- EEWORLD University ---- Automotive/Industrial Millimeter Wave Radar Sensors
- When designing an isolation system using a linear optocoupler, the isolation strength is required to reach 1800 volts. What should be considered during the design?