Design of intelligent test system based on SST89E58RD2

Publisher:AmybabyLatest update time:2012-11-23 Source: 现代电子技术 Keywords:SST89E58RD2 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction

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.

Keywords:SST89E58RD2 Reference address:Design of intelligent test system based on SST89E58RD2

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

AVR microcontroller learning (VIII) SPI serial port and DS1302
The basic principle of synchronous serial port SPI DS1302 interface timing diagram Use of DS1302 Use of SPI of M16 SPI Basic Principles SPI is the most commonly used synchronous serial interface: synchronization means using the clock line to synchronize the serial data and latch the data at the rising or
[Microcontroller]
AVR microcontroller learning (VIII) SPI serial port and DS1302
SPI serial communication module application (I)
//SPI serial communication module application //★★★★★★★★★SPI★★★★★★★★★★★★\\ //Purpose of the experiment: to be familiar with the SPI bus and the reading and writing of 9346EEPROM //MCU model: PIC16F877A //Function description: when the RBO key is pressed, DATA and DATA2 are written to the unit with EE-ADDR as the ad
[Microcontroller]
MCU SPI communication interface
UART, I2C and SPI are the three most commonly used communication protocols in microcontroller systems. We have already learned the UART and I2C communication protocols. In this class, we will learn the remaining SPI communication protocol. SPI is the abbreviation of Serial Peripheral Interface in English. As the name
[Microcontroller]
MCU SPI communication interface
Implementing SPI data transfer via low-level AVR methods
Host side:  1 /*********************************  2 Code function: Implement SPI data transmission (host side) through the underlying AVR method  3. Creation time: 2016*10*17  4. Use resources:  5 Lower-level aTmega (AVR) library  6 SPI three registers SPCR (control register), SPCR (status register), SPDR (data regi
[Microcontroller]
S3C2440 bare metal -------SPI_Program framework uses GPIO to implement SPI protocol to operate OLED
1.oledfont.h #ifndef __OLEDFONT_H #define __OLEDFONT_H     const unsigned char oled_asc2_8x16 = {     {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},// 0     {0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00},//!1     {0x00,0x10,0x0C,0x06,0x10,0x0C,0x0
[Microcontroller]
stm32 SPI interface
1. Introduction to SPI  SPI is the abbreviation of Serial Peripheral interface. As the name implies, it is a serial peripheral device interface. It was first defined by Motorola on its MC68HCXX series processors. The SPI interface is mainly used in EEPROM, FLASH, real-time clock, AD converter, and between digital sign
[Microcontroller]
stm32 SPI interface
N76E003 drives ST7567 (SPI serial port)
Looking at the DXP schematic (+Bat is 3.3V), LCD_Rst is the hardware reset pin, which can be directly set to high level if not needed. BG_V/BG_G is the backlight terminal, and the microcontroller can use a transistor to control the backlight. Initialization process Contrast adjustment COG.c file code #include
[Microcontroller]
N76E003 drives ST7567 (SPI serial port)
[51 MCU Quick Start Guide] 5: Software SPI
Puzhong 51-Single-core-A2 STC89C52 Keil uVision V5.29.0.0 PK51 Prof. Developers Kit Version:9.60.0.0 Host computer: Vofa+ 1.3.10        Derived from software simulation SPI interface program code (4 modes) - inland saltwater fish, with changes. Hard Knowledge Introduction to SPI Protocol        The communication p
[Microcontroller]
[51 MCU Quick Start Guide] 5: Software SPI
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号