With the rapid development of science and technology, the progress of human demand for civilized life has brought about an increasing demand for electric energy , and also brought about higher requirements for power system equipment. Therefore, the functions and detection equipment of power system distribution transformers have received close attention from all parties. Various power detection equipment are constantly being refurbished in the market, and their functions are also developing in the direction of practicality and high technology. However, there are few reports on distribution transformers with human-machine friendly interface functions and detection equipment with touch mode. For this reason, after many aspects of research, we propose the task of developing distribution transformer intelligent detection equipment using touch mode and GPRS wireless communication function. On the premise of meeting the requirements of power distribution function, the equipment adopts touch display mode to improve the operability of the detection equipment, and uses GPRS wireless communication to improve the advancement of the equipment and meet the management needs of the modern information society, so that it has certain unique advantages and can occupy a certain market field.
1 System Design
The core of the system is the advanced INTEL96 series 16-bit single-chip microcomputer 80196, equipped with LCD display touch screen, large-scale gate array logic integrated circuit xilinx95144, and external GPRS module through serial port driver circuit MAX232, etc. It has a simple structure, complete functions, strong expandability, reasonable layout, few chips, small size, and high reliability and confidentiality. The schematic diagram is shown in Figure 1.
Figure 1 System Schematic Diagram
1.1 Main functions of each functional module
(1) CPU80196 is mainly responsible for the control center and the arithmetic and logical operations of 16-bit data in the system. This single-chip microcomputer has rich software and hardware resources and a fast-running instruction system, which is very suitable for the instrument design of the power system.
(2) The large-scale logic circuit chip Xilinx95144 mainly completes: address latching, data bus drive, control signal bus drive and logic level conversion, chip select signal generation, etc. It has 144 macro units, 3200 logic gates, 100 pins, 81 data input and output pins, 4 online programming pins, and can complete 10,000 times of online programming.
(3) MAX232 serial port driver: Completes the serial port level TTL to RS232 conversion function.
(4) GPRS module: It is a new type of mobile data communication service, which provides a connection between mobile users and data networks , and provides high-speed wireless IP services to mobile users. It adopts completely transparent data transmission, is always online, and charges according to traffic. It overcomes the shortcomings of short communication distance and unstable performance, and truly achieves seamless coverage across the country, especially suitable for unattended areas.
(5) 27512EPROM program memory, providing 64KByte of program storage space, mainly for storing system programs.
(6) 62256 static RAM data storage, providing 64KB data storage space, mainly for storing collected data, with built-in battery to ensure that data is not lost in the event of power failure.
(7) The DS1302 calendar chip can automatically calculate the year, month, day, hour, minute, and second according to the settings, and can also realize an alarm clock. It mainly enables the system to collect data at regular intervals.
(8) CAN is a bus-type serial communication network with strong error correction capability and support for differential transmission and reception, which makes it suitable for high-noise environments and has a relatively long transmission distance. In the system, we use the SJA1000 chip. Through correct connection and setting, all functions of the CAN bus physical layer and data link layer can be automatically completed.
(9) Switch drive circuit: It mainly provides voltage and current to various switching power supplies and AC and DC motor speed control systems. In the system, we use a combination of digital circuits and analog circuits.
(10) LCD display and touch screen: To provide a friendly human-computer interaction interface, we chose the DG-32240-27-SNCW-HCDTC LCD display touch screen produced by Taiwan AM PIRE Company, which has 320 × 240 display pixels and a touch size of 160 × 110 mm. The display part control chip is SED1335, and the touch part control chip is ADS7843.
1.2 System Debugging
During the debugging of the system, all functions and electrical indicators met the pre-design requirements, but there were several problems such as the instructions between the touch screen and the microcontroller were not executed, and even the chip ADS7843 in the touch screen was burned out.
2 Hardware Design Analysis
According to the hardware connection, the P3 and P4 ports of the microcontroller are connected to the LCD display through Xilinx95144, and the touch screen is directly connected to the P1 port of the microcontroller. The operating voltage of the three is the typical value of 5V recommended by the manufacturer.
2.1 80196KB MCU Structure
80196KB is one of the 16-bit single-chip microcomputer MCS_96 series products launched by INTEL after the 8-bit single-chip microcomputer. Compared with the 8-bit single-chip microcomputer, it improves the real-time performance of the control system. Compared with the current 32-bit single-chip microcomputer, it is a real single-chip microcomputer, especially suitable for various automatic control systems. Its internal structure adopts the Princeton architecture, also known as the Von Neumann structure. It has the characteristics of combining program memory and data memory into one. Its P0 port can only be used for input, P1 port is a quasi-bidirectional port, P2 port is a multi-function port, and P3 and P4 ports are bidirectional ports that can be used as system buses.
In the circuit of this system, the P1 port is used to interface with the touch screen. The internal pin structure of the P1 port is shown in Figure 2. The P1 port is a quasi-bidirectional I/O port, which consists of an output buffer, an internal port latch, an internal port register and an output buffer. It is the same as the quasi-bidirectional port of MCS51 and has an internal pull-up resistor structure. As shown in Figure 2, the pull-up effect is generated by three FET tubes, among which p1 is a strong pull-up, p3 is a weak pull-up due to the high resistance, p2 is an even weaker pull-up, and n is a low-resistance pull-down FET.
Figure 2 Internal structure of quasi-bidirectional port P1
When reset, the P1 port is weakly pulled up. When used as input and output functions, the principle is: "Input": When the P1 port inputs data, it is actually input into the P1 port register, and the register drives the pin. In Figure 2, /Q is the output of the register. When the CPU reads data, it reads the pin directly. Therefore, when reading data, it is necessary to ensure that the P1 port is in the input state. The P1 port register SFR should be set first, and n is cut off at this time. Remember that when the port is used as an input port, never write data "0" to the port. "Output": In this state, when the instruction inputs "0" to the I/O port register of port P1.x, the /Q output of the internal register will turn on the pull-down FET, i.e. n, and turn off all the pull-up FETs, i.e. p1, p2, and p3. At this time, the corresponding output pin level PORT PIN is "0"; when the instruction inputs "1" to a certain I/O port register of port P1, the /Q output of the internal register will turn off n and turn on p1, p2, and p3. At this time, the corresponding output pin level PORT PIN is "1", that is, the output is a process of direct "writing" by programming.
2. 2 X ilinx95144
It is a high-quality Complex Programmable Logic Device ( CPLD ), with a typical operating voltage of 3.3-5V, supporting ISP, i.e. online programming, and can be programmed up to tens of thousands of times. The pin-to-pin signal delay is 7.5ns, and the operating frequency can reach 111MHz. There are 144 macro units inside, all of which are ROM structures. The internal logic data will not be lost after power failure. Each I/O pin is in the output state: the typical value is -4mA when the high level is high, and the typical value is 24mA when the low level is low; each I/O pin is in the input state: both the high and low levels are in the uA level. Therefore, the output electrical characteristics: In the usual TTL level chip circuit, when there are not many external drivers, the pull-up resistor can be used; Input electrical characteristics:
General integrated chips can be directly connected to it without the problem of insufficient driving force or damage.
2. 3 Touch Display
The control chip of the display part is SED1335, which is a special controller for LCD screen produced by EPSON Company of Japan . It has the strongest function compared with similar products. Its main features are: I/O buffer with strong functions; rich instruction functions; 4-bit data parallel transmission; mixed display of graphics and text. The control chip of the touch part is analog data converter ADS7843, which is an 8-bit, 12-bit data output and four-wire resistive touch screen analog-to-digital conversion interface chip produced by Ti Company of the United States with synchronous serial interface. It communicates with CPU through standard SPI protocol; high precision, when using 12 bits, the precision reaches 0. 04mm, and can reach 1/256, 1/4096 precision in X and Y directions; maximum acceptable current? 50mA, typical value is several uA; working voltage is -0.3-+6V; working clock typical value is 2MH z, which is on the order of uS; when the touch screen is pressed (i.e. a touch event occurs), ADS7843 will issue an interrupt request.
After several problems occurred, we found that the display part was normal, but the touch part was not normal, that is, there was a problem with the use of ADS7843. Its internal structure schematic is shown in Figure 3. From the figure, we can see that it mainly consists of four-channel signal converter, successive approximation register (SAR), capacitive data/converter (C DAC ), comparator, serial interface and controller functional modules. Among them, the programming-related signals are DCLK, /CS, DIN, DOUT, BUSY, /PENIRQ, and the data flow is shown in Figure 4.
Figure 3 AD7843 internal principle structure
Figure 4 ADS7843 interface diagram
For ADS7843, in addition to the power supply and ground wire, the input analog signals are X+, X-, Y+, Y-, IN3, IN4, the input digital signals are DCLK, /CS, DIN; the output digital signals are BUSY, DOUT, /PEN IRQ. All the programming-related signals are digital signals. The data input, output, and clock input are all serial. The maximum conversion rate is 1/125KH z. The circuit design structure is relatively convenient. Only 6 port lines are needed for the microcontroller to establish complete data interaction.
2.4 Phenomenon Analysis
It is completely possible to use the 6 ports of the P1 port of 80196 to deal with it from the hardware point of view. However, in programming, some ports of the P1 port are used as inputs and some ports need to be used as outputs. The 80196 does not have instructions for direct bit operations. To perform output operations on a certain port of P1, 196 usually reads the 8 pins of the P1 port first, and then performs the "write!" operation. According to the structure of the P1 port, if the pin used as the input port is low, the input state of the pin will be changed to the output state after executing the "write!" instruction. At this time, the two lines of DOUT and /PEN IRQ of 80196 and ADS7843 will have two output signals on the same line, competing for signals, which is absolutely not allowed in digital circuits. Its appearance may damage the chip.
According to the information, in programming operations, when some pins in the P1 port are used as inputs and some pins are used as outputs, special attention should be paid to the write instruction operation of the P1 port. It is a read and write process, and it is best to use some units.
3 Software Design Analysis
For key processing, the system adopts interrupt method, and the process is shown in Figure 5.
Figure 5 Key flow chart
The main relevant procedures are as follows:
/* Touch screen write control instructions, read data subroutine* /
LDB R6, # 08H; write 8-bit control instruction code
CLRC; LDB AL, COM; Command code ready to send
ADS7843_W: SHLB AL, #1; Data serial transmission
JC S_DI_1; JMP S_DI_0
S_DI_1: LDB BL, IOPORT1; save the status of port P1 in the BL register
ORB BL, # 03H; Set the data output DOUT high, and the data input DIN is the signal input state
LDB IOPORT1, BL ; Send the modified status to port P1
JMP SKCLK
S_DI_0: LDB BL, IOPORT1; save the P1 port status in the BL register
ANDB BL, # 0FEH; Set data output DOUT low
ORB BL, # 02H; Data into D IN is signal input status
LDB IOPORT1, BL; Send the modified status to port P1
SKCLK: LDB BL, IOPORT1; Save the P1 port status in the BL register
ANDB BL, # 0F7H; Clock signal DCLK is low
ORB BL, # 01H; Set data output DOUT high
LDB IOPORT1, BL ; Send the modified status to port P1
LDB BL, IOPORT1; Save the P1 port status in the BL register
ORB BL, # 09H; Clock signal DCLK is high, set data output DOUT high
LDB IOPORT1, BL ; Send the modified status to port P1
DJNZ R6, ADS7843_W; 8-bit instruction sent
LDB BL, IOPORT1; Save the P1 port status in the BL register
ANDB BL, # 0F7H; Clock signal DCLK is low
ORB BL, # 01H; Set data output DOUT high
LDB IOPORT1, BL ; Send the modified status to port P1
/* Prepare to receive 14-bit data from the touch screen key, first receive the lower 8-bit data* /
LDB R6, # 08H; Key value setting direction read lower 8-bit data program
DATA_OUT: LDB BL, IOPORT1; Save the P1 port status in the BL register
ORB BL, # 09H; Clock signal DCLK is high, set data output DOUT high
LDB IOPORT1, BL ; Send the modified status to port P1
LDB BL, IOPORT1; Save the P1 port status in the BL register
ANDB BL, # 0F7H; Clock signal DCLK is low
ORB BL, # 01H; Set data output DOUT high
LDB IOPORT1, BL ; Send the modified status to port P1
SHLB AL, # 1; data shift left one bit
JBS IOPORT1, 0, DI_O_1; judge whether data input to DIN is high?
ANDB AL, # 0FEH; data into DIN low, input 0
JMP DATA_OUT1
DI_O_1: ORB AL, # 01H; data into DIN high, input 1
DATA_OUT1: DJNZ R6, DATA_OUT; 8-bit data read
STB AL, FIRST; The lower 8 bits of data are saved to the FIRST unit and the upper 4 bits of data are also processed.
…… …… ; After reading 4 bits of data, the data is saved. After reading 14 bits of data, the program returns
After debugging the program on the machine, there is no problem of failure to execute instructions between the touch screen and the single-chip computer, and burning the touch chip. You may find that in the program programming, we use the BL register as the transition protection unit of the P1 port, and use the bitwise OR and AND method to output the output signal to achieve the output "1" and "0" levels. Ensure that the input port of P1 will not change its state due to the operation of other P1 ports, and there will be two outputs on the signal line, competing for the signal. This is the main reason for the problem of the touch screen.
4 Conclusion
During the project appraisal, the experts gave the conclusion that the system has a novel design, reasonable structure, relatively complete functions, strong scalability, and a certain market space. They especially mentioned that each touch key is reasonably designed and reflects the correct conclusion.
At the end of this project, there was still a legacy issue about the buttons: because it was working in single-ended mode, and after the CPU received the request, in order to eliminate jitter and prevent false triggering, it responded to the request after a delay, resulting in slow button response. This is a problem that needs to be improved in both hardware and software. The hardware needs to be replaced with an analog data conversion chip, and the delay in the software can be shorter.
Previous article:Design of VGA Display System Based on Embedded CPU S3C2440
Next article:Design and implementation of low-cost photoelectric tracking intelligent vehicle
Recommended ReadingLatest update time:2024-11-16 15:23
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- 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
- About CC2640 power consumption test problem
- stm32 and AD7732 help
- Playing with Zynq Serial 14 - Using GIT for Project Backup and Version Management 6
- Selection of solid state relays
- Access to register of unclocked peripheral at 0x40010C00 cause BUS_FAULT What...
- FAQ_How to quickly confirm the power consumption in different modes of S2-LP
- Showing goods + one board to share love, count how many points you have
- Tips and precautions for using directional couplers
- Understanding AM and FM waves, and demodulating AM waves with diode detection
- EEWORLD University ---- Live playback: How to develop AI camera applications faster, simpler and at a lower cost