PCB detection system realized by single chip microcomputer

Publisher:tnzph488Latest update time:2012-03-28 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

When doing PCB reverse design, you need to first detect the circuit board to find out the connection relationship between all component pins; then use the corresponding software to analyze and process the detection results, and finally restore the PCB schematic.

Since there are many device pins on large-scale PCBs, manual detection is not only inefficient but also prone to errors.

In order to improve the efficiency and accuracy of PCB detection, this paper proposes a design and implementation scheme of a PCB detection system based on the EZ-USB 2100 series microcontroller. The system has a detection head, which is connected to the device pins of the circuit board. Under the control of the microcontroller, the system automatically detects the connection relationship between the pins; then, the system selects the next group of pins for detection based on the detection selection algorithm, and repeats this cycle until all device pins are detected. Using the EZ-USB 2100 series microcontroller for development not only makes it easy to realize high-speed communication between the detection device and the host, but also brings great convenience to the functional expansion of the detection device. The following will first analyze the characteristics and technical advantages of the EZ-USB 2100 series microcontroller, and then give the design and implementation scheme of the PCB detection system based on this type of microcontroller.

2 Features of EZ-USB 2100 Series MCU

The EZ-USB 2100 series microcontrollers are developed by Cypress. They integrate a USB controller that complies with the USB 1.1 specification and an enhanced 8051 core. The enhanced 8051 core runs at 24MHz, and a bus cycle contains 4 clock cycles, while the standard 8051 contains 12 clock cycles. In addition to the enhanced 8051 core, the EZ-USB 2100 series microcontrollers have two major advantages over traditional 8051 microcontrollers: 1) high-speed data transmission with the host through the USB bus; 2) firmware reconfiguration function. These two technologies provide great convenience and flexibility for application development. The following will specifically analyze how to use these two technologies in the actual development process.

2.1 Communication between EZ-USB 2100 series MCU and host

The USB controller integrated in the EZ-USB 2100 series microcontroller complies with the USB 1.1 specification and supports 12Mbps high-speed data transmission. The application on the host communicates with the EZ-USB microcontroller through the EZ-USB device driver. Cypress provides a universal device driver that users can directly use to communicate with the EZ-USB microcontroller.

First, the host needs to load the universal device driver. When using a USB device for the first time, you may need to manually install its driver; after that, Windows will save the relevant information in the registry and automatically locate the device driver.

After loading the generic device driver, the application first obtains a handle to access the device driver by calling the Win32 API function CreateFile():

HANDLE DeviceHandle;

DeviceHandle = CreateFile (“\\.\ezusb-0”, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );

Then, the application sets up the I/O buffer for the device handle returned by the CreateFile() function and completes the device read and write operations by calling the Win32 API function DeviceIoControl():

PVOID pvBuffer = NULL;

DWORD nBytes = 0;

PvBuffer = malloc (sizeof (Usb_Device_Descriptor ));

BResult = DeviceIoControl (DeviceHandle, //Opened device handle

IOCTL_EZUSB_GET_DEVICE_DESCRIPTOR, //IO control code

NULL, 0, pvBuffer, sizeof (Usb_Device_Descriptor),

&nBytes, NULL);

The operation of EZ-USB peripherals is achieved by passing the corresponding control code to the DeviceIoControl function. For example, to complete the bulk read and bulk write operations of data, you can pass the IOCTL_EZUSB_BULK_READ and IOCTL_EZUSB_BULK_WRITE control codes to the function respectively.

2.2 Firmware Reconfiguration Function of EZ-USB 2100 Series MCU

After the hardware circuit design of a single-chip microcomputer system is completed, the characteristics and functions of the single-chip microcomputer system can also be changed by changing the software program (i.e., firmware) of the single-chip microcomputer. Using ROM to store firmware cannot be changed; using EPROM to store firmware will be limited by the number of erase and write times and cost. The external RAM integrated in the EZ-USB series single-chip microcomputer can be used to load firmware. When the device is connected to the host, the firmware is loaded from the host to the RAM for execution. Devices loaded with different firmware will show different characteristics, thereby achieving the purpose of soft configuration.

3 Application of EZ-USB 2100 Series Microcontrollers in PCB Detection System Development

3.1 Hardware Circuit Design

PCB detection system hardware circuit

The hardware circuit structure of the system is shown in Figure 1. k detector heads are connected to an analog switch composed of multiple analog switches.

3.2 System Function Expansion

As described in Section 2.2 of this article, the reconfiguration function of EZ-USB can be used to modify the firmware program to enable the system to obtain new functions. In the process of developing the PCB detection system, we found that it was necessary to measure the values ​​of two-pin devices such as resistors, capacitors, and inductors on the circuit board. Due to the large number of such devices on large-scale circuit boards, it is a very tedious task to measure them manually using a multimeter or logic analyzer. The reconfiguration function of EZ-USB can solve this problem. Using the same hardware circuit as Section 3.1, the author also designed a set of firmware programs for type identification and value determination of resistors, capacitors, and inductors on circuit boards.

4 Conclusion

The detection system greatly improves the efficiency of PCB reverse design. The results of practical application show that the detection system has good detection completeness and accuracy.

Keywords:MCU Reference address:PCB detection system realized by single chip microcomputer

Previous article:Single chip microcomputer realizes multi-gas detection system
Next article:C51 MCU interrupt number and interrupt vector

Recommended ReadingLatest update time:2024-11-17 01:34

Design of remote data collection system using 89C51 microcontroller and MAX485
In various industries in the process of industrial production and scientific and technological research, various data are often collected. Nowadays, the commonly used collection method is to install data acquisition cards in PCs or industrial computers, such as A/D cards, 422 cards, and 485 cards. Cards and capture ca
[Microcontroller]
Design of remote data collection system using 89C51 microcontroller and MAX485
Design of Simple Calculator Based on Single Chip Microcomputer
Components used: STC51 single-chip microcomputer chip 51 MCU core board LCD1602 Matrix keyboard 11.0592MHz crystal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  Effect: - - - - - - - - - - - - - - - - - - - - - - - - - - -
[Microcontroller]
Design of Simple Calculator Based on Single Chip Microcomputer
Design of fingerprint access control based on microcontroller
Function: Research content: This topic uses the microcontroller as the core and uses C language to develop a fingerprint electronic code lock. The system is planned to design the schematic diagram on the Altium Designer9 development platform, draw the PCB and make a microcontroller development board, and then weld the
[Microcontroller]
How to realize serial communication between PC and AT89C51 microcontroller
In the data acquisition and real-time control system based on single-chip microcomputer, the command and data transmission between the computer and the single-chip microcomputer is carried out through the RS-232 interface in the computer, and the computer can be used to monitor and control the production site. Since th
[Microcontroller]
Realizing high-speed data acquisition based on DMA block transfer in single-chip system
The DMA function of direct data transmission between peripherals and internal memory in PC has been widely used due to its high efficiency, high speed, and low CPU resource usage. This function is realized by a dedicated DMA controller chip installed on the motherboard or integrated in a peripheral control chip
[Microcontroller]
Realizing high-speed data acquisition based on DMA block transfer in single-chip system
Design of brushless DC motor control system based on MC9S12D64 microcontroller
Since brushless DC motors have the advantages of simple structure, reliable operation, and convenient maintenance of AC motors, as well as advantages that other types of DC motors cannot match, such as simple structure, small size, light weight, high efficiency, large starting torque, small inertia, and fast respons
[Microcontroller]
Design of brushless DC motor control system based on MC9S12D64 microcontroller
Automotive MCU is a long-term process from 1 to N
The automotive industry is undergoing tremendous changes and showing a high growth momentum. In this change, there are two underlying logics behind it. The first is the global demand from 1 to N; the second is that platformization is the guarantee of cost-effectiveness. He Fang, head of the automotive product depart
[Automotive Electronics]
Automotive MCU is a long-term process from 1 to N
Intelligent temperature control fan design based on 51 microcontroller
Specific implementation functions: It is composed of 51 microcontroller + DS18B20 temperature sensor + common positive four-digit digital tube + fan + independent button + DC power supply . Specific functions: 1. Use DS18B20 temperature sensor to measure temperature and use digital tube to display it in real time;
[Microcontroller]
Intelligent temperature control fan design based on 51 microcontroller
Latest Analog Electronics Articles
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号