This paper describes the functions and implementation structure of Cypress's configurable system on chip (PSoC); combined with the development example of color selection controller, the method and process of using PSoC development are described in detail. Its design method can also be used in various applications such as other control systems or industrial automation. Keywords: PSoC (Configurable System on Chip) Color Selection Controller MCU Introduction In recent years, with the rapid development of electronic technology and semiconductor technology, system on chip (SoC), especially configurable system on chip PSoC (Programmable System on Chip), has gradually become the mainstream product of microcontrollers. Therefore, design engineers must quickly grasp the development characteristics and requirements of SoC and integrate into the development trend of SoC as soon as possible. However, SoC system design brings challenges that are completely different from traditional system design, including the selection of processors and memories and the consideration of product environment. If design engineers can deeply understand the development characteristics of SoC and consider how components interact with each other and the impact of various factors, they can directly improve the success rate and development efficiency of product design, reduce the complexity and cost of system development, and enhance the reliability and anti-interference ability of the system. Based on my own development experience and the development process of the color selection controller, this article provides guidance for design engineers and helps them prepare better for future design projects from all levels. People have found in the design process of various microcontrollers and embedded control systems that different designs do not necessarily require completely different peripheral devices; on the contrary, they have a lot of common parts, which has inspired chip design engineers to build such configurable microcontrollers. Some common digital and analog blocks are built in the chip and configured into various functional modules of the microcontroller. In this way, during the ASIC design process, application engineers can call different functional modules according to their different design requirements, complete the functional configuration inside the chip, and use one chip to configure a microcontroller with a variety of different peripheral devices. At present, Cypress MicroSystems, Inc and Cygnal Integrated Products, Inc produce configurable SOC microcontrollers on the market. This control system uses the M8C core PsoC microcontroller produced by Cypress MicroSystems, Inc as the control core.
Let's first get familiar with the development task requirements. The color selection controller is a control system composed of information acquisition, keyboard, display and output drive. It is mainly used to replace the paper tape input photoelectric weft color selector on imported and domestic rapier looms. In order to facilitate users to modify the working mode and other parameters according to different actual needs, all parameters and configurations can be input, checked and modified through several operation keys on the panel; and in the case of sudden parallel operation, the breakpoint parameter information can be automatically restored after restarting. According to the technical indicators proposed by the user, we must also quantify it and further complete the functional design plan. 1 Hardware solution design 1.1 Select the microprocessor After the design task is determined, the hardware required for the control system should be initially estimated and selected. The microprocessor is the core of the entire control system, and its selection will have a decisive impact on the entire control system. Generally, the following aspects should be considered to determine whether the microprocessor meets the requirements of the control system: word length, type and number of instructions, type and number of internal registers, speed of the microprocessor, interrupt processing capability, and peripheral circuit matching of the microprocessor. The source of peripheral devices and the operation of software are also factors that designers must consider, because they involve the real-time control capability of the entire system and the separation of hardware and application programs. PSoC produced by Cypress MicroSystems, Inc is a new generation of powerful 8-bit configurable microcontrollers. There are 8 independent input and output buses in the PSoC microcontroller, which are connected to digital and analog blocks respectively. The available block resources inside include: 4 basic types and 4 communication types of digital blocks, each with 3 CT, SCA and SCB type analog blocks. These resources can be configured into different functional modules to realize the functions of standard peripheral devices of the microcontroller. Using the basic type digital block, you can configure: * Counter (counter); * Timer (timer); * Pulse width modulation (PWM); * Cyclic redundancy check (CRC) serial receiver. Using the communication type digital block, you can configure: * Basic digital block; * Serial transmitter (serial transmitter); * Serial receiver (serial receiver); * SPI master (SPI Master); * SPI slave (SPI Slave). Using analog blocks, you can configure: * multi-pole filters; * amplifiers (gain stages); * digital-to-analog converters (DACs); * analog-to-digital converters (ADCs). In terms of module function design, Cypress uses the peripheral devices of various commonly used processors as the standard for designing modules, and groups the digital and analog block resources in the chip into standard functional modules, and stores these functional modules in the device library. Users use the integrated development platform (IDE) provided by Cypress to call these functional modules, set module clock inputs, configure global variables and local variables, set user function parameters, and complete the configuration of functional modules. In addition, these functional modules can also be connected to each other to complete more complex functions. Therefore, by reasonably configuring digital and analog blocks, most of the peripheral devices can be implemented on the chip. In addition, since the set parameter quantity is stored in the on-chip Flash, engineers can reconfigure digital and analog block parameters through software, whether at the beginning of the design or at the product application site, thereby adding/deleting functional modules, defining input/output pins, and completing hardware upgrades. This is the dynamic reconfigurability (Dynamic ReConfigurability) of programmable embedded system-on-chip. Therefore, the configurable system on chip (PSoC) allows users to define the types and quantities of functional modules required for the entire system according to their own needs, allocate chip resources, and complete the functional configuration inside the chip. For this control system, multiple timer function modules can be used to complete the intervals and timings between various actions, and complex logical relationships; A/D and PGA modules can be used to realize keyboard input and other functions; LCD modules can be used to realize parameter display and other functions; PSoC has the characteristics of multiple I/Os, which can easily realize the control of multiple switch signal quantities. Therefore, PSoC can be used to configure a variety of different peripheral components and microcontrollers with one chip. Establishing a configurable controller can realize the design process of the entire color selection controller from determining the system function to software/hardware division and completing it on the chip. The use of PSoC microcontrollers in this system has three obvious advantages: ① By using digital and analog blocks to configure different peripheral devices, a large number of peripheral devices can be designed into SoC; ② By using the internal bus to connect the functions selected by the user, the user can establish the actual system signal chain, reduce a large number of external lines, and even reallocate the input/output pins to help optimize the layout of the circuit board; ③ The biggest benefit is that it can redefine module functions in real time, quickly complete hardware upgrades, and can adapt to very complex real-time control requirements while enhancing the reliability and anti-interference ability of the system. 1.2 Determine the overall control scheme The color selection control method is a typical sequential control method. Sequential control is a common control method in industrial automatic control systems. Its control system generally has the following characteristics: a large number of switch signals, a large timing range, complex logical relationships, and high reliability requirements. Therefore, its control characteristics must be considered when designing the overall scheme. All input/output pins of the PSoC microprocessor can apply for interrupts, and each internal digital and analog module can also apply for interrupts. Therefore, this system can apply for multiple interrupts conveniently and flexibly according to requirements. After careful analysis of the above items, a schematic block diagram of the entire system can be drawn. This color selection control system is composed of memory, input/output circuit, LCD display module, keyboard circuit and other components. Its system composition is shown in Figure 1. 1.3 Specific hardware design scheme When entering the specific design stage, the division of labor and proportion of hardware and software must be carefully considered and repeatedly weighed. The hardware and software design processes must be carried out simultaneously, and the two complement each other. For the design of this control system, since most of the functions of peripheral devices are implemented in the microcontroller chip, the main work of external hardware is concentrated on the input/output interface design, and the input/output interface design is often intertwined with the control program. In addition, the connection and expansion of the memory is also a must. During the hardware design process, the devices should be carefully selected, and when wiring and arranging, attention should be paid to the manufacturing technology and assembly technology to overcome electrical interference. The following is the specific hardware design: an 8-bit LCD display, a 2%4 keyboard, and an 8KB memory are equipped on a single chip. The input/output uses optoelectronic isolation, and each output is also power amplified. (1) PSoC microcontroller PSoC microcontroller is the most important component in the control system. It completes the judgment and logical operation of the input signal and generates the timing control signal. The configuration of the PSoC microcontroller can be completed through the graphical tool on the IDE integrated development platform provided by the system. Select the timer, amplifier, LCD and other functional modules required for this control system, configure their internal parameters, specify their input and output relationships, and main and output pins. In the global variable part, configure the CPU operating frequency, system clock, interrupt, charge pump and other features to complete the on-chip configuration of the PSoC microcontroller. (2) Memory Memory is used to store operating parameters and user applications. There are two types of random access memory: dynamic random access memory DRAM and static random access memory SRAM. Although DRAM is low in price, it needs to be refreshed continuously. PSoC microcontrollers do not have a refresh function. In order to use DRAM, a refresh circuit has to be added. The total price is not low, and the circuit is complicated and the reliability is reduced. Therefore, SRAM-6264 is used in this system. When CE1 of 6264 is high or CE2 is low, 6264 is in a low-power hold state. At this time, the power supply current flowing through is the maintenance current, which is only μA level. In the hold state, VCC can be reduced to about 3V, and the internal stored data will not be lost. It can be seen that as long as CE1 is kept high after power failure and VCC is kept greater than 3V, the data stored in RAM can be kept unchanged, and the current consumed by VCC is very small. Therefore, a data storage protection circuit can be established. (3) Liquid crystal module Character liquid crystal display module is a type of dot matrix liquid crystal display module dedicated to displaying letters, numbers, symbols, etc. Character liquid crystal display driver controllers are widely used in character liquid crystal display modules. At present, the liquid crystal module in the PSoC microcontroller only supports the HD44780U display driver controller. (4) Input circuit The microcontroller can only accept logic circuit level signals of 0 to 5, while the field working signals are buttons and travel switches. The input circuit completes the level conversion task. At the same time, for the safety and reliability of the system, the filtering and isolation of the signal must also be considered. This system uses optoelectronic isolation and level conversion circuits. The photocoupler transmits information based on the principle of photoelectric conversion. It not only makes the information sending end (receiving side) and the information receiving and output end (secondary side) electrically insulated, thus having a strong ability to suppress ground potential difference interference, but also has a strong ability to suppress electromagnetic interference. It has high speed, low price and simple interface, so it is widely used. The primary side of the photocoupler is a light-emitting diode, but the secondary side has a variety of structures, such as photodiodes, phototransistors, etc., so there are many types of photocouplers such as diode-diode photocouplers and diode-transistor photocouplers. This system uses TPL521-4, which has 4 identical and independent photocouplers in the same package. TPL521 is mainly used in industrial control and its speed is not high. (5) Output circuit The output circuit mainly includes two parts: one is isolation and the other is power amplification. In sequential control systems, the control signal output by the microcontroller is often used to control actuators such as relays. They require large power, so the output signal needs to be optically isolated and amplified before being output to the actuator. 2 Functional design of loom color selector The loom color selector controller is a programmable sequential controller. It has two working states: programming state and running state. The function of the main program in the programming state is to update the content displayed on the display and the user types and edits the corresponding user program. The keyboard has five keys: MOD, TAB, INC, DEC, and ENT, which are used to enter programs and parameters. The functions of these keys are introduced below. MOD mode key: used to switch between programming state and running state. In programming state, the user can complete the editing of the user program; in running state, it is used to display the steps of program execution. TAB cursor movement key: used to move the screen cursor. As the cursor is in different variable positions, it indicates that this variable is in the editing state. This variable can be edited. INC increase key: in programming state, press this key to increase the variable at the cursor position by 1. DEC decrease key: in programming state, press this key to decrease the variable at the cursor position by 1. ENT confirmation key: after the variable is changed, press this key to confirm the change. In order to enable the loom color selector to execute according to the program entered by the user, we set a fixed program format. The user inputs the user program in this format, and the loom color selector can work according to the program. Its format is as follows: Program number Segment number Color number Weft number Maximum segment number Program number: indicates the name of the program to be executed or edited. Segment number: indicates the number of program steps. Color number: indicates the color selected this time. Weft number: indicates the number of times the weft is beaten. Maximum segment number: indicates the number of program cycle segments. Using the keys defined above, the user program input can be completed. After the machine is turned on and in the running state, the keyboard and display management program in the monitoring are executed at this time, and the input signal is monitored. According to the input signal, the program pre-stored in the memory by the user is executed. 3 Specific software design scheme The user writes the user program through the keyboard, and a certain storage space is reserved in the external storage space for the user to store the user program. The user can call, view, and edit his own color selection program at any time. The specific method is to determine the high address according to the program number, determine the low address according to the segment number, and then write the color number and weft number information to different bytes. The maximum segment number is stored in a fixed address. In the working process, the high-order address is determined according to the program number, the low-order address is determined according to the segment number, and then the color number and latitude number information stored in different bytes are read out. 4 MCU internal resource configuration Compared with ordinary ASIC design, the design of PSoC must first complete the design of the on-chip functional module. Therefore, the design process and integrated development environment of the configurable on-chip system are also different from the general ASIC design process and integrated development environment. PSoC design must first complete the planning of the chip's internal resources. The specific on-chip resource design process is: * Determine system requirements; * Select user modules; * Place user modules; * Set global variables and user module parameters; * Define output pins; * Generate application code; * Edit application code. Therefore, complete the device editor parameter configuration according to the design process in the integrated development environment. Figure 2 4.1 Selection and placement of user modules Select Timer16, Timer8, PGA, SAR6, and LCD modules, as shown in Figure 2. The IDE contains user module descriptions, instructions, and user guides/code excerpts, and user guide information for reading modules for configuration. There are generally no restrictions on the placement of digital modules. Try to use basic types of digital modules; analog modules can only be placed in allowed locations. 4.2 Set global variables and user module parametersGlobal resources24V1=16; configure system clock one24V2=16; configure system clock twoTimer16 moduleClock=CPU_32KHz; clock selectionCapture=Low; capture function offPeriod=65535; configure period CompareValue=Terminal Count; specify interrupt typeInterruptType=Terminal Count; specify interrupt typeOutput=NoneTimer8 moduleClock=CPU_32KHz; clock selectionCapture=Low; capture function offPeriod=255; configure period CompareValue=Terminal Count; specify interrupt typeInterruptType=Terminal Count; specify interrupt typeOutput=NonePGA moduleGain=1; unit gainInput=AnalogColumn_InputMUX_3; signal inputReference=AGND; reference groundAnalogbus=Disable ;Output bus AnalogColumn_InputMUX_3=PORT_0_2;Input bus Specify Pinout P0[2]=Analog_Input ;Analog input pin SAR6 module SignSource=ACA03 ;Signal selection ClockPhase=Normal ;Clock selection LCD module LCDPort=Port_0 ;Data port BarGraph=Enable ;Enable 4.3 Define output pin Input/output pin assignment P2[2]=StdCPU RisingEdge(Int);Color selection P2[3]=StdCPU DisablrInt ;Inverted brown input P2[4]=StdCPU DisablrInt ;Add weft P2[5]=StdCPU DisablrInt ;Reduce weft P1[1]=AnalogColumn_InputMUX_3(High Z)Keyboard input 4.4 Generate application code After completing the parameter configuration of the functional module, the system automatically generates the application program interface API and interrupt service routine ISR, and automatically inserts them into the project. Design engineers can fill in the application code on this basis to complete the compilation of the user program. Conclusion In general, in the color selection control system based on PSoC, except for some devices that cannot be integrated, most of the devices used in the color selection control system can be integrated into the PSoC chip, and the application system circuit board becomes very simple, which is very beneficial for reducing the size and power consumption of the system and improving the reliability of the system. Compared with traditional solutions, the solution provided by the configurable embedded system-on-chip has incomparable advantages.
Previous article:BDJ-3A three-phase power meter controlled by 8031
Next article:Design and implementation of frequency source based on AD9911
- Popular Resources
- Popular amplifiers
- 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
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- 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
- What does this sentence mean? How to understand it?
- A brief discussion on the insulation safety standards of driver chips
- Help download the source code of an encryption algorithm Hmac sha1
- Calculating the common-mode inductance of a switching power supply is actually not difficult!
- EEWORLD University - IC design process that even grandmas can understand
- Bear Pai Hongmeng Development Board Review - [Hardware Composition]
- Chip failure analysis
- MSP430 LaunchPAD Learning Notes
- TouchGFX Design + Make a Rubik's Cube (1)
- Ask for answers