The aging controller based on AVR MCU and dot matrix LCD (hereinafter referred to as “the system”) introduced in this paper mainly uses Atmega 64 MCU to program and control, and dot matrix LCD to display various states in the aging process. It has the functions of aging timing setting, date and time setting, aging frequency setting, thermostatic element working mode selection and so on. Modern electronic enterprises are demanding higher and higher quality of electronic products, which requires not only higher performance indicators, but also better reliability.
The reliability of electronic products depends on the rationality of design, the performance of selected components and the manufacturing process of the whole machine. With the continuous development of electronic technology, the integration degree of electronic products is getting higher and higher, not only the function is becoming stronger and stronger, but also the manufacturing process is becoming more and more complex, which will produce potential defects in the production process. This defect is manifested in the early failure of electronic products, that is, the failure rate is higher in a period of time just put into use. At present, power aging technology is widely used at home and abroad to complete the early failure of electronic products in enterprises, thus improving the reliability of qualified products. Power aging is a process of 48-72 hours of continuous power-on for electronic products in an aging room with ambient temperature of 40-60?C. Through long-term aging, defects in electronic product design, quality problems of components and hidden dangers caused by assembly and welding can be exposed ahead of time, so as to select the defective products with these shortcomings and ensure that the products can stand the test of time. The aging controller introduced in this paper is an automatic aging device developed for the early failure of electronic products according to the reliability requirements of electronic enterprises for electronic products. It uses 128 *64 dot matrix LCD module as the working interface. It can set the starting and ending time of aging and observe the aging state.
It has the functions of data storage, timing, alarm and interrupt memory.
The hardware system includes five parts: key circuit, MCU control system, LCD, output control and alarm system. Its core device is AVR MCU. The system uses Atmel’s Atega64 single-chip computer. Its input part consists of six keys, which can be used to start and stop aging, set aging time, change aging status and other functions. Its output control consists of three parts: one is to drive dot matrix liquid crystal display, which can reflect the working state in the aging process at any time; the other is to control the output of relays, that is, to control the power supply and power cut of products; the third is to drive the alarm system, that is, when a batch of products are aged, the alarm will be automatically issued to inform the relevant personnel that they can proceed to the next batch. Aging of products. The specific block diagram is shown in Figure 1. Atmega64 single chip microprocessor is an 8-bit low power microprocessor with high performance AVR enhanced RISC (reduced instruction system computer) structure. Since 130 instructions can basically be completed in one clock cycle, the data throughput can reach 1 MIPS/MHz, which can alleviate the contradiction between the processing speed and power consumption of the system. Atmega64 has only one kind of SMT encapsulation, and its core has a rich instruction set and 32 general purpose working registers. Atmega64 MCU has the following characteristics: 64K-byte programmable Flash (RWW), 2K-byte EEPROM, 4K-byte SRAM, 53 general programmable I/O ports, 32 general working registers, real-time counter RTC, 4 flexible timers/meters with comparative mode and PWM function. Counter (T/C), 2 USART, byte-oriented two-wire serial interface TWI, 8-way 10-bit ADC, Programmable Watchdog Timer with on-chip oscillator, 1 SPI serial port, JTAG interface compatible with IEEE 1149.1 specification, and six power-saving modes that can be selected by software. Atmega64 provides flexible and low-cost solutions for many embedded control applications. The system involves a large amount of data, and its corresponding memory space requirements are also increased accordingly. Atmega64 has built-in 64 KB storage space and 4 KB data storage space. Selecting Atmega64 MCU can make the peripheral circuit more concise and improve the operation efficiency of the controller. In order to reduce the occupancy of I/O ports, the system needs 6 keys. The keys are arranged in matrix form, as shown in Figures 2 and 3. The PB port of Atmeg64 MCU is used as the keyboard I/O port. The keyboard line is connected to PB4 (PB 7), PB5 (PG 3), PB 6 (PG 4), and the keyboard line is connected to PB2 (PB4) and PB3 (PB5) of the PB port.
PB 4 (PB 7), PB 5 (PG 3), PB 6 (PG 4) are set as input and pull-up, and row PB2 (PB4) and PB 3 (PB5) are set as output. Two row lines and three column lines form six intersecting points. It is necessary to detect whether the current key is pressed, as long as one of the output lines is low level, read the status of the corresponding port of the line. If it is all “1”, there is no key closure; if it is not all “1”, there is key closure. When the key press is detected, the next step of detection is made after the delay. If there is a key closure, the key closure can be identified by scanning the keyboard lines. The display of this system is 128 *64 dot matrix liquid crystal of Hengfang Company. It can display dot matrix graphics. It mainly consists of row and column drivers and 128 *64 full dot matrix liquid crystal display. It can display 4*8 Chinese characters and various graphics with strong flexibility. Its structure block diagram is shown in Figure 4. The instruction register IR used to register instruction codes corresponds to the data register DR. When D/I is 1, the instruction code is written to IR. The data register DR used to register data corresponds to the instruction register IR. When D/I is 1, data is written to DR when E signal is falling edge; when E signal is high level 1, data bus is read from DR to B7-DB0. Data transmission between DR and DDRAM is performed automatically within the module. Busy flag BF provides internal working conditions. When BF is 1, the module operates internally and does not accept external instructions and data.
When BF is 0, the module can accept external instructions and data at any time. The display control flip-flop DFF, which is used to control the opening and closing of the display screen, is 1. To open the display, the contents of DDRAM will be displayed on the screen. DFF is 0 for DISPLAY OFF. The state of DFF is controlled by instruction DISPLAY ON/OFF and RST signal.
As the address pointer of DDRAM, the 9-bit address counter XY has X-address counter in the top three and Y-address counter in the bottom six. The X address counter is DDRAM’s page pointer, which has no counting function and can only be set by instructions. The Y address counter is DDRAM’s Y address pointer, which has circular counting function.
After each display data is written, the Y address counter automatically adds 1.
Display Data Memory RAM (DDRAM) is used to store graphic display data. Its data is 1 for display selection and 0 for display not selected. The address counter Z for displaying line scan synchronization is a 6-bit counter with the function of cyclic counting. When one line scan is completed, the Z address counter automatically adds 1 and points to the next line scan data. When RST is reset, the Z address counter is 0. ICCAVR is a compiler that uses C language conforming to ANSI standard to write 32-bit program of microcontroller. Its main features are: using the working environment of editor and project manager, it can work under WINDOWS9X/NT/XP and other operating systems; state window can display compilation errors, and when you click compilation errors with the mouse, the cursor will automatically jump to the line that caused errors in the editing window; output COFF/HEX format files, HEX format files. Most programmers can be supported to download programs; COFF files are mainly used for simulation, which is convenient for checking logic errors. AVR Studio is an embedded development environment. It can write and debug AVR applications under Windows 9x/Me/NT/2000/XP operating system. AVR Studio provides engineering management tools, source file editor, chip simulator and on-line simulation debugging interface for AVR MCU. In addition, AVR Studio also supports STK500 development board, which can program all AVR devices. It also supports JTAG on-chip simulation debugger. AVR Studio 4 has a modular structure that allows third-party software investors to collaborate in development. The working interface of AVR Studio is composed of Engineering management, editor output bar, workspace, working window, I/O window, information window, viewing window and memory window. In this system, AVR Studio is mainly used as a simulation compiler to check the logic errors in the process of simulation, such as entering an unknown dead cycle, or skipping a program segment that needs to be executed, etc. The execution state of the program is controlled by the debugging toolbar. The shortcut keys, menus and debugging toolbar can realize all debugging control. If the target file contains valid source-level information, all debugging operations will continue until the first user source statement is reached. To stop running the program, you must switch to disassembly mode before issuing the stop command. The debug control bar consists of Start Debugging, Stop Debugging, Reset (SHIFT F5), Run (F5), Break (CTRL-F5), Single Step, Trace Into (F11), Run to Cursor (F7), Show next statement and other commands.
。 PCtoLCD2002 has two interface modes: character mode and graphics mode. The working interface of graphics mode is shown in Figure 5. It can output a variety of forms of code (such as code in assembly environment, code in C language environment, etc.). The size of graphics and fonts can be freely adjusted according to needs. In graphics mode, the designed display image is directly imported into PCtoLCD2002, and then the output form of the code is set to generate and save the submodule, so that the generated code can be directly copied into the program. This system uses Atmega 64 single-chip computer. With the help of progisp.exe program download software, the programmed program is burned into the chip. The program of this system is divided into three parts: main program, display subroutine and key scan subroutine. The block diagram of main program is shown in Figure 6 (other outlines). They are all written in ICCAVR. During the process of compiling, they are constantly modified, compiled, and then generated COFF simulation files. Import the generated simulation files into the AVR Studio simulator. Open AVR Studio software first, will jump out of the new project window, cancel, click on the open file, find the file where COFF is located, open the COFF file, will jump out of the select device and debug platform launch window, select AVR simulator in debug platform, in Device. Select Atmega64 and click finish. I/O View in the working window can observe the state changes of registers, I/O ports, timing counters and so on. On the right side of the main window is the corresponding program code.
In debugging, each statement can be corresponded with the corresponding registers to run the statement one by one, and the logic errors in the statement can be seen more intuitively. After the file is imported into the simulator, click start debugging and the simulator starts running. In the first simulation, step over should be used to start running the program sentence by sentence until there are no logical errors. After successful debugging of the software, the program code can be directly burned into the chip of the single chip computer for debugging of the whole machine.
First turn on the controller and display the welcome screen in the first three seconds. After three seconds, it enters the working screen and displays the data of working status, aging time, counting times, time and date, and waits for the operation of the operator. Under the menu interface, the aging parameters are changed (working mode selection, aging signal frequency setting, aging time setting, date, time setting, etc.). Then turn on the power supply of the aging rack, turn on the corresponding power indicator, turn on the signal switch, and start to enter.