Method and system for acquiring high-precision timing signal
A timing signal, high-precision technology, applied in the direction of generating/distributing signals, etc., can solve the problem of providing additional high-precision clock chips
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Publication Date
- 2016-03-30
Smart Images
Figure 1 Figure 2 Figure 3
Abstract
Description
technical field
[0001] The invention belongs to the technical field of embedded chips, and in particular relates to a method and a system for obtaining high-precision timing signals. Background technique
[0002] Some embedded chips can only provide timers with secondary timing accuracy (such as milliseconds) relative to the main clock frequency of the chip (such as microseconds) due to system stability and the solidification of underlying resources. However, in the actual development process It is often necessary to use a more advanced timer that is close to or equal to the timing accuracy of the main clock frequency of the chip (such as microsecond level). The clock chip is used to handle this situation, which wastes manpower and material resources. Contents of the invention
[0003] The purpose of the embodiments of the present invention is to provide a method and system for obtaining a high-precision timing signal, so as to solve the problem in the prior art that an a...
Examples
Embodiment 1
[0022] Such as figure 1 Shown is a flowchart of a method for obtaining a high-precision timing signal provided by an embodiment of the present invention, and the method includes the following steps:
[0023] In step S101, the resolution T of the timing signal to be realized is set.
[0024] In the embodiment of the present invention, the terminal first sets the resolution T of the timing signal to be realized, and the resolution T of the timing signal is close to or equal to the main clock frequency of the chip. Preferably, the resolution of the timing signal is microsecond level, such as: Assuming that the resolution of the timing signal to be implemented is 1 μs (microsecond), the terminal sets the resolution T of the timing signal to be implemented as 1 μs.
[0025] In step S102, the chip is initialized according to the resolution, and the initialization includes: setting the frequency of the pulse width modulation signal F=1 / T and setting the interrupt edge of the interru...
Embodiment 2
[0044] Such as image 3 Shown is a structural diagram of a system for obtaining a high-precision timing signal provided by an embodiment of the present invention. For ease of description, only parts related to the embodiment of the present invention are shown.
[0045]The system for obtaining high-precision timing signals specifically includes: a resolution setting unit 301, an initialization unit 302, a connection unit 303, and a timing signal setting unit 304. The specific functions of each unit are as follows:
[0046] The resolution setting unit 301 is configured to set the resolution T of the timing signal to be realized.
[0047] In the embodiment of the present invention, the resolution setting unit 301 first sets the resolution T of the timing signal to be realized. According to the needs of actual use, the resolution of the timing signal is usually at the microsecond level. For example: suppose the resolution of the timing signal to be realized If the rate is 1 μs (m...