1. Field of the Invention
The present invention relates to a method of interrupt control and an electronic system using the same, and more particularly, to a method of interrupt control and an electronic system capable of assisting a host to receive data.
2. Description of the Prior Art
With advancements in technology, various electronic devices such as mobile phones, GPS navigator systems, tablets, personal digital assistants (PDA) and laptops have become indispensable in our daily life. A standard electronic system comprises a core processor such as a central processing unit (CPU), a microprocessor or a micro control unit (MCU). The core processor is utilized for managing and co-ordinating operations of every device in the electronic system. Since most devices need the processor to perform data processing, the load of the processor is heavy. If the processor performance is poor or a large number of tasks suddenly arrive, the processor may not be able to accomplish all tasks in time, resulting in a bottleneck in system performance.
The industry has taken a lot of effort to enhance the performance of electronic systems by developing more powerful processors as well as reducing their load. If powerful dual-core or quad-core processors are utilized, costs will increase without any guarantee that the performance can be respectively doubled or quadrupled. Other methods to reduce the processor load have therefore been developed, of which one is the interrupt control method. In the interrupt control method, an interrupt signal is sent to the processor only when there is a task to be executed in a device. Upon receiving the interrupt signal, the processor allocates resources to execute said tasks. In such a situation, the processor may not need to keep detecting the operations of every device; instead, the processor only allocates resources to a specific device after receiving the interrupt signal from the device. The load of the processor will thereby be significantly reduced. Current methods of sending interrupt signals, however, cannot effectively and accurately send interrupt signals when a task needs to be executed in the device.
It is therefore an objective of the present invention to provide a method of interrupt control and an electronic system using the same, which is capable of controlling an electronic device of the electronic system to effectively and accurately send interrupt signals, in order to enhance the efficiency of a processor of the electronic system.
The present invention discloses a method of interrupt control for an electronic system. The electronic system comprises a host and an electronic device. The method comprises receiving digital data generated by the electronic device; determining a value of the digital data and dividing a possible range of the value of the digital data into a plurality of regions; and sending an interrupt signal to the host when the value of the digital data changes from a first region among the plurality of regions to a second region among the plurality of regions and remains within the second region for a specific period of time.
The present invention further discloses an electronic system. The electronic system comprises a host; an electronic device, for generating digital data; and a control unit. The control unit has a program executed by a processor for performing a method of interrupt control, wherein the method comprises receiving the digital data generated by the electronic device; determining a value of the digital data and dividing a possible range of the value of the digital data into a plurality of regions; and sending an interrupt signal to the host when the value of the digital data changes from a first region among the plurality of regions to a second region among the plurality of regions and remains within the second region for a specific period of time.
The present invention further discloses a method of interrupt control for an electronic system. The electronic system comprises a host and an electronic device. The method comprises receiving digital data generated by the electronic device; determining a value of the digital data and dividing a possible range of the value of the digital data into a plurality of regions; classifying the plurality of regions into a first group and a second group; sending an interrupt signal to the host when the value of the digital data is located in a first region among the plurality of regions in the first group and remains within the first region for each specific period of time; and not sending the interrupt signal to the host when the value of the digital data is located in a second region among the plurality of regions in the second group.
The present invention further discloses an electronic system. The electronic system comprises a host; an electronic device, for generating digital data; and a control unit. The control unit has a program executed by a processor for performing a method of interrupt control, wherein the method comprises receiving the digital data generated by the electronic device; determining a value of the digital data and dividing a possible range of the value of the digital data into a plurality of regions; classifying the plurality of regions into a first group and a second group; sending an interrupt signal to the host when the value of the digital data is located in a first region among the plurality of regions in the first group and remains within the first region for each specific period of time; and not sending the interrupt signal to the host when the value of the digital data is located in a second region among the plurality of regions in the second group.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
As mentioned above, current methods of sending interrupt signals cannot effectively and accurately send the interrupt signals when a task needs to be executed in the device. Please refer to
Please refer to
Please note that the abovementioned signal transmitting interface 208 and I/O interface 210 are utilized for performing connections and signal transmissions between each device. The implementation illustrated in
In detail, the control unit 206 may have a program 220, which is executed by a processor inside the control unit 206, in order to perform an interrupt control method. The interrupt control method of the present invention can be utilized for controlling the timing of sending the interrupt signals and preventing the interrupt signals from being sent erroneously due to noise interference, so that the host 202 can efficiently obtain the output data of the electronic device 204. This further reduces the load and enhances the efficiency of the host 202.
Please refer to
Please note that the threshold value and the number of regions may be determined according to system requirements and are not limited herein. The range of each region may be equal or unequal to each other, and this should also be determined according to system requirements. In general, the main purpose of dividing the value of the digital data into a plurality of regions and sending an interrupt signal when the value crosses different regions is to notify the host 202 to receive output data when the value undergoes an evident change so that corresponding tasks have to be executed. When the value remains in the same region, the value undergoes no evident change and the host 202 does not need to waste resources on receiving the output data. The control unit 206 may set the threshold value to differentiate whether the digital data undergoes an evident change. As a result, the host 202 may efficiently obtain the output data of the electronic device 204, and thereby reduce the load of the host 202.
In some embodiments, the control unit 206 is triggered to send an interrupt signal after the value of the digital data crosses a threshold value and further remains within a region for a specific period of time, in order to prevent the control unit 206 from erroneously sending interrupt signals due to noise interference. In such embodiments, the control unit 206 does not send the interrupt signal at the time when the value of the digital data crosses the threshold value; instead, after the value of the digital data crosses the threshold value, the control unit 206 determines whether the value of the digital data remains within the same region over a subsequent period of time. For example, when the value of the digital data changes from a region R_b across a threshold value to a region R_c, the control unit 206 may start to count time and monitor the value of the digital data. If the value of the digital data remains within the region R_c over a subsequent period of time, the control unit 206 may determine that the above change of the digital data's value from the region R_b across the threshold value to the region R_c is not generated by noise interference. The control unit 206 therefore sends an interrupt signal to the host 202 in order to notify the host 202 to receive data. If the value of the digital data returns to the region R_b within a short time, the control unit 206 may determine that the above change of the digital data's value from the region R_b across the threshold value to the region R_c is generated by noise interference. The control unit 206 therefore does not send any interrupt signal to the host 202. Erroneous sending of interrupt signals due to noise interference may thereby be prevented.
Please refer to
Please keep referring to
In the above embodiment, each time the value of the digital data crosses different regions, the control unit 206 may send an interrupt signal to the host 202 in order to notify the host 202 to receive the output data corresponding to the digital data, or check whether the value of the digital data remains within the destination region to determine whether to send the interrupt signal. In another embodiment, the interrupt signal sending policy may be executed by other ways. Please refer to
As shown in
In this embodiment, the division of N regions R_1-R_N is similar to the embodiment in
It is noticeable that the regions R_1-R_N mentioned above may be classified into the groups G1 and G2 by any methods, and these may be determined according to system requirements. In another embodiment, the control unit 206 may be controlled not to send any interrupt signal when the value of the digital data D enters a region located in the group G1 and to send an interrupt signal when the digital data D enters a region located in the group G2 and remains within the region, wherein the classification method may be determined according to system requirements; this is not limited herein. As mentioned above, the purpose of sending interrupt signals to the host 202 is to notify the host 202 to receive the output data of the electronic device 204. In general, the host 202 may not need to be notified when the value of the digital data D enters each region; instead, only when the value of the digital data D enters some specific regions should the host 202 be notified to receive the output data. These specific regions can therefore be classified into the group G1, and other regions are classified into the group G2. Via such a classification method, the determination of regions will be more flexible and can also be adapted to different requirements of sending interrupt signals. For example, if the frequency of sending interrupt signals needs to be reduced, more regions may be classified into the group G2 and fewer regions may be classified into the group G1. The control unit 206 sends an interrupt signal only when the value of the digital data D enters a region of the group G1 or keeps located in a region of the group G1. As a result, the system may be adaptive to various interrupt signal sending requirements without changing the method for region division.
The above method of sending interrupt signals based on region classification may also be immune to erroneous sending due to noise interference. For example, in
Please note that the control unit of the present invention is capable of accurately sending the interrupt signals to the host while preventing noise interference from causing the interrupt signals to be sent erroneously. Those skilled in the art can make modifications and alternations accordingly. For example, the abovementioned threshold values TH_1-TH_(N−1) may be defined as proper values according to system requirements, which allows the control unit 206 to send interrupt signals to the host 202 only when the value of the digital data D meets sending requirements. The length of the specific period P1 or P2 may also be set to a proper value, so that the control unit 206 may determine whether the change of the digital data's value is generated by noise interference or actual change of the value, in order to accurately send the interrupt signal. The electronic device 204 may be any devices in the electronic system 20 that can be controlled by the host 202, which should not be limited to particular types or those devices which have particular functions. In other words, any peripheral devices managed by the host 202 may utilize the abovementioned methods of sending interrupt signals to prevent noise interference from causing the signals to be sent erroneously. Therefore, the host 202 may not need to keep detecting operations of every device; instead, the host 202 may allocate resources to process tasks in the specific device only when receiving the interrupt signals.
For example, in an embodiment, the electronic device 204 may be a light sensor, and the digital data may be related to a sensing result of ambient lights. The host 202 may not need to keep receiving the data sensed by the light sensor; instead, after the light sensor obtains the sensing result, the sensing result is transmitted to the control unit 206. The control unit 206 then determines when to start sending the interrupt signals according to the value of the sensing result, e.g. defining an effective sensing result to be a change across a threshold value TH_z to a region R_z and remaining within the region R_z for a specific period P3. When the effective sensing result is detected, the control unit 206 may start to send the interrupt signal to the host 202, in order to notify the host 202 to receive data.
The above operations related to the method of sending interrupt signals can be summarized into an interrupt signal sending process 60, as shown in
Step 600: Start.
Step 602: Receive digital data D generated by the electronic device 204.
Step 604: Determine the value of the digital data D and divide a possible range of the value of the digital data D into regions R_1-R_N.
Step 606: Send an interrupt signal to the host 202 when the value of the digital data D changes from a region R_x among the regions R_1-R_N to another region R_(x+1) among the regions R_1-R_N and remains within the region R_(x+1) for a specific period of time P1.
Step 608: End.
The operations and variations of the interrupt signal sending process 60 have been detailed above, and will not be narrated hereafter.
In another embodiment, the regions R_1-R_N may further be divided into the groups G1 and G2. Detailed operations related to the method of sending interrupt signals based on region classification can be summarized into another interrupt signal sending process 70, as shown in
Step 700: Start.
Step 702: Receive digital data D generated by the electronic device 204.
Step 704: Determine the value of the digital data D and divide a possible range of the value of the digital data D into regions R_1-R_N.
Step 706: Classify the regions R_1-R_N into groups G1 and G2.
Step 708: Send an interrupt signal to the host 202 when the value of the digital data D is located in a region R_(y+1) among the regions R_1-R_N in the group G1 and remains within the region R_(y+1) for each specific period of time P2.
Step 710: Not send the interrupt signal to the host 202 when the value of the digital data D is located in a region R_(y+2) among the regions R_1-R_N in the group G2.
Step 712: End.
The operations and variations of the interrupt signal sending process 70 have been detailed above, and will not be narrated hereafter.
In the prior art, conventional methods of sending interrupt signals cannot effectively and accurately send interrupt signals when a task needs to be executed in the device. If noise occurs, the noise may cause the device to erroneously send interrupt signals, or an interrupt signal may need to be sent but is not sent due to the noise interference. In comparison, the interrupt control method and electronic system of the present invention applies region division to send an interrupt signal when the value of the digital data undergoes evident change across different regions or keeps within specific regions. This method is able to effectively and accurately send the interrupt signals so that efficiency of the host is enhanced.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
201310501008.1 | Oct 2013 | CN | national |
This application claims the benefit of U.S. Provisional Application No. 61/817,306, which was filed on Apr. 29, 2013 and titled “3D-Motion Gesture/Proximity Detection Module Sensor (MGPS)”, the contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61817306 | Apr 2013 | US |