CN107145111A - A kind of method of controller and control targe equipment based on ARM chips - Google Patents
A kind of method of controller and control targe equipment based on ARM chips Download PDFInfo
- Publication number
- CN107145111A CN107145111A CN201710511991.3A CN201710511991A CN107145111A CN 107145111 A CN107145111 A CN 107145111A CN 201710511991 A CN201710511991 A CN 201710511991A CN 107145111 A CN107145111 A CN 107145111A
- Authority
- CN
- China
- Prior art keywords
- smt32
- minimum system
- chip
- controller
- interface
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 17
- 238000004891 communication Methods 0.000 claims abstract description 25
- 239000011159 matrix material Substances 0.000 claims abstract description 22
- 230000002093 peripheral effect Effects 0.000 claims description 6
- 238000005259 measurement Methods 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 9
- 238000012360 testing method Methods 0.000 description 6
- 239000000523 sample Substances 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000007812 deficiency Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- RVCKCEDKBVEEHL-UHFFFAOYSA-N 2,3,4,5,6-pentachlorobenzyl alcohol Chemical compound OCC1=C(Cl)C(Cl)=C(Cl)C(Cl)=C1Cl RVCKCEDKBVEEHL-UHFFFAOYSA-N 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 208000030251 communication disease Diseases 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000009347 mechanical transmission Effects 0.000 description 1
- 238000010339 medical test Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
- G05B19/0423—Input/output
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/21—Pc I-O input output
- G05B2219/21014—Interface, module with relays
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/25—Pc structure of the system
- G05B2219/25039—Clock
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/25—Pc structure of the system
- G05B2219/25171—Serial, RS232
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/25—Pc structure of the system
- G05B2219/25202—Internet, tcp-ip, web server : see under S05B219-40
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/25—Pc structure of the system
- G05B2219/25314—Modular structure, modules
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
Abstract
本发明公开了一种基于ARM芯片的控制器,包括STM32最小系统、高精度时钟模块、以太网网络模块及RS485通信模块,高精度时钟模块、以太网网络模块及RS485通信模块连接分别与STM32最小系统连接;STM32最小系统通过以太网网络模块与计算机连接;STM32最小系统通过RS485通信模块与电机系统连接;STM32最小系统与信号开关矩阵连接。本发明还公开了一种基于ARM芯片的控制器控制目标设备的方法。本发明在系统中设有控制器,控制器和计算机连接,同时也连接到电机系统和信号开关矩阵,从而实现计算机操作软件对设备或系统的控制,控制器可作为系统控制器应用于医疗设备、无线或天线测量设备等设备的控制。
The invention discloses a controller based on an ARM chip, which comprises an STM32 minimum system, a high-precision clock module, an Ethernet network module and an RS485 communication module, and the high-precision clock module, the Ethernet network module and the RS485 communication module are connected to the STM32 minimum system respectively. System connection; the STM32 minimum system is connected to the computer through the Ethernet network module; the STM32 minimum system is connected to the motor system through the RS485 communication module; the STM32 minimum system is connected to the signal switch matrix. The invention also discloses a method for controlling the target device by the controller based on the ARM chip. The present invention is provided with a controller in the system, the controller is connected to the computer, and is also connected to the motor system and the signal switch matrix, thereby realizing the control of the equipment or system by the computer operating software, and the controller can be used as a system controller for medical equipment , radio or antenna measurement equipment and other equipment control.
Description
技术领域technical field
本发明涉及一种基于ARM芯片的控制器及控制目标设备的方法。The invention relates to a controller based on an ARM chip and a method for controlling a target device.
背景技术Background technique
随着无线技术的发展和广泛应用,现代医疗、测量等设备或系统越来越多的应用无线技术和传动自动控制技术,例如医疗检测设备中一些使用微波手段进行检测的设备、无线行业中的无线或天线测试系统等设备或系统,其核心往往是电机系统及信号开关矩阵,对这些设备的控制实际上可以认为就是对电机系统和开关矩阵的控制。这类系统通常由软件和硬件相结合实现,面向操作者的往往是较为方便的计算机操作软件,操作者通过操作计算机软件来实现对设备或系统控制。然而计算机软件往往是无法独立控制外部硬件设备的。With the development and wide application of wireless technology, more and more modern medical and measurement equipment or systems use wireless technology and transmission automatic control technology, such as some equipment in medical testing equipment that use microwave means for detection, and in the wireless industry The core of equipment or systems such as wireless or antenna test systems is often the motor system and signal switch matrix. The control of these devices can actually be regarded as the control of the motor system and switch matrix. This type of system is usually implemented by a combination of software and hardware. The operator-oriented computer operating software is often more convenient, and the operator controls the equipment or system by operating the computer software. However, computer software often cannot independently control external hardware devices.
以上不足,有待改善。The above deficiencies need to be improved.
发明内容Contents of the invention
为了克服现有的技术的不足, 本发明提供一种基于ARM芯片的控制器及控制目标设备的方法。In order to overcome the deficiencies of the existing technologies, the present invention provides a controller based on an ARM chip and a method for controlling a target device.
本发明技术方案如下所述:Technical solution of the present invention is as follows:
一种基于ARM芯片的控制器,包括STM32最小系统、高精度时钟模块、以太网网络模块及RS485通信模块,所述高精度时钟模块、所述以太网网络模块及所述RS485通信模块连接分别与所述STM32最小系统连接,所述STM32最小系统通过所述以太网网络模块与计算机连接,所述STM32最小系统通过所述RS485通信模块与电机系统连接,所述STM32最小系统与信号开关矩阵连接。A kind of controller based on ARM chip, comprises STM32 minimum system, high-precision clock module, Ethernet network module and RS485 communication module, described high-precision clock module, described Ethernet network module and described RS485 communication module are connected with respectively The STM32 minimum system is connected, the STM32 minimum system is connected to the computer through the Ethernet network module, the STM32 minimum system is connected to the motor system through the RS485 communication module, and the STM32 minimum system is connected to the signal switch matrix.
进一步地,所述STM32最小系统包括外围电路、SMT32芯片、存储芯片、第一串口、IIC接口、SPI接口及I/O接口,所述存储芯片为独立存储芯片或集成于所述SMT32芯片的内部,所述外围电路连接所述SMT32芯片,所述SMT32芯片分别连接所述第一串口、所述IIC接口、所述SPI接口及所述I/O接口。Further, the STM32 minimum system includes a peripheral circuit, an SMT32 chip, a memory chip, a first serial port, an IIC interface, an SPI interface, and an I/O interface, and the memory chip is an independent memory chip or integrated inside the SMT32 chip , the peripheral circuit is connected to the SMT32 chip, and the SMT32 chip is respectively connected to the first serial port, the IIC interface, the SPI interface and the I/O interface.
进一步地,所述高精度时钟模块通过所述IIC接口与所述SMT32芯片连接。Further, the high-precision clock module is connected to the SMT32 chip through the IIC interface.
进一步地,所述以太网网络模块通过所述SPI接口与所述SMT32芯片连接。Further, the Ethernet network module is connected to the SMT32 chip through the SPI interface.
进一步地,所述RS485通信模块通过所述第一串口与所述SMT32芯片连接。Further, the RS485 communication module is connected to the SMT32 chip through the first serial port.
进一步地,所述信号开关矩阵通过所述I/O接口与所述STM32最小系统连接。Further, the signal switch matrix is connected to the STM32 minimum system through the I/O interface.
进一步地,所述STM32最小系统还包括第二串口,所述第二串口与所述SMT32芯片连接,所述SMT32芯片通过所述第二串口与所述计算机相连。Further, the STM32 minimum system further includes a second serial port, the second serial port is connected to the SMT32 chip, and the SMT32 chip is connected to the computer through the second serial port.
进一步地,所述高精度时钟模块包括设有DS3231时钟芯片和 AT24C32 存储芯片。Further, the high-precision clock module includes a DS3231 clock chip and an AT24C32 memory chip.
本发明的另一个目的在于提供一种基于ARM芯片的控制器控制目标设备的方法:Another object of the present invention is to provide a method for controlling a target device based on an ARM chip-based controller:
对控制器进行上电,STM32最小系统开始运行C语言代码,具体为:C语言代码控制SMT32最小系统进行RCC初始化;Power on the controller, and the STM32 minimum system starts to run the C language code, specifically: the C language code controls the SMT32 minimum system to perform RCC initialization;
C语言代码控制SMT32最小系统进行NVIC初始化;The C language code controls the SMT32 minimum system to initialize the NVIC;
C语言代码控制SMT32最小系统进行高精度时钟初始化;C language code controls the SMT32 minimum system to perform high-precision clock initialization;
C语言代码控制SMT32最小系统进行GPIO初始化;C language code controls SMT32 minimum system to initialize GPIO;
C语言代码控制SMT32最小系统进行第一串口初始化;C language code controls the SMT32 minimum system to initialize the first serial port;
C语言代码控制SMT32最小系统进行以太网网络模块初始化;C language code controls the SMT32 minimum system to initialize the Ethernet network module;
初始化完成后进入待命状态,当计算机向以太网网络模块发送命令后,SMT32最小系统将命令解析并转化后,控制器通过RS232接口输出电机系统控制信号,控制器通过I/O接口输出信号开关矩阵切换信号。After the initialization is completed, it enters the standby state. When the computer sends a command to the Ethernet network module, the SMT32 minimum system parses and converts the command, and the controller outputs the motor system control signal through the RS232 interface, and the controller outputs the signal switch matrix through the I/O interface. Toggle signal.
进一步地,在C语言代码控制SMT32最小系统进行高精度时钟初始化过程中,SMT32最小系统在C语言程序控制下与高精度时钟模块通信,进行当前时间和时间期限的对比,若当前时间超出时间期限则向计算机发出讯息,若当前时间未超出时间期限则继续。Further, in the process of C language code controlling the SMT32 minimum system to initialize the high-precision clock, the SMT32 minimum system communicates with the high-precision clock module under the control of the C language program, and compares the current time with the time limit. If the current time exceeds the time limit Then send a message to the computer, and continue if the current time does not exceed the time limit.
根据上述方案的本发明,其有益效果在于,本发明在系统中设有控制器,控制器和计算机连接,同时也连接到电机系统和信号开关矩阵,从而实现计算机操作软件对设备或系统的控制,控制器可作为系统控制器应用于医疗设备、无线或天线测量设备等设备的控制。According to the present invention of above-mentioned scheme, its beneficial effect is that, the present invention is provided with controller in the system, and controller is connected with computer, is also connected with motor system and signal switch matrix simultaneously, thereby realizes the control of equipment or system by computer operation software , the controller can be used as a system controller for the control of medical equipment, wireless or antenna measurement equipment and other equipment.
附图说明Description of drawings
图1为本发明的硬件系统结构框图。Fig. 1 is a structural block diagram of the hardware system of the present invention.
图2为本发明的软件系统结构框图。Fig. 2 is a structural block diagram of the software system of the present invention.
图3为本发明的系统流程图。Fig. 3 is a system flow chart of the present invention.
具体实施方式detailed description
下面结合附图以及实施方式对本发明进行进一步的描述:The present invention is further described below in conjunction with accompanying drawing and embodiment:
如图1所示,一种基于ARM芯片的控制器,包括STM32最小系统、高精度时钟模块、以太网网络模块及RS485通信模块,高精度时钟模块、以太网网络模块及RS485通信模块连接分别与STM32最小系统连接,STM32最小系统通过以太网网络模块与计算机连接,STM32最小系统通过RS485通信模块与电机系统连接,STM32最小系统与信号开关矩阵连接。As shown in Figure 1, a controller based on an ARM chip includes a minimum STM32 system, a high-precision clock module, an Ethernet network module, and an RS485 communication module. The high-precision clock module, the Ethernet network module, and the RS485 communication module are respectively connected to the The STM32 minimum system is connected, the STM32 minimum system is connected to the computer through the Ethernet network module, the STM32 minimum system is connected to the motor system through the RS485 communication module, and the STM32 minimum system is connected to the signal switch matrix.
本发明的有益效果在于,本发明在系统中设有控制器,控制器和计算机连接,同时也连接到电机系统和信号开关矩阵,从而实现计算机操作软件对设备或系统的控制,控制器可作为于系统控制器应用于医疗设备、无线或天线测量设备等设备的控制。The beneficial effects of the present invention are that the present invention is provided with a controller in the system, the controller is connected to the computer, and is also connected to the motor system and the signal switch matrix, thereby realizing the control of the equipment or system by the computer operating software, and the controller can be used as It is used in the control of medical equipment, wireless or antenna measurement equipment and other equipment in system controller.
STM32最小系统包括外围电路、SMT32芯片、存储芯片、第一串口、IIC接口、SPI接口及I/O接口,存储芯片为独立存储芯片或集成于SMT32芯片的内部,外围电路连接SMT32芯片,SMT32芯片分别连接第一串口、IIC接口、SPI接口及I/O接口。STM32 minimum system includes peripheral circuit, SMT32 chip, memory chip, first serial port, IIC interface, SPI interface and I/O interface. The memory chip is an independent memory chip or integrated inside the SMT32 chip. The peripheral circuit is connected to the SMT32 chip. Connect the first serial port, IIC interface, SPI interface and I/O interface respectively.
在本实施例中,高精度时钟模块通过IIC接口与SMT32芯片连接。In this embodiment, the high-precision clock module is connected to the SMT32 chip through the IIC interface.
在本实施例中,以太网网络模块通过SPI接口与SMT32芯片连接。以太网网络模块是一块集成了全硬件TCP/IP协议栈的以太网模块,其作用是连接计算机和SMT32最小系统,实现双向的通信。In this embodiment, the Ethernet network module is connected to the SMT32 chip through the SPI interface. The Ethernet network module is an Ethernet module that integrates the full hardware TCP/IP protocol stack, and its function is to connect the computer and the SMT32 minimum system to realize two-way communication.
在本实施例中,RS485通信模块通过第一串口与SMT32芯片连接。RS485通信模块的作用主要是转发计算机的电机系统控制命令,电机系统的协议在计算机实现,并不在控制器中实现,但电机系统控制命令需要经过控制器转换收发。In this embodiment, the RS485 communication module is connected to the SMT32 chip through the first serial port. The role of the RS485 communication module is mainly to forward the motor system control commands of the computer. The protocol of the motor system is implemented in the computer, not in the controller, but the motor system control commands need to be converted and sent by the controller.
在本实施例中,信号开关矩阵通过I/O接口与STM32最小系统连接。在本实施例中,I/O接口设有多个。In this embodiment, the signal switch matrix is connected to the STM32 minimum system through the I/O interface. In this embodiment, there are multiple I/O interfaces.
在本实施例中,STM32最小系统还包括第二串口,第二串口与SMT32芯片连接,SMT32芯片通过第二串口与计算机相连,第二串口为对外备用接口,可替代网口。In this embodiment, the STM32 minimum system also includes a second serial port, the second serial port is connected to the SMT32 chip, the SMT32 chip is connected to the computer through the second serial port, and the second serial port is an external backup interface, which can replace the network port.
高精度时钟模块包括设有DS3231时钟芯片和 AT24C32 存储芯片。The high-precision clock module includes a DS3231 clock chip and an AT24C32 memory chip.
STM32最小系统为设有ARM芯片的PCBA板,ARM芯片烧录C语言程序,在KEIL4下编译生成二进制文件,烧录到STM32系列ARM芯片的FLASH存储区,ARM芯片上电即运行程序。The minimum STM32 system is a PCBA board equipped with an ARM chip. The ARM chip burns a C language program, compiles and generates a binary file under KEIL4, and burns it into the FLASH storage area of the STM32 series ARM chip. The ARM chip runs the program when it is powered on.
软件共有5大子模块,包括通信协议、网络芯片驱动模块、RS485通信模块、AT24C02驱动模块及DS3231驱动模块。The software has 5 major sub-modules, including communication protocol, network chip driver module, RS485 communication module, AT24C02 driver module and DS3231 driver module.
通信协议:STM32最小系统是以STM32系列的ARM芯片为核心的电路板,ARM芯片里面运行C语言程序。该电路板上电后,把网络芯片配置成TCP Server模式。命令格式是02开头,03结尾,中间的内容都是字符,不同种类的命令都有不同的标识符。通信协议能够响应的命令有电机系统控制命令、信号矩阵切换命令、DS3231时间读取、设置命令及AT24C02存储区数据读写命令。Communication protocol: The minimum system of STM32 is a circuit board with STM32 series ARM chip as the core, and the C language program runs in the ARM chip. After the circuit board is powered on, configure the network chip in TCP Server mode. The command format starts with 02 and ends with 03, and the content in the middle is all characters. Different types of commands have different identifiers. The commands that the communication protocol can respond to include motor system control commands, signal matrix switching commands, DS3231 time reading and setting commands, and AT24C02 storage area data read and write commands.
网络芯片驱动模块:STM32系列的ARM芯片驱动网络芯片采用SPI接口。网络芯片读写同步不用延时或者轮询,数据读写完毕,会进入中断程序,在中断程序中查询寄存器的相关标志位,可判别是何种操作引发的中断。网络芯片配制成TCP Server模式,为了防止多个客户端接入,造成通信紊乱,本程序中限定只能接入一个计算机。Network chip driver module: STM32 series ARM chip driver network chip adopts SPI interface. The read and write synchronization of the network chip does not require delay or polling. After the data is read and written, it will enter the interrupt program. In the interrupt program, query the relevant flag bits of the register to determine what kind of operation caused the interrupt. The network chip is configured as a TCP Server mode. In order to prevent multiple clients from accessing and causing communication disorder, this program limits access to only one computer.
RS485通信模块:RS485通信模块的作用主要是转发计算机的电机系统控制命令,电机系统的协议在计算机实现。由于硬件部分包含了RS485收发自动识别电路,故在软件中不必包含RS485芯片收发引脚的控制,对RS485的控制在软件层面上和RS232是一样的。RS485 communication module: The function of the RS485 communication module is mainly to forward the motor system control command of the computer, and the protocol of the motor system is realized in the computer. Since the hardware part includes the RS485 transceiver automatic identification circuit, it is not necessary to include the control of the RS485 chip transceiver pin in the software, and the control of RS485 is the same as that of RS232 on the software level.
AT24C02驱动模块:AT24C02用来存储电路板功能的使用时间期限,当使用时间期限到时,电路板的相关功能则会关闭。AT24C02 driver module: AT24C02 is used to store the use time limit of the circuit board function. When the use time limit expires, the related functions of the circuit board will be closed.
DS3231驱动模块:STM32系列芯片通过I2C接口读取或设置该DS3231时钟芯片的时间。软件上电运行时,在初始化的过程中,先读取DS3231时钟芯片的时间,再读取AT24C02里面的时间期限,如果DS3231时钟芯片的时间晚于AT24C02里面的时间期限,则关闭控制板响应命令的功能。DS3231 driver module: STM32 series chips read or set the time of the DS3231 clock chip through the I2C interface. When the software is powered on and running, in the initialization process, first read the time of the DS3231 clock chip, and then read the time limit in the AT24C02, if the time of the DS3231 clock chip is later than the time limit in the AT24C02, turn off the control board to respond to the command function.
本实施例提供的基于ARM芯片的控制器的工作原理为:计算机连接至以太网网络模块,以太网网络模块通过SPI接口与STM32最小系统连接,STM32最小系统上电后STM32芯片运行其AT24C32存储芯片里的C语言程序。高精度时钟模块通过IIC接口连接至STM32最小系统,STM32最小系统可读取或设置高精度时钟模块的时间,也可读取其AT24C32存储芯片里记录的截止时间,DS3231时钟芯片始终在计时,基于ARM芯片的控制器每次初始化时STM32最小系统都会读取高精度时钟模块DS3231时钟芯片的当前时间并和AT24C32存储芯片内记录的截止时间对比,如果当前时间已经超过了截止时间,则STM32最小系统将关闭响应控制命令的功能;STM32最小系统的I/O接口可输出高低电平组合的输出信号,实现待控设备的信号开关矩阵(如无线测试设备中的电子开关、探头切换开关等模块)的控制。The working principle of the controller based on the ARM chip provided in this embodiment is: the computer is connected to the Ethernet network module, and the Ethernet network module is connected to the STM32 minimum system through the SPI interface. After the STM32 minimum system is powered on, the STM32 chip runs its AT24C32 memory chip The C language program in. The high-precision clock module is connected to the STM32 minimum system through the IIC interface. The STM32 minimum system can read or set the time of the high-precision clock module, and can also read the cut-off time recorded in its AT24C32 memory chip. The DS3231 clock chip is always timing, based on Every time the controller of the ARM chip is initialized, the STM32 minimum system will read the current time of the high-precision clock module DS3231 clock chip and compare it with the cut-off time recorded in the AT24C32 memory chip. If the current time has exceeded the cut-off time, the STM32 minimum system will The function of responding to control commands will be turned off; the I/O interface of the STM32 minimum system can output a combination of high and low level output signals to realize the signal switch matrix of the equipment to be controlled (such as electronic switches in wireless test equipment, probe switching switches and other modules) control.
在本实施例中,以控制多探头无线测试系统为例,多探头无线测试系统的控制实际上主要是电机系统及信号开关矩阵的控制。多探头无线测试系统中,主要是要控制具有机械传动功能的电机系统和具有信号切换作用的信号开关矩阵,基于ARM芯片的控制器使用RS232接口输出控制电机系统的命令、读取电机系统的信息,基于ARM芯片的控制器使用I/O接口输出高低电平组合控制电子开关矩阵。In this embodiment, taking the control of a multi-probe wireless test system as an example, the control of the multi-probe wireless test system is actually mainly the control of the motor system and the signal switch matrix. In the multi-probe wireless test system, it is mainly to control the motor system with mechanical transmission function and the signal switch matrix with signal switching function. The controller based on the ARM chip uses the RS232 interface to output the command to control the motor system and read the information of the motor system. , the controller based on the ARM chip uses the I/O interface to output high and low level combinations to control the electronic switch matrix.
一种基于ARM芯片的控制器控制目标设备的方法:A method for controlling a target device based on an ARM chip controller:
准备工作:对SMT32最小系统进行软件烧录,以太网网络模块通过SPI接口连接到SMT32最小系统;高精度时钟模块通过IIC接口连接到SMT32最小系统;RS485通信模块通过第一串口连接到SMT32最小系统。将控制器的网口连接至计算机,也可通过备用的第二串口连接计算机,将控制器的RS322接口连接至目标设备的电机系统;将控制器的I/O接口连接至目标设备的信号开关矩阵。Preparations: Carry out software programming on the SMT32 minimum system, the Ethernet network module is connected to the SMT32 minimum system through the SPI interface; the high-precision clock module is connected to the SMT32 minimum system through the IIC interface; the RS485 communication module is connected to the SMT32 minimum system through the first serial port . Connect the network port of the controller to the computer, or connect to the computer through the spare second serial port, connect the RS322 interface of the controller to the motor system of the target device; connect the I/O interface of the controller to the signal switch of the target device matrix.
步骤一、对控制器进行上电,STM32最小系统上电开始运行C语言代码,具体为:C语言代码控制SMT32最小系统进行RCC初始化;Step 1. Power on the controller, and the STM32 minimum system starts to run the C language code, specifically: the C language code controls the SMT32 minimum system to perform RCC initialization;
步骤二、C语言代码控制SMT32最小系统进行NVIC初始化;Step 2, the C language code controls the SMT32 minimum system to perform NVIC initialization;
步骤三、C语言代码控制SMT32最小系统进行高精度时钟初始化,在C语言代码控制SMT32最小系统进行高精度时钟初始化过程中,SMT32最小系统在C语言程序控制下与高精度时钟模块通信,进行当前时间和时间期限的对比,若当前时间超出时间期限则向计算机发出讯息,若当前时间未超出时间期限则继续。Step 3: The C language code controls the SMT32 minimum system to initialize the high-precision clock. During the C language code control of the SMT32 minimum system to perform the high-precision clock initialization process, the SMT32 minimum system communicates with the high-precision clock module under the control of the C language program to perform current Comparing the time and the time limit, if the current time exceeds the time limit, a message is sent to the computer, and if the current time does not exceed the time limit, it continues.
步骤四、C语言代码控制SMT32最小系统进行GPIO初始化;Step 4, the C language code controls the SMT32 minimum system to perform GPIO initialization;
步骤五、C语言代码控制SMT32最小系统进行第一串口初始化;Step five, the C language code controls the SMT32 minimum system to initialize the first serial port;
步骤六、C语言代码控制SMT32最小系统进行以太网网络模块初始化;Step 6, the C language code controls the SMT32 minimum system to initialize the Ethernet network module;
步骤七、初始化完成后进入待命状态,当计算机向以太网网络模块发送命令后,SMT32最小系统将命令解析并转化后,控制器通过RS232接口输出电机系统控制信号,控制器通过I/O接口输出信号开关矩阵切换信号。Step 7: Enter the standby state after the initialization is completed. When the computer sends a command to the Ethernet network module, the SMT32 minimum system parses and converts the command, and the controller outputs the motor system control signal through the RS232 interface, and the controller outputs through the I/O interface. The signal switch matrix switches the signals.
以上初始化过程并非一定要按照某种特定顺序进行,显然的,只要能完成各个模块的初始化,调整顺序是没有关系的,顺序的调整仅仅是软件上处理先后的简单调整。The above initialization process does not have to be carried out in a specific order. Obviously, as long as the initialization of each module can be completed, the adjustment order does not matter. The order adjustment is just a simple adjustment of the processing sequence on the software.
在本实施例中,可进行时间期限设置,进行时间期限设置首先SMT32最小系统上电,开始运行C语言代码,并与高精度时钟模块通信,此时可通过计算机运行上位机程序来设置或读取高精度时钟模块通信的时间和时间期限。此设置目的在于创建一个自动控制使用时限功能,在设置好以后,每次控制器上电运行C语言程序时均会进行当前时间和时间期限的对比,当前时间超出时间期限时,则不再响应计算机给出的控制电机系统或控制信号开关矩阵的命令。In this embodiment, the time limit can be set. To set the time limit, first the SMT32 minimum system is powered on, starts to run the C language code, and communicates with the high-precision clock module. At this time, it can be set or read by running the host computer program on the computer. Get the time and time period for high precision clock module communication. The purpose of this setting is to create an automatic control use time limit function. After setting, the current time will be compared with the time limit every time the controller is powered on to run the C language program. When the current time exceeds the time limit, it will no longer respond Commands given by the computer to control the motor system or to control the signal switch matrix.
在本实施例中,通过上述基于ARM芯片的控制器控制目标设备的方法,从而实现了对多探头无线测试系统的控制。In this embodiment, the control of the multi-probe wireless test system is realized through the above-mentioned method for controlling the target device based on the controller based on the ARM chip.
应当理解的是,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,而所有这些改进和变换都应属于本发明所附权利要求的保护范围。It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should belong to the protection scope of the appended claims of the present invention.
上面结合附图对本发明专利进行了示例性的描述,显然本发明专利的实现并不受上述方式的限制,只要采用了本发明专利的方法构思和技术方案进行的各种改进,或未经改进将本发明专利的构思和技术方案直接应用于其它场合的,均在本发明的保护范围内。The patent of the present invention has been exemplarily described above in conjunction with the accompanying drawings. Obviously, the implementation of the patent of the present invention is not limited by the above-mentioned method, as long as the method concept and technical solutions of the patent of the present invention are adopted. Various improvements are made, or there is no improvement Directly applying the concepts and technical solutions of the patent of the present invention to other occasions is within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710511991.3A CN107145111A (en) | 2017-06-29 | 2017-06-29 | A kind of method of controller and control targe equipment based on ARM chips |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710511991.3A CN107145111A (en) | 2017-06-29 | 2017-06-29 | A kind of method of controller and control targe equipment based on ARM chips |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107145111A true CN107145111A (en) | 2017-09-08 |
Family
ID=59784339
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710511991.3A Pending CN107145111A (en) | 2017-06-29 | 2017-06-29 | A kind of method of controller and control targe equipment based on ARM chips |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107145111A (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103631690A (en) * | 2013-11-21 | 2014-03-12 | 广东电网公司电力科学研究院 | Electric power collecting and copying device RS485 interface handheld type tester and testing method thereof |
CN103678728A (en) * | 2013-11-25 | 2014-03-26 | 北京航空航天大学 | High-speed data recording system based on FPGA+DSP framework and establishment method thereof |
CN103812764A (en) * | 2012-11-09 | 2014-05-21 | 江苏省电力公司连云港供电公司 | Electrical monitoring equipment multiprotocol gateway |
CN104750065A (en) * | 2015-02-10 | 2015-07-01 | 浙江大学 | STM32 based remote distributed programmable automatic control system and method |
CN205210626U (en) * | 2015-12-20 | 2016-05-04 | 天津市南开太阳高技术发展有限公司 | Embedded network data communication control unit |
CN105573743A (en) * | 2015-11-19 | 2016-05-11 | 深圳市芯海科技有限公司 | Chip burning system and method and electronic equipment |
CN105589438A (en) * | 2015-07-10 | 2016-05-18 | 吕春晓 | Intelligent mobile communication base station energy management system |
CN105978778A (en) * | 2016-07-01 | 2016-09-28 | 南京理工大学 | Ethernet and serial port/CAN protocol conversion device based on STM32 |
CN205992136U (en) * | 2016-08-02 | 2017-03-01 | 海南大学 | A kind of intelligent domestic system being controlled based on STM32 and Android |
CN206224192U (en) * | 2016-12-01 | 2017-06-06 | 深圳市新益技术有限公司 | One kind probe and motor control assembly |
CN206920878U (en) * | 2017-06-29 | 2018-01-23 | 泰姆瑞技术(深圳)有限公司 | A kind of controller based on ARM chips |
-
2017
- 2017-06-29 CN CN201710511991.3A patent/CN107145111A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103812764A (en) * | 2012-11-09 | 2014-05-21 | 江苏省电力公司连云港供电公司 | Electrical monitoring equipment multiprotocol gateway |
CN103631690A (en) * | 2013-11-21 | 2014-03-12 | 广东电网公司电力科学研究院 | Electric power collecting and copying device RS485 interface handheld type tester and testing method thereof |
CN103678728A (en) * | 2013-11-25 | 2014-03-26 | 北京航空航天大学 | High-speed data recording system based on FPGA+DSP framework and establishment method thereof |
CN104750065A (en) * | 2015-02-10 | 2015-07-01 | 浙江大学 | STM32 based remote distributed programmable automatic control system and method |
CN105589438A (en) * | 2015-07-10 | 2016-05-18 | 吕春晓 | Intelligent mobile communication base station energy management system |
CN105573743A (en) * | 2015-11-19 | 2016-05-11 | 深圳市芯海科技有限公司 | Chip burning system and method and electronic equipment |
CN205210626U (en) * | 2015-12-20 | 2016-05-04 | 天津市南开太阳高技术发展有限公司 | Embedded network data communication control unit |
CN105978778A (en) * | 2016-07-01 | 2016-09-28 | 南京理工大学 | Ethernet and serial port/CAN protocol conversion device based on STM32 |
CN205992136U (en) * | 2016-08-02 | 2017-03-01 | 海南大学 | A kind of intelligent domestic system being controlled based on STM32 and Android |
CN206224192U (en) * | 2016-12-01 | 2017-06-06 | 深圳市新益技术有限公司 | One kind probe and motor control assembly |
CN206920878U (en) * | 2017-06-29 | 2018-01-23 | 泰姆瑞技术(深圳)有限公司 | A kind of controller based on ARM chips |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021189322A1 (en) | Chip testing apparatus and chip testing method | |
US10914784B2 (en) | Method and apparatus for providing UFS terminated and unterminated pulse width modulation support using dual channels | |
US20120316859A1 (en) | Embedded bus emulation | |
WO2023279910A1 (en) | Host/slave device control method and control system, and blood cabinet | |
CN109411007B (en) | Universal flash memory test system based on FPGA | |
WO2021098485A1 (en) | Method and system for power-on and power-off control of pcie device | |
CN102063747B (en) | CAN data logger | |
CN111506249B (en) | Data interaction system and method based on ZYNQ platform | |
CN117148817A (en) | a test system | |
CN210864564U (en) | High-performance main control board with 6U CPCI specification | |
CN103561116B (en) | Use the method that restructural PXI serial communication card realizes remote reconstruction | |
CN109901664B (en) | Method, apparatus, system, device and readable storage medium for providing clock signal | |
CN114564095A (en) | Intelligent network card charging control system and server | |
CN107145111A (en) | A kind of method of controller and control targe equipment based on ARM chips | |
CN116074397B (en) | Data sharing system | |
CN115934436B (en) | Optical communication bus test board card | |
CN110765065A (en) | System on chip | |
CN212543816U (en) | ARINC 429 bus communication board card of USB specification | |
CN206920878U (en) | A kind of controller based on ARM chips | |
CN115033172A (en) | Storage module control method, device, equipment and storage medium | |
CN112783071A (en) | SDIO controller, FPGA board card and SDIO test system | |
CN117872941A (en) | Digital control platform | |
CN218772449U (en) | 4G Internet of things communication management system | |
CN112052132A (en) | Method, device, equipment and medium for debugging plug-in chip through SDIO interface | |
CN104778062B (en) | The hardware configuration and its application process of erasable chip ground programming on star |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170908 |