CN110554979A - time-piece device and method for operating same - Google Patents
time-piece device and method for operating same Download PDFInfo
- Publication number
- CN110554979A CN110554979A CN201810552772.4A CN201810552772A CN110554979A CN 110554979 A CN110554979 A CN 110554979A CN 201810552772 A CN201810552772 A CN 201810552772A CN 110554979 A CN110554979 A CN 110554979A
- Authority
- CN
- China
- Prior art keywords
- timing
- interrupt signal
- chip module
- module
- interrupt
- 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 16
- 238000012545 processing Methods 0.000 claims abstract description 13
- 238000011017 operating method Methods 0.000 claims description 6
- 238000013461 design Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/04—Generating or distributing clock signals or signals derived directly therefrom
- G06F1/14—Time supervision arrangements, e.g. real time clock
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/24—Handling requests for interconnection or transfer for access to input/output bus using interrupt
- G06F13/26—Handling requests for interconnection or transfer for access to input/output bus using interrupt with priority control
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Microcomputers (AREA)
Abstract
Description
技术领域technical field
本发明涉及计时技术,且特别涉及一种计时装置及其运行方法。The invention relates to timing technology, and in particular to a timing device and an operating method thereof.
背景技术Background technique
单芯片模块例如(但不限于)8051芯片整合多种基本电路于单一芯片中,因为体积小,而广泛地被应用在许多电子装置中作为控制器。单芯片模块在进行数据处理时,可根据内部中断信号处理较为紧急的事件。然而,随着应用愈来愈复杂,需要处理的事件愈来愈多,当内部中断信号的优先层级不足以区别更多类型的事件时,往往使得内部的模块例如(但不限于)计时器无法以内部中断信号及时告知单芯片模块事件的发生。Single-chip modules such as (but not limited to) 8051 chips integrate various basic circuits into a single chip, and are widely used as controllers in many electronic devices because of their small size. When the single-chip module is processing data, it can handle more urgent events according to the internal interrupt signal. However, as the application becomes more and more complex, more and more events need to be processed. When the priority level of the internal interrupt signal is not enough to distinguish more types of events, it often makes internal modules such as (but not limited to) timers unable to The occurrence of the single-chip module event is notified in time by an internal interrupt signal.
因此,如何设计一个新的计时装置及其运行方法,以解决上述的缺陷,乃为此一业界亟待解决的问题。Therefore, how to design a new timing device and its operation method to solve the above-mentioned defects is an urgent problem to be solved in this industry.
发明内容Contents of the invention
本发明的目的在于提供一种计时装置,包括:单芯片模块以及数字计时模块。单芯片模块配置成根据内部的至少两个内部中断(interrupt)信号进行事件处理。数字计时模块配置成进行计时,并于计时事件发生时,产生计时中断信号至单芯片模块,其中计时中断信号的优先层级高于至少两个内部中断信号,以使单芯片模块于接收到计时中断信号时优先处理执行对应计时中断信号的中断服务程序。The object of the present invention is to provide a timing device, including: a single-chip module and a digital timing module. The single-chip module is configured to perform event processing according to at least two internal interrupt signals. The digital timing module is configured to perform timing, and when a timing event occurs, generate a timing interrupt signal to the single-chip module, wherein the priority level of the timing interrupt signal is higher than at least two internal interrupt signals, so that the single-chip module receives the timing interrupt Signals are prioritized to execute the interrupt service routine corresponding to the timing interrupt signal.
本发明的另一目的在于提供一种计时装置运行方法,包括:使单芯片模块根据内部的至少两个内部中断信号进行事件处理;以及使数字计时模块进行计时,并于计时事件发生时,产生计时中断信号至单芯片模块,其中计时中断信号的优先层级高于至少两个内部中断信号;以及使单芯片模块于接收到计时中断信号时优先处理执行对应计时中断信号的中断服务程序。Another object of the present invention is to provide a method for running a timing device, including: enabling the single-chip module to perform event processing according to at least two internal interrupt signals; and enabling the digital timing module to perform timing, and when timing events occur, generate The timer interrupt signal is sent to the single-chip module, wherein the priority level of the timer interrupt signal is higher than at least two internal interrupt signals; and the single-chip module is given priority to process and execute the interrupt service program corresponding to the timer interrupt signal when receiving the timer interrupt signal.
应用本发明的优点在于通过计时装置的设计,数字计时模块可通过优先层级高于内部中断信号的计时中断信号,使单芯片模块优先处理计时事件。The advantage of applying the present invention is that through the design of the timing device, the digital timing module can use the timing interrupt signal with a higher priority level than the internal interrupt signal, so that the single chip module can process timing events first.
附图说明Description of drawings
图1为本发明一实施例中,一种计时装置的方框图;以及Fig. 1 is a block diagram of a timing device in an embodiment of the present invention; and
图2为本发明一实施例中,计时装置运行方法的流程图。Fig. 2 is a flow chart of the operation method of the timing device in an embodiment of the present invention.
符号说明Symbol Description
1:计时装置 10:单芯片模块1: Timing device 10: Single chip module
100:中央处理器 101:内部中断信号100: CPU 101: Internal interrupt signal
102:存储器 103:设定信号102: memory 103: setting signal
104:计时器 105:中断服务程序104: Timer 105: Interrupt Service Routine
106:输入输出界面 12:数字计时模块106: Input and output interface 12: Digital timing module
121:计时中断信号 200:计时装置运行方法121: Timing interruption signal 200: Timing device operation method
201-203:步骤201-203: Steps
具体实施方式Detailed ways
请参照图1。图1为本发明一实施例中,一种计时装置1的方框图。计时装置1包括:单芯片模块10以及数字计时模块12。Please refer to Figure 1. FIG. 1 is a block diagram of a timing device 1 in an embodiment of the present invention. The timing device 1 includes: a single chip module 10 and a digital timing module 12 .
单芯片模块10可为任何例如(但不限于)中央处理器100、存储器102、计时器104、各种输入输出界面106等都整合在一块集成电路芯片上的微型电脑。于一实施例中,中央处理器100可通过总线(未示出)和存储器102、计时器104及输入输出界面106相电性连接并进行沟通。于一实施例中,单芯片模块100为例如(但不限于)8051芯片。The single-chip module 10 can be any microcomputer such as (but not limited to) the central processing unit 100, the memory 102, the timer 104, various input and output interfaces 106, etc. are integrated on one integrated circuit chip. In one embodiment, the CPU 100 can be electrically connected and communicated with the memory 102 , the timer 104 and the I/O interface 106 through a bus (not shown). In one embodiment, the single-chip module 100 is, for example (but not limited to), an 8051 chip.
单芯片模块10可通过中央处理器100进行各种数据的处理及运算,并可依据内部中断信号101进行事件处理。举例而言,当输入输出界面106接收到需要处理的外部信号时,将产生内部中断信号101,并通过总线传送至中央处理器100。中央处理器100将暂时停止正在处理的数据,优先处理内部中断信号101的需求。The single-chip module 10 can process and calculate various data through the central processing unit 100 , and can process events according to the internal interrupt signal 101 . For example, when the I/O interface 106 receives an external signal that needs to be processed, it will generate an internal interrupt signal 101 and send it to the central processing unit 100 through the bus. The central processing unit 100 will temporarily stop the data being processed, and give priority to the demand of the internal interrupt signal 101 .
单芯片模块10所包含的电路可产生至少两种优先层级的内部中断信号101。于一实施例中,内部中断信号101可具有两个优先层级。因此,内部中断信号101将包含高优先层级的内部中断信号以及低优先层级的内部中断信号。The circuits included in the single-chip module 10 can generate internal interrupt signals 101 with at least two priority levels. In one embodiment, the internal interrupt signal 101 may have two priority levels. Therefore, the internal interrupt signal 101 includes a high-priority internal interrupt signal and a low-priority internal interrupt signal.
当拥有高优先层级的内部中断信号产生时,可以强制使另一个低优先层级的内部中断信号停止运行。而低优先层级的内部中断信号产生时,只能在没有任何内部中断信号运行的条件下,才可以由单芯片模块10执行。而对于执行中的高优先层级的内部中断信号,则没有任何低于或是相同优先层级的内部中断信号可以停止其运行。When an internal interrupt signal with a high priority level is generated, another internal interrupt signal with a low priority level can be forced to stop running. When an internal interrupt signal of a low priority level is generated, it can only be executed by the single-chip module 10 under the condition that no internal interrupt signal is running. As for an internal interrupt signal with a high priority level in execution, no internal interrupt signal with a lower or the same priority level can stop its operation.
数字计时模块12为设置于单芯片模块10外的数字计时电路,配置成进行计时。于一实施例中,单芯片模块10的中央处理器100还配置成通过例如(但不限于)设定信号103对数字计时模块12进行设定。The digital timing module 12 is a digital timing circuit arranged outside the single-chip module 10 and is configured to perform timing. In one embodiment, the central processing unit 100 of the single-chip module 10 is further configured to set the digital timing module 12 through, for example (but not limited to), the setting signal 103 .
于一实施例中,单芯片模块10设定数字计时模块12运行于例如(但不限于)自动重载(auto reload,自动载入)模式。亦即,数字计时模块12在计时的参数溢位(overflow)时,将自动归零。于一实施例中,在参数溢位时,对数字计时模块12来说是一个计时事件的发生。In one embodiment, the single-chip module 10 sets the digital timing module 12 to run in, for example (but not limited to), an auto reload (auto reload) mode. That is, the digital timing module 12 will automatically return to zero when the timing parameter overflows. In one embodiment, when the parameter overflows, it is a timing event for the digital timing module 12 .
于一实施例中,单芯片模块10可设定数字计时模块12的计时精度。In one embodiment, the single-chip module 10 can set the timing accuracy of the digital timing module 12 .
数字计时模块12在计时事件(例如但不限于上述参数溢位)发生时,产生计时中断信号121至单芯片模块10。更详细地说,数字计时模块12可产生计时中断信号121至单芯片模块10中的中央处理器100。其中,计时中断信号121的优先层级高于上述的两种内部中断信号,以使单芯片模块10于接收到计时中断信号121时,可优先处理执行对应计时中断信号121的中断服务程序105。The digital timing module 12 generates a timing interrupt signal 121 to the single-chip module 10 when a timing event (such as but not limited to the above-mentioned parameter overflow) occurs. In more detail, the digital timing module 12 can generate a timing interrupt signal 121 to the CPU 100 in the single-chip module 10 . The priority level of the timing interrupt signal 121 is higher than the above two internal interrupt signals, so that when the single-chip module 10 receives the timing interrupt signal 121, it can preferentially process and execute the interrupt service program 105 corresponding to the timing interrupt signal 121 .
于一实施例中,计时中断信号121为例如(但不限于)电源失效(power fail)中断信号。In one embodiment, the timing interrupt signal 121 is, for example (but not limited to), a power fail interrupt signal.
中断服务程序105可存储于例如(但不限于)存储器102中。于一实施例中,单芯片模块10执行中断服务程序105以对其内部的计时变数进行累加。于一实施例中,每当单芯片模块10接收到一次计时中断信号121,就执行中断服务程序105将计时变数加1,达到计时的技术效果。Interrupt service routine 105 may be stored in, for example, but not limited to, memory 102 . In one embodiment, the single-chip module 10 executes the interrupt service routine 105 to accumulate its internal timing variables. In one embodiment, whenever the single-chip module 10 receives a timing interrupt signal 121 , it executes the interrupt service program 105 to increase the timing variable by 1 to achieve the technical effect of timing.
由于单芯片模块10于现在的应用中,需要处理相当多种不同的事件,当内部中断信号的优先层级不足以区别更多类型的事件时,往往使得内部的计时器104无法以内部中断信号及时告知单芯片模块10计时事件的发生。因此,通过计时装置1的设计,数字计时模块12可通过优先层级高于内部中断信号的计时中断信号121,使单芯片模块10优先处理计时事件。Since the single-chip module 10 needs to handle quite a variety of different events in the current application, when the priority level of the internal interrupt signal is not enough to distinguish more types of events, the internal timer 104 is often unable to use the internal interrupt signal in time. Inform the single-chip module 10 of the occurrence of the timing event. Therefore, through the design of the timing device 1 , the digital timing module 12 can enable the single-chip module 10 to process timing events preferentially through the timing interrupt signal 121 with a higher priority level than the internal interrupt signal.
请参照图2。图2为本发明一实施例中,计时装置运行方法200的流程图。可应用于图1的计时装置1中。计时装置运行方法200包含下列步骤(应了解到,在本实施方式中所提及的步骤,除特别说明其顺序外,均可依实际需要调整其前后顺序,甚至可同时或部分同时执行)。Please refer to Figure 2. FIG. 2 is a flowchart of a timing device operating method 200 in an embodiment of the present invention. It can be applied to the timing device 1 of FIG. 1 . The timing device operating method 200 includes the following steps (it should be understood that, unless the order of the steps mentioned in this embodiment is specifically stated, the order of the steps can be adjusted according to actual needs, and can even be executed simultaneously or partially simultaneously).
于步骤201,使单芯片模块10根据内部的至少两个内部中断信号101进行事件处理。In step 201 , make the single-chip module 10 perform event processing according to at least two internal interrupt signals 101 .
于步骤202,使数字计时模块12进行计时,并于计时事件发生时,产生计时中断信号121至单芯片模块10,其中计时中断信号121的优先层级高于至少两个内部中断信号101。In step 202, the digital timing module 12 is enabled to perform timing, and when a timing event occurs, a timing interrupt signal 121 is generated to the single-chip module 10, wherein the priority level of the timing interrupt signal 121 is higher than at least two internal interrupt signals 101 .
于步骤203,使单芯片模块10于接收到计时中断信号121时优先处理执行对应计时中断信号121的中断服务程序105。In step 203 , when the single-chip module 10 receives the timing interrupt signal 121 , the interrupt service routine 105 corresponding to the timing interrupt signal 121 is preferentially processed and executed.
以上所述仅为本发明的优选实施例而已,并不用以限制本发明,凡在本发明的原则的内所作的任何修改、等同替换和改进等均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the principle of the present invention shall be included within the protection scope of the present invention.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810552772.4A CN110554979A (en) | 2018-05-31 | 2018-05-31 | time-piece device and method for operating same |
TW107129153A TWI681338B (en) | 2018-05-31 | 2018-08-21 | Timer apparatus and operation method of the same |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810552772.4A CN110554979A (en) | 2018-05-31 | 2018-05-31 | time-piece device and method for operating same |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110554979A true CN110554979A (en) | 2019-12-10 |
Family
ID=68734560
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810552772.4A Pending CN110554979A (en) | 2018-05-31 | 2018-05-31 | time-piece device and method for operating same |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110554979A (en) |
TW (1) | TWI681338B (en) |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020089881A1 (en) * | 1999-09-30 | 2002-07-11 | Hitachi Ltd. | High speed semiconductor memory device with short word line switching time |
CN1737766A (en) * | 2005-08-31 | 2006-02-22 | 上海海尔集成电路有限公司 | Interrupt system realizing method |
CN101196836A (en) * | 2007-12-29 | 2008-06-11 | 上海华为技术有限公司 | Method and device for controlling reset of watchdog circuit |
CN101221518A (en) * | 2008-01-29 | 2008-07-16 | 福建星网锐捷网络有限公司 | Method, device and system for preventing timing device overflow of hardware watchdog |
CN101859260A (en) * | 2010-05-14 | 2010-10-13 | 中国科学院计算技术研究所 | Timer management device and management method used in operating system |
CN101964724A (en) * | 2010-08-30 | 2011-02-02 | 华为技术有限公司 | Energy conservation method of communication single plate and communication single plate |
CN102012881A (en) * | 2010-11-29 | 2011-04-13 | 杭州中天微系统有限公司 | Bus monitor-based system chip bus priority dynamic configuration device |
CN203243019U (en) * | 2012-11-26 | 2013-10-16 | 浙江金美电动工具有限公司 | Power-off protector |
CN104062896A (en) * | 2014-06-24 | 2014-09-24 | 北京航天自动控制研究所 | Synchronization signal periodic control redundancy realization method |
CN104281217A (en) * | 2013-07-11 | 2015-01-14 | 瑞萨电子株式会社 | Microcomputer |
CN104915254A (en) * | 2014-12-31 | 2015-09-16 | 杰瑞石油天然气工程有限公司 | Embedded system multi-task scheduling method and system |
CN107251001A (en) * | 2015-03-06 | 2017-10-13 | 密克罗奇普技术公司 | Microcontroller or microprocessor with double mode interruption |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW200521855A (en) * | 2003-12-19 | 2005-07-01 | Kinpo Elect Inc | Timing interrupt service method |
US20120271968A1 (en) * | 2011-04-21 | 2012-10-25 | Microchip Technology Incorporated | Logic device for combining various interrupt sources into a single interrupt source and various signal sources to control drive strength |
KR102168987B1 (en) * | 2012-10-17 | 2020-10-22 | 가부시키가이샤 한도오따이 에네루기 켄큐쇼 | Microcontroller and method for manufacturing the same |
-
2018
- 2018-05-31 CN CN201810552772.4A patent/CN110554979A/en active Pending
- 2018-08-21 TW TW107129153A patent/TWI681338B/en active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020089881A1 (en) * | 1999-09-30 | 2002-07-11 | Hitachi Ltd. | High speed semiconductor memory device with short word line switching time |
CN1737766A (en) * | 2005-08-31 | 2006-02-22 | 上海海尔集成电路有限公司 | Interrupt system realizing method |
CN101196836A (en) * | 2007-12-29 | 2008-06-11 | 上海华为技术有限公司 | Method and device for controlling reset of watchdog circuit |
CN101221518A (en) * | 2008-01-29 | 2008-07-16 | 福建星网锐捷网络有限公司 | Method, device and system for preventing timing device overflow of hardware watchdog |
CN101859260A (en) * | 2010-05-14 | 2010-10-13 | 中国科学院计算技术研究所 | Timer management device and management method used in operating system |
CN101964724A (en) * | 2010-08-30 | 2011-02-02 | 华为技术有限公司 | Energy conservation method of communication single plate and communication single plate |
CN102012881A (en) * | 2010-11-29 | 2011-04-13 | 杭州中天微系统有限公司 | Bus monitor-based system chip bus priority dynamic configuration device |
CN203243019U (en) * | 2012-11-26 | 2013-10-16 | 浙江金美电动工具有限公司 | Power-off protector |
CN104281217A (en) * | 2013-07-11 | 2015-01-14 | 瑞萨电子株式会社 | Microcomputer |
CN104062896A (en) * | 2014-06-24 | 2014-09-24 | 北京航天自动控制研究所 | Synchronization signal periodic control redundancy realization method |
CN104915254A (en) * | 2014-12-31 | 2015-09-16 | 杰瑞石油天然气工程有限公司 | Embedded system multi-task scheduling method and system |
CN107251001A (en) * | 2015-03-06 | 2017-10-13 | 密克罗奇普技术公司 | Microcontroller or microprocessor with double mode interruption |
Also Published As
Publication number | Publication date |
---|---|
TWI681338B (en) | 2020-01-01 |
TW202004498A (en) | 2020-01-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022007414A1 (en) | Server fan control device and method based on control chip | |
CN107133119A (en) | A kind of method that hardware watchdog function is realized by CPLD | |
US20080297233A1 (en) | Semiconductor integrated circuit | |
CN102478940A (en) | A control circuit for computer system multiplexing pins | |
CN112115047A (en) | Delay testing method and system for hard real-time operating system | |
US8761332B2 (en) | Dynamic prescaling counters | |
JP2025515469A (en) | Data transmission method, data transmission device, storage medium, and electronic device | |
CN109029761B (en) | Multi-threshold temperature sensor switch device and control method thereof | |
WO2015188690A1 (en) | Adaptive voltage adjustment circuit and chip | |
CN110554979A (en) | time-piece device and method for operating same | |
CN107506281A (en) | A kind of multiple power supplies monitoring system and method | |
JP2004521346A (en) | Method for monitoring the voltage supply of a control device in a motor vehicle | |
TWI868777B (en) | Controller for power supply device | |
CN112416444A (en) | Board switching control method, device, equipment and medium | |
CN107480331A (en) | Modeling method and device of semiconductor device statistical model | |
CN101221456A (en) | Electronic device | |
CN114817212A (en) | A kind of database optimization method and optimization device | |
US9509633B2 (en) | Multi-switching device and multi-switching method thereof | |
CN111095780B (en) | Motor control device, control method for motor control device, control program, and recording medium | |
TWI637177B (en) | System and method for testing semiconductor elements | |
CN110888691A (en) | Controller starting method and device | |
KR20190070862A (en) | Semiconductor device | |
CN114384970B (en) | A timer control method and related equipment | |
CN108446204B (en) | Chip and electronic equipment | |
CN107230490A (en) | memory device and reset method thereof |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20191210 |