Design of intelligent test system based on an 80C51 microcontroller

Publisher:SerendipityJoyLatest update time:2024-03-14 Source: elecfansKeywords:80C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

With the popularity of electronic and electrical products in social life, many domestic small and medium-sized enterprises have 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 on their experience. In the production of products, the factory inspection of products is not perfect, resulting in a high product repair rate. From the actual situation, a large part of the faults that cause repairs can be discovered during the factory inspection. However, because most domestic small and medium-sized enterprises currently rely on manual testing with the help of some instruments and meters, the testing efficiency is low, the testing area is not wide, and there are errors and false detections.


The introduction of intelligent testing systems can well 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 explain the design principles nationwide.


2 Introduction to SST89E58RD2 features

SST87E58RD2 is an 80C51 microcontroller that contains 32KB+8KB FLASH and 256+768B data RAM. A typical feature of the SST89E58RD2 is its ×2 mode option. With this feature, designers can enable applications to run at the traditional 80C51 clock frequency (12 clocks per machine cycle) or in ×2 mode (6 clocks per machine cycle). clock).

FLASH program memory supports traditional parallel programming and also supports serial in-system programming (ISP). ISP allows reprogramming of finished devices under software control, and the SST89E58RD2 can also use In-Application Programming (IAP), allowing the two FLASH program memories to be reconfigured at any time, even while the application is running.

SST89E58CD2 features are as follows:

80C51 core processing unit;

5V working voltage, operating frequency 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 via 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 priority levels;

2 DPTR registers;

Low EMI mode (ALE disabled);

Compatible with TTL and CMOS logic levels;

Power failure detection;

Low power consumption mode (power-down mode, external interrupt wake-up, idle mode).


3 Principle of intelligent testing system

This intelligent test system uses SST89E58RD2 as the core. Its functional block diagram is shown in Figure 1, including:

The SPI port line is mainly used to download programs and communicate with the motherboard under test;

The I2C bus reads data from the external E2PROM in the motherboard under test;

RS232 circuit is used for communication with the host computer;

The external FLASH mainly stores the program target code of the motherboard under test, and AT29C010A is selected;

Indicator circuit, each fault point is indicated by an indicator light, there are 32 in total, and 4 pieces of 74HC595 are used as the output drive circuit;

2 step buttons are used for step control during the test process, and their control lines are directly connected to the P1.1 and P1.2 port lines of SST89E58RD2;

The LED display is used to test the step display and is controlled by a piece of 74HC595;

The DI input circuit uses a 74HC165 logic chip, which is connected to the input and serial output;

The DO output circuit uses 74HC595 logic chip, serial input and parallel output;

Since the microcontroller has many peripheral interface chips, GAL16V8D is used as the control decoding circuit.

Design of intelligent test system based on an 80C51 microcontroller

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 described 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 is used for communication with the intelligent test system and program downloading.

The mahjong machine motherboard uses AT89S52, which has a system programming (ISP) function through the SPI port.

For these hardware functions of the mahjong machine motherboard, the intelligent test 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 signal 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 with an N555, and the indicator light displays whether the result is normal. If the power supply test fails, subsequent test steps will not be performed and a buzzer will prompt.

(2) SPI connection test and test program download of the motherboard under test

Read the characteristic code of the CPU of the motherboard under test through the SPI port serial download command, and identify it as the AT89S52 chip (the single-chip microcomputer model selected for the mahjong machine motherboard), which means that the motherboard under test is connected. Because for the SST89E58 microcontroller, its SPI port is a complete SPI port, but the SPI port of the AT89E52 microcontroller 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 system is tested The test program will be downloaded to the motherboard under test. The code of the test program will be placed in the FLASH address of SST89E58RD2 at 0X7000-0X7FF. After the download is completed, the tester of the motherboard will be able to cooperate with the intelligent test system for detection.

(3) DI function test of the motherboard under test

Divide the 16-point DI of the motherboard under test into two groups, one group of 8 points, and connect them to the DO port line of the test system. After the DO signal output by the test system is sampled by the motherboard under test, the sampled data is read back through SPI port communication and compared. The similarities and differences between the output signal and the sampling signal are used to determine whether there is a channel abnormality. If there is an abnormality, it will be displayed through the fault indicator light.

(4) DO function test of the motherboard under test

Divide the 12 DOs of the motherboard under test into 2 groups, a group of 8 points and a group of 4 points, and connect them to the DI port of the test system. Through the SPI port communication command, the motherboard under test can output a specific status, and the test system samples through DI. , compare the similarities and differences between the sampling data and the output characteristic data, and determine whether there is a channel abnormality. If there is an abnormality, it will be displayed through the fault indicator light.

(5) Power-off data storage test of the motherboard under test

Because the motherboard under test also has a 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, and the CPU will store some characteristic data in the external E2PROM within a limited period of time. (AT24C64). 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 five 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 you find that there is still a fault, press the back button to test again to confirm the fault.

5 Key program codes of intelligent test system

Test step handler:

6 Conclusion

The intelligent testing system implemented in this design has been applied to an automatic mahjong machine manufacturer and has achieved good application results. In the past, the factory's products were shipped out of the factory using manual inspection mode. It took 20 minutes to complete the inspection, 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 inspection of the product. , and the detection range covers most functions. If a product fails to pass the test, the source of the fault can be quickly and accurately found according to the prompts of the intelligent detection system, greatly improving production efficiency.

This intelligent test system also allows for further development:

(1) At present, many electronic products need to undergo live aging tests before leaving the factory, but they are only charged and no-load. If an intelligent test system is introduced into the aging test to simulate the workload of the product so that the product can work at full load during the aging test, then Products that can pass this aging test will demonstrate more stable and reliable performance in practical 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 issue for many manufacturers. If an intelligent test system is introduced into the factory The management of product serial numbers and version numbers will also be very effective. By using the host computer expansion 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. Then the factory serial number is calculated 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 testing system sends the serial number and version number to the host computer, and the special software in the computer transfers the serial number and version number. Store it in the database and mark the serial number on the product.

[1] [2]
Keywords:80C51 Reference address:Design of intelligent test system based on an 80C51 microcontroller

Previous article:High-precision, high-stability, high-resolution radio frequency sine wave signal generator based on DDS device design
Next article:The structure and working principle of the timing counter of 80C51 microcontroller

Recommended ReadingLatest update time:2024-11-16 09:46

Introduction to the pins and functions of 80C51 microcontroller
First, let’s connect the pin diagram of the microcontroller. If so, the specific functions are introduced below. The 40 pins of the microcontroller can be roughly divided into 4 categories: power, clock, control and I/O pins. ⒈ Power supply: ⑴ VCC - chip power supply, connected to +5V; ⑵ VSS - ground terminal; ⒉ Clo
[Microcontroller]
Introduction to the pins and functions of 80C51 microcontroller
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号