With the popularization of electronic and electrical products in social life, many small and medium-sized enterprises in China have also begun to develop and produce such products on their own to meet market demand. However, due to the limitations of human and material resources of small and medium-sized enterprises, they often focus their main efforts on product production, while the factory inspection of products is not perfect, resulting in a high rate of product repairs. From a practical point of view, a large part of the faults that cause repairs can be discovered during factory inspection. However, since most of the small and medium-sized enterprises in China currently rely on manual inspection with the help of some instruments and meters, the inspection efficiency is low, the test surface is not wide, and there are situations such as wrong inspection and misdetection.
The introduction of intelligent testing systems can effectively resolve such contradictions and help companies improve the efficiency of product testing. The following will take the intelligent testing system of a mahjong machine motherboard as an example to fully explain the design principles.
2 SST89E58RD2 Features
The SST87E58RD2 is an 80C51 microcontroller that includes 32KB+8KB FLASH and 256+768B of data RAM. The typical feature of the SST89E58RD2 is its ×2 mode option, which allows designers to run applications at the traditional 80C51 clock frequency (each machine cycle contains 12 clocks) or ×2 mode (each machine cycle contains 6 clocks).
The FLASH program memory supports traditional parallel programming and also supports serial in-system programming (ISP). ISP allows the device in the finished product to be repeatedly programmed under software control. The SST89E58RD2 can also use in-application programming (IAP), allowing the two FLASH program memories to be reconfigured at any time, even when the application is running.
The features of the SST89E58CD2 are as follows:
80C51 core processing unit;
5V operating voltage, operating frequency is 0-40MHz;
64KB on-chip FLASH program memory with ISP (In-System Programming) and IAP (In-Application Programming) functions;
Supports 12-clock (default) or 6-clock mode through software or ISP selection;
SPI (Serial Peripheral Interface) and Enhanced UART;
PCA (Programmable Counter Array) with PWM and capture/compare functions;
4 8-bit I/O ports (P0-P3), 1 4-bit I/O port (P4);
3 16-bit timers/counters;
Programmable watchdog timer (WDT);
10 interrupt sources, 4 interrupt priorities;
2 DPTR registers;
Low EMI mode (ALE disabled);
Compatible with TTL and CMOS logic levels;
Power failure detection;
Low power consumption modes (power-down mode, external interrupt wake-up, idle mode).
3 Principle of Intelligent Testing System
This intelligent test system is based on SST89E58RD2, and its principle block diagram is shown in Figure 1, including:
The SPI port line is mainly used for program downloading and communication with the motherboard under test;
The I2C bus reads data from the external E2PROM in the motherboard under test;
RS232 circuit is used to communicate with the host computer;[page]
The external FLASH mainly stores the program target code of the motherboard under test, and AT29C010A is selected;
Indicator light circuit, each fault point is indicated by an indicator light, a total of 32, using 4 74HC595 as the output drive circuit;
Two step buttons are used for step control during the test, and their control lines are directly connected to the P1.1 and P1.2 ports of SST89E58RD2;
LED display is used to test the step display, controlled by a 74HC595;
The DI input circuit uses 74HC165 logic chip, parallel input and serial output;
The DO output circuit uses 74HC595 logic chip, serial input and parallel output;
Since there are many peripheral interface chips in the single-chip microcomputer, GAL16V8D is used as the control decoding circuit.
4 Intelligent test system functions
The test object of the intelligent test system in this article is the main board of the automatic mahjong machine. The design of the system is explained below.
The main test items of automatic mahjong machines include:
Mainboard power supply: 3 internal block power supplies; 12 9V AC DO signals, 16 DI signals; 4 power signals; 1 main power supply and 3 branch power supplies, 1 buzzer, 1 E2PROM with I2C; 1 SPI port for communication with the intelligent test system and program download.
The main board of the mahjong machine is AT89S52, which has the function of system programming (ISP) through the SPI port.
Aiming at these hardware functions of the mahjong machine motherboard, the intelligent testing system has the following functional interfaces:
24 DO outputs are used to detect the DI signal of the motherboard under test;
16 AC/DC DI inputs are used to detect the DO signals of the motherboard under test;
An SPI bus interface is used for program download and communication of the motherboard under test;
An I2C interface is used to read and write the I2C E2PROM of the motherboard under test.
The test steps are as follows:
(1) Power supply test of the motherboard under test
The nominal value of the power supply is 5V, and the judgment condition is whether it is between 4.75-5.25V. It can be judged by a SHMILT comparator built by an N555, and the indicator light shows whether the result is normal. If the power supply test fails, the subsequent test steps will not be performed, and the buzzer will prompt.
(2) SPI connection test and test program download of the motherboard under test
The characteristic code of the CPU of the tested motherboard is read through the SPI serial download command. After identification, it is determined to be the AT89S52 chip (the single-chip model selected by the main board of the mahjong machine), which means that the tested motherboard has been connected. Because for the SST89E58 single-chip microcomputer, its SPI port is a complete SPI port, but the SPI port of the AT89E52 single-chip microcomputer is used for the ISP function of FLASH. When the characteristic code is read correctly, it indicates that the SPI port connection is normal. At this time, the test system will download the test program to the tested motherboard. The code of the test program is placed in the space of 0X7000-0X7FF of the FLASH address of SST89E58RD2. After the download is completed, the tested motherboard can cooperate with the intelligent test system for detection. [page]
(3) DI function test of the motherboard under test
The 16-point DI of the motherboard under test is divided into two groups, one group of 8 points, and connected to the DO port line of the test system. The DO signal output by the test system is sampled by the motherboard under test, and then the sampled data is read back through the SPI port communication. The output signal and the sampled signal are compared to determine whether there is a channel abnormality. If there is an abnormality, it is displayed through the fault indicator.
(4) DO function test of the motherboard under test
The 12 DO of the motherboard under test is divided into two groups, one group of 8 points and one group of 4 points, and connected to the DI port of the test system. Through the SPI port communication command, the motherboard under test is allowed to output a specific state. The test system samples through DI, compares the sampled data and the output characteristic data, and determines whether there is a channel abnormality. If there is an abnormality, it is displayed through the fault indicator.
(5) Power-off data storage test of the motherboard under test
Because the motherboard under test has another very important power-off data storage function, this function allows the power detection circuit inside the motherboard under test to detect the loss of power. Once the CPU stores some characteristic data in the external E2PROM (AT24C64) within a limited time. For this function, the test system will directly read the data inside the E2PROM through the I2C bus to determine whether the power-off data storage is valid, and indicate it through the indicator light.
(6) Check the fault indicator light and complete the test
. After completing the above 5 steps, if there is no indicator light showing a fault, you can press the download button to download the program of the mahjong machine motherboard to the AT89S52 to complete the entire test. If a fault is found, press the back button to test again to confirm the fault.
5 Key program code of the intelligent test system
|
---|
Test step handler:
|
---|
6 Conclusion
The intelligent test system implemented in this design has been applied to a manufacturer of automatic mahjong machines and has achieved good application results. In the past, the factory's product inspections were all done manually, which took 20 minutes to complete, and the scope of the inspection was limited to the most important indicators. After the introduction of this intelligent inspection system, it only takes 2 minutes to complete the product inspection, and the scope of the inspection covers most of the functions. If a product fails the inspection, the source of the fault can be found quickly and accurately according to the prompts of the intelligent inspection system, which greatly improves production efficiency.
The intelligent test system can also be further developed:
(1) At present, many electronic products need to undergo aging tests with power on before leaving the factory, but they are only energized and unloaded. If the intelligent test system is introduced into the aging test to simulate the product's workload, so that the product works at full load during the aging test, the products that can pass the aging test will show more stable and reliable performance in actual applications.
(2) Electronic products need to be marked with serial numbers and product version numbers before leaving the factory. How to effectively control the entity of the product with the serial number and version number has always been a thorny problem for many manufacturers. If the intelligent test system is introduced into the serial number and version number management of the factory products, it will be very effective. By using the host computer extension function of the intelligent test system and connecting to the computer through RS232, the intelligent test system has obtained the version number of the product before downloading the program to the test product, and then calculates the factory serial number based on a series of attributes such as the date of the day and the factory order. When the product passes the test, the intelligent test system sends the serial number and version number to the host computer, and the special software in the computer stores the serial number and version number in the database and marks the serial number on the product. At present,
the intelligent test system implemented by this design is undergoing the second phase of development, and it is planned to introduce the intelligent test system into the aging test and factory serial number management. After successful development, it will greatly improve the performance of the system and increase the scope of application of the system.
Previous article:Research and development of battery management module based on OZ890
Next article:Design of 10M/100M Ethernet Switch Based on AT89818
Recommended ReadingLatest update time:2024-11-16 15:54
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Digilent Vivado library
- Teach you to learn 51 single chip microcomputer-C language version (Second Edition) (Song Xuefeng)
- Raspberry Pi Development in Action (2nd Edition) ([UK] Simon Monk)
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
- Effect of Temperature on Performance and Life of Communication Switching Power Supplies
- 10 ways 5G will change our daily lives, the last one is thought-provoking
- Get a more intuitive understanding of 5G. Watch the keynote speech by Rohde & Schwarz and win prizes!
- msp432 record 2-uart and display usage
- [AB32VG1 Development Board Review] RTC Electronic Clock
- Live broadcast at 10 am today [In-depth study of TI's industrial processor chip AM57X with machine learning accelerator]
- Protecting Your IP Cores - Part 1 Soft IP, Section 1: Encryption of HDL Code
- EEWorld 2020 annual summary: useful articles, popular reviews, download top list, and well-received courses, all here!
- Hey guys, this is my first time using Cadence's Pspice simulation and I encountered this problem
- Industrial Control Electronics Popular Data Download Collection