Abstract:
An analogue to digital converter has a settable trigger level that generates an interrupt signal for a CPU when a trigger condition is fulfilled.

Description:
FIELD OF THE INVENTION  
         [0001]    The present invention relates to analogue to digital signal conversion, and in particular to A to D converters for use in portable electronic devices.  
         BACKGROUND OF THE INVENTION  
         [0002]    Many portable electronic devices require monitoring of analogue signals by the central processing unit (CPU) of the device, for example to detect predetermined changes in those signals to trigger actions or to control characteristics of the device. Accordingly, as is well known, it is necessary to convert the analogue signal to a digital signal for use by the CPU. FIG. 1 shows schematically a device including a CPU  1  and an analogue to digital converter ADC  2 . In previously considered solutions, the A to D converter  2  is provided by an analogue ASIC (application specific integrated circuit) which is controlled by the CPU  1 . When the CPU  1  requires determination of the level of an analogue signal, then the CPU controls the ADC  2  so that an analogue input signal  3  is converted to a digital output signal  4 . This requires CPU activity, and can therefore increase the power consumed by the CPU. Such a solution also has an impact on time critical processes since the CPU is required to await the output from the ADC  2  before continuing.  
           [0003]    In complex systems there are many signals to monitor, some of them change quickly and others slowly. In slowly-changing and steady state signals, there will be many unnecessary A to D conversions, and hence unnecessary increased CPU activity, since for a quick CPU reaction time the frequency of sampling the signal must be increased. In addition, when a signal passes a threshold level there is time lost between the passing of the threshold level and the activation of the ADC by the CPU. This reaction time is naturally dependent upon the sampling frequency of the CPU software.  
           [0004]    U.S. Pat. No. 5,731,806 describes an analogue to digital converter for use with a joystick for a computer or computer games system. In such a system, the previous joystick position is compared with the current joystick position. The position of the joystick is indicated by analogue signals converted to respective digital signals, and when the difference between the two positions exceeds a predetermined value, the joystick logic outputs an interrupt to the CPU. The comparison is performed each time the CPU issues a signal requiring an indication from the joystick of movement of that joystick. Accordingly, such a system does not overcome the problem associated with portable electronic devices, namely the increased power consumption of increasing CPU usage, since CPU usage is not reduced to an absolute minimum. In addition, such a device does not measure absolute values, but rather merely measures differences between signals for comparison with a threshold value. Furthermore, there is no provision for triggering on positive or negative edges, since only signal magnitude is considered.  
         SUMMARY OF THE PRESENT INVENTION  
         [0005]    It is emphasised that the use of the term “comprises” or “comprising” in this specification is taken to specify the presence of stated features, integers, steps or components, but does not preclude the inclusion of one or more additional features, integers, steps or components, or groups thereof.  
           [0006]    According to one aspect of the present invention, there is provided a portable electronic device comprising a control unit and an analogue to digital conversion apparatus, wherein the conversion apparatus comprises:  
           [0007]    an A to D converter device operable to convert an analogue input signal to a digital output signal;  
           [0008]    a threshold register operable to store a digital threshold value;  
           [0009]    a comparator device operable to compare the digital output value with the stored digital threshold value to produce a comparison signal, and operable to produce an interrupt signal for transfer to the control unit in dependence upon the comparison signal; and a storage device operable to store the digital output signal.  
           [0010]    According to another aspect of the present invention, there is provided a portable electronic device comprising a control unit and an analogue to digital conversion apparatus, wherein the conversion apparatus comprises:  
           [0011]    an A to D converter device operable to convert an analogue input signal to a digital output signal;  
           [0012]    a threshold register operable to store a digital threshold value; and  
           [0013]    a comparator device operable to compare the digital output value with the stored digital threshold value to produce a comparison signal, and operable to produce an interrupt signal for transfer to the controller in dependence upon the comparison signal.  
           [0014]    According to another aspect of the present invention, there is provided a method of monitoring an analogue signal in a portable electronic device comprising a control unit and an analogue to digital converter unit, the method comprising:  
           [0015]    using the analogue to digital converter:  
           [0016]    receiving an input analogue signal;  
           [0017]    converting the input analogue signal to an output analogue signal;  
           [0018]    comparing the output digital value with a threshold value; and  
           [0019]    sending an interrupt signal to the control unit in dependence upon the result of the comparison. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0020]    [0020]FIG. 1 is a schematic diagram showing the prior art A to D converter apparatus; and  
         [0021]    [0021]FIG. 2 is a schematic diagram of an embodiment of the present invention. 
     
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT  
       [0022]    [0022]FIG. 2 illustrates an analogue to digital converter apparatus embodying the present invention and comprising a CPU  5 , an A to D converter ADC  6 , a comparator  7  and a threshold storage device  8 . The apparatus shown in FIG. 2 is suitable for monitoring an analogue input signal  11 . The analogue input signal  11  is supplied to the ADC  6  which operates continuously to convert the analogue signal to a digital signal  12 . The digital signal  12  is compared by the comparator  7  with a threshold value stored in the threshold storage device  8 . The comparator operates to produce an interrupt request IRQ  9  for supply to the CPU  5  when the digital value  12  meets the threshold criterion determined by the threshold value  8 . The threshold value  8  can be programmed by the CPU  5 .  
         [0023]    Such an apparatus can reduce the amount of CPU activity to monitor an analogue signal, since the CPU is only used when the analogue signal meets the threshold criterion. This can also promote faster reaction time, since the IRQ  9  is produced as soon as threshold criterion is fulfilled. The handling of the IRQ can be determined by the software controlling the CPU, and so the device in which the system is installed can react appropriately. Lower CPU activity leads to lower power consumption, and lower unnecessary CPU activity means that a higher proportion of the CPU&#39;s time can be spent on time critical applications.  
         [0024]    The criterion for determining production of the IRQ  9  can simply be that the digital signal  12  exceeds the threshold value. Alternatively, the threshold value could be a lower value that triggers an IRQ  9  when the digital signal drops below the value. Instead of simply setting a threshold value for comparison with the digital signal  12 , it is possible to determine the slope of the digital signal  12  (and the analogue signal  11 ) whilst passing a threshold value so that it may be determined whether the analogue signal is rising or falling.  
         [0025]    Also illustrated in FIG. 2 is a storage device  14 . This is provided in a preferred embodiment of the invention for storing the digital output value which is compared with the threshold value. Preferably, the actual digital value that causes an interrupt to be produced is stored in the storage device  14 . The value that is stored in the device  14  is accessible by the control unit. The storing of the value that causes the interrupt enables the CPU to analyses the cause of the interrupt. For example it is possible that a momentary change in value (or “glitch”) may occur that causes an interrupt to be produced, but does not in fact indicate the occurrence of a genuine interrupt condition.  
         [0026]    A converter embodying the present invention can have several uses in a portable device. For example, when charging the battery of the device, it is possible to interrupt the CPU only when the required voltage or current value is reached. Monitoring of the battery presence and/or level can be achieved; the converter can keep track of different battery levels to manage battery consumption or measure remaining capacity of the battery. He threshold value could then indicate a battery threshold value such as state of charge that causes an interrupt condition to be caused. For example, the threshold value may indicate when the battery is at full charge, or when the battery is at an undesirably low charge.  
         [0027]    Temperature monitoring, and in particular alarm condition monitoring, can be easily achieved with low CPU intervention. In the case of temperature monitoring, a threshold temperature value, for example indicating a high operating temperature, can be used as the basis of the comparison with the input temperature value.  
         [0028]    In addition, such a converter can be used to detect connection of accessories to the device, simply by monitoring connection line levels and comparing these to threshold levels. It is desirable that different accessories have different line levels associated with them. In this way it is possible to determine the identity of the accessory that is connected to the device. Furthermore, and particularly when more than one accessory is connected, it is possible to differentiate between different types of control signals depending upon the level of the signals. Ths then allows the provision of analogue and control signals on a single line.  
         [0029]    It will be appreciated that any portable electronic device could make use of a converter embodying the present invention. For example, mobile telephones and personal digital assistants (PDAs) could make use of the present invention.