[go: up one dir, main page]

CN106353587B - Power sensor data processing method and system - Google Patents

Power sensor data processing method and system Download PDF

Info

Publication number
CN106353587B
CN106353587B CN201610918407.1A CN201610918407A CN106353587B CN 106353587 B CN106353587 B CN 106353587B CN 201610918407 A CN201610918407 A CN 201610918407A CN 106353587 B CN106353587 B CN 106353587B
Authority
CN
China
Prior art keywords
command
timer
host
power sensor
module
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.)
Active
Application number
CN201610918407.1A
Other languages
Chinese (zh)
Other versions
CN106353587A (en
Inventor
刘克农
付武江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Chiffo Electronics Instruments Co Ltd
Original Assignee
Chengdu Chiffo Electronics Instruments Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chengdu Chiffo Electronics Instruments Co Ltd filed Critical Chengdu Chiffo Electronics Instruments Co Ltd
Priority to CN201610918407.1A priority Critical patent/CN106353587B/en
Publication of CN106353587A publication Critical patent/CN106353587A/en
Application granted granted Critical
Publication of CN106353587B publication Critical patent/CN106353587B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R21/00Arrangements for measuring electric power or power factor

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)

Abstract

The invention discloses a data processing method of a power sensor, which comprises the following steps: step 1, initializing a power sensor; step 2, judging whether the first timer is interrupted, if so, executing a first task, and if not, executing a step 3; step 3, judging whether the second timer is interrupted, if so, executing a second task, and if not, executing a step 4; step 4, judging whether a host control command is received, if so, analyzing the control command, and performing corresponding data processing according to an analysis result; and 5, returning the data after the data processing to the host. The data processing method of the power sensor executes different control operations by setting different interrupt operations, has various functions compared with the prior art, and can conveniently expand the functions by adopting an interrupt mode, thereby facilitating the operation of a user.

Description

Power sensor data processing method and system
Technical Field
The invention relates to the field of power sensors, in particular to a data processing method and system of a power sensor.
Background
Power reflectometers are commonly used to measure the power of Radio Frequency (RF) or microwave frequency (MW) signals. Typical power reflectometers use power detectors or transducers to convert RF or MW power into an electrical parameter that can be easily measured. Power reflectometers also have application in many types of RF and MW systems.
The power sensor is used as the most main component of the radio frequency power reflectometer, the performance of the reflectometer is determined by the measuring capability of the power sensor, and the existing power sensor has single function and poor expandability.
Disclosure of Invention
The invention overcomes the defects in the prior art and provides a power sensor data processing method and system with multiple functions and better expandability.
In order to achieve the purpose of the invention, the invention adopts the technical scheme that:
a power sensor data processing method, comprising the steps of:
step 1, initializing a power sensor;
step 2, judging whether the first timer is interrupted, if so, executing a first task, and if not, executing a step 3;
step 3, judging whether the second timer is interrupted, if so, executing a second task, and if not, executing a step 4;
step 4, judging whether a host control command is received, if so, analyzing the control command, and performing corresponding data processing according to an analysis result;
and 5, returning the data after the data processing to the host.
Further, the first task is to calculate a compensated temperature value.
Further, the second task is to update the analog-to-digital converter array data.
Further, if the host control command is a calibration data write command, the power sensor receives the calibration data through a USB interface and writes the calibration data into a memory.
Further, if the host control command is a command for controlling the analog board, the power sensor controls the analog board through the SPI interface and sends data returned by the analog board to the host.
The invention also provides a power sensor data processing system, which comprises a USB communication interface, an SPI communication interface, a command analysis module, a command execution module and a timer module, wherein the timer module is connected with the USB communication module and is used for enabling the USB communication interface to receive a control command sent by a host when the power sensor does not receive a timing command; the USB communication interface is connected with the host and the command analysis module and used for receiving a control command sent by the host and sending the control command to the command analysis module, and the command analysis module is connected with the command execution module and used for executing the analyzed command; the command execution module is further connected with the SPI communication interface, and the SPI communication interface is connected with the simulation board and used for controlling the simulation board through the SPI interface when a control simulation board command sent by the host computer is analyzed.
Compared with the prior art, the invention has the beneficial effects
The data processing method of the power sensor executes different control operations by setting different interrupt operations, has various functions compared with the prior art, and can conveniently expand the functions by adopting an interrupt mode, thereby facilitating the operation of a user.
Drawings
FIG. 1 is a flow chart of a power sensor data processing method of the present invention.
FIG. 2 is a block diagram of a power sensor data processing system of the present invention.
Detailed Description
The present invention will be described in further detail with reference to specific embodiments. It should be understood that the scope of the above-described subject matter is not limited to the following examples, and any techniques implemented based on the disclosure of the present invention are within the scope of the present invention.
Example 1:
fig. 1 is a flow chart of a data processing method of a power sensor according to the present invention, which includes the following steps:
step 1, initializing a power sensor;
step 2, judging whether the first timer is interrupted, if so, executing a first task, and if not, executing a step 3;
step 3, judging whether the second timer is interrupted, if so, executing a second task, and if not, executing a step 4;
step 4, judging whether a host control command is received, if so, analyzing the control command, and performing corresponding data processing according to an analysis result;
and 5, returning the data after the data processing to the host.
In a specific embodiment, the first task is to calculate a compensated temperature value.
In one embodiment, the second task is to update the analog-to-digital converter array data.
In one embodiment, if the host control command is a write calibration data command, the power sensor receives the calibration data through a USB interface and writes the calibration data into a memory.
In a specific embodiment, if the host control command is a command for controlling an analog board, the power sensor controls the analog board through the SPI interface and sends data returned by the analog board to the host.
The data processing method of the power sensor executes different control operations by setting different interrupt operations, has various functions compared with the prior art, and can conveniently expand the functions by adopting an interrupt mode, thereby facilitating the operation of a user.
The invention also provides a power sensor data processing system, specifically, referring to fig. 2, comprising a USB communication interface, an SPI communication interface, a command parsing module, a command executing module, and a timer module, wherein the timer module is connected to the USB communication module, and is configured to enable the USB communication interface to receive a control command sent by a host when the power sensor does not receive a timing command; the USB communication interface is connected with the host and the command analysis module and used for receiving a control command sent by the host and sending the control command to the command analysis module, and the command analysis module is connected with the command execution module and used for executing the analyzed command; the command execution module is further connected with the SPI communication interface, and the SPI communication interface is connected with the simulation board and used for controlling the simulation board through the SPI interface when a control simulation board command sent by the host computer is analyzed.
During specific operation, the power sensor is powered on firstly, after the power sensor is powered on, software and hardware are initialized firstly, and then a main program is entered. The power sensor software does not perform any action in the main program, and all execution operations are completed in an interrupt, which includes three interrupts: the first timer interrupt, the second timer interrupt and the USB interrupt built in the USB communication interface, wherein the interrupt priority is changed from high to low. The first timer interrupt and the second timer interrupt belong to a timer module, and the USB interrupt belongs to a USB communication interface module. If the first timer is interrupted, the execution is preferentially carried out, and the temperature value is calculated; if the second timer interruption occurs and no first timer interruption is responded, executing the second timer interruption and updating the data in the AD array; the USB interrupt priority is lowest, namely when the interrupt of the first timer and the interrupt of the second timer do not occur at the same time, the interrupt of the USB can be responded, if the host has a command to send, the host enters a USB communication interface module, an analysis program is entered after the command is received, the operation to be executed by the host is judged according to the analysis result, and if the operation is to write calibration data, the calibration module is called to write calibration parameters into a memory; if the operation of the simulation board is controlled, the SPI module is called to control the simulation board, and if the simulation board has data to return, the USB communication interface module is called again to return the data to the host.
While the present invention has been described in detail with reference to the embodiments shown in the drawings, the present invention is not limited to the above embodiments, and various modifications or alterations can be made by those skilled in the art without departing from the spirit and scope of the claims of the present application.

Claims (4)

1. A power sensor data processing method, comprising the steps of:
step 1, initializing a power sensor;
step 2, judging whether the first timer is interrupted, if so, executing calculation of a compensation temperature value, and if not, executing step 3;
step 3, judging whether the second timer is interrupted, if so, updating the analog-to-digital converter group data, and if not, executing step 4;
step 4, judging whether a host control command is received, if so, analyzing the control command, and performing corresponding data processing according to an analysis result;
and 5, returning the data after the data processing to the host.
2. The power sensor data processing method according to claim 1, wherein if the host control command is a write calibration data command, the power sensor receives the calibration data through a USB communication module and writes the calibration data into a memory.
3. The power sensor data processing method according to claim 1, wherein if the host control command is a command for controlling an analog board, the power sensor controls the analog board through an SPI communication interface and sends data returned by the analog board to the host.
4. A power sensor data processing system is characterized by comprising a USB communication module, an SPI communication interface, a command analysis module, a command execution module and a timer module, wherein the timer module is connected with the USB communication module and is used for enabling the USB communication module to receive a control command sent by a host when the power sensor does not receive a timing command; the USB communication module is connected with the host and the command analysis module and used for receiving a control command sent by the host and sending the control command to the command analysis module, and the command analysis module is connected with the command execution module and used for executing the analyzed command; the command execution module is also connected with the SPI communication interface, and the SPI communication interface is connected with a simulation board and used for controlling the simulation board through the SPI communication interface when a control simulation board command sent by the host computer is analyzed;
the first timer interrupt and the second timer interrupt belong to a timer module, and the USB interrupt belongs to a USB communication module; if the first timer is interrupted, the execution is preferentially carried out, and the temperature value is calculated; if the second timer interruption occurs and no first timer interruption is responded, executing the second timer interruption and updating the data in the AD array; the USB interrupt priority is lowest, when the interrupt of the first timer and the second timer does not occur at the same time, the interrupt of the USB can be responded, and if the host has a command to send, the host can enter the USB communication module.
CN201610918407.1A 2016-10-21 2016-10-21 Power sensor data processing method and system Active CN106353587B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610918407.1A CN106353587B (en) 2016-10-21 2016-10-21 Power sensor data processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610918407.1A CN106353587B (en) 2016-10-21 2016-10-21 Power sensor data processing method and system

Publications (2)

Publication Number Publication Date
CN106353587A CN106353587A (en) 2017-01-25
CN106353587B true CN106353587B (en) 2020-06-09

Family

ID=57864861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610918407.1A Active CN106353587B (en) 2016-10-21 2016-10-21 Power sensor data processing method and system

Country Status (1)

Country Link
CN (1) CN106353587B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101946241A (en) * 2008-02-14 2011-01-12 国际商业机器公司 Processing of data to monitor input/output operations
CN202267711U (en) * 2011-10-09 2012-06-06 绵阳市维博电子有限责任公司 Variable-frequency power sensor
CN104516780A (en) * 2013-09-30 2015-04-15 瑞萨电子株式会社 Data processing system
CN104637466A (en) * 2013-11-13 2015-05-20 三星电子株式会社 Timing controller, method of operating the same, and data processing system including the same

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7908521B2 (en) * 2008-06-25 2011-03-15 Microsoft Corporation Process reflection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101946241A (en) * 2008-02-14 2011-01-12 国际商业机器公司 Processing of data to monitor input/output operations
CN202267711U (en) * 2011-10-09 2012-06-06 绵阳市维博电子有限责任公司 Variable-frequency power sensor
CN104516780A (en) * 2013-09-30 2015-04-15 瑞萨电子株式会社 Data processing system
CN104637466A (en) * 2013-11-13 2015-05-20 三星电子株式会社 Timing controller, method of operating the same, and data processing system including the same

Also Published As

Publication number Publication date
CN106353587A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
CN108268366B (en) Test case execution method and device
CN111211937B (en) Method, device and system for testing stability of server link signals
US20120198101A1 (en) Mobile device peripheral detection with independent state machines
WO2016045095A1 (en) Method, apparatus and device for correcting detection distance
JP5452250B2 (en) Method and operating unit for adjusting a control device
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN105044513A (en) Quick frequency characteristic test system
KR20210098395A (en) Method for debugging noise elimination algorithm, apparatua and electronic device
CN115842251B (en) Antenna sampling compensation method, device and phased array panel antenna
WO2019241968A1 (en) Method for eliminating button base, capacitive button detection circuit and intelligent terminal
TWI410838B (en) Threshold compensation method on touch system
CN106353587B (en) Power sensor data processing method and system
CN111360809B (en) Signal instruction control method and device of robot and terminal equipment
CN110377476B (en) Terminal testing method, terminal and readable storage medium
CN113032232B (en) Correlation method, correlation device and equipment for performance detection of equipment
CN118626420A (en) Chip operating parameter calibration method and device, storage medium and electronic device
CN108694143B (en) data processing circuit
CN114367978B (en) Movement control method and device for chip transmission mechanical arm
CN116955242A (en) Single-bus communication method, storage medium and intelligent terminal
CN114265376B (en) A debugging method and batch debugging system for ZMD31050 chips
CN102419726A (en) Method and system for testing dispersed configuration of programs
CN115328788A (en) Delay control and concurrent execution control method, device, equipment and storage medium
JP2009037387A (en) Wireless usb system, device wire adapter, and method of controlling wired usb device
CN106547710A (en) It is a kind of based on the task timing of 1553B buses RTC time and analysis method on machine
EP3521769A1 (en) Control apparatus and control method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant