POWER MEASURING APPARATUS AND OPERATING METHOD THEREOF

There are provided a power measuring apparatus capable of accurately obtaining metering information and being manufactured at low cost by storing the metering information in an internal flash memory and an operating method thereof. The power measuring apparatus includes: a controlling unit controlling processing of consumed power metering information; a flash memory storing the metering information according to the controlling of the controlling unit and storing an operating program with respect to the processing of the metering information; and a random access memory providing a substitution program substituting the operating program while the metering information is stored in a specific address of the flash memory.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Throughout the drawings, the same or like reference numerals will be used to designate the same or like elements.

FIG. 1is a schematic block diagram of a power measuring apparatus according to an embodiment of the present invention andFIG. 2is an enlarged block diagram of certain blocks of the power measuring apparatus according to the embodiment of the present invention.

Referring toFIG. 1, a power measuring apparatus100according to the embodiment of the present invention may include a micro-controller A performing an operation of the power measuring apparatus, and the micro-controller A may have a keypad, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Ferroelectric Random Access Memory (FRAM), a liquid crystal display (LCD), or the like, connected to a periphery thereof. A power source, power, communications, and the like to be measured may be provided to the micro-controller A, and an external interrupt may also be delivered to the micro-controller A.

The micro-controller A may include an analog to digital converter (ADC) converting an analog signal from the power source to be measured into a digital signal, a controlling unit110, a random access memory (RAM)120, a flash memory130, a measuring unit140having a metering algorithm containing metering information, peripherals for data communications and display, and the like.

Referring toFIGS. 1 and 2, the controlling unit110may perform a control with respect to a general metering operation of the power measuring apparatus and an operating program with respect to the control may be provided from the flash memory130or the random access memory120.

The flash memory130may include a metering calculation region in which the measured metering information is calculated, an operating program region in which the operating program is stored, an interrupt service routine region providing a corresponding service routine when a preset internal interrupt is generated, and a data region providing a data storage address. Here, the preset internal interrupt may refer to an interrupt, the generation time of which may be predicted.

The random access memory120may store a substitution program substituting the operating program and may provide a corresponding service routine in the case in which the generated interrupt is a non-preset external interrupt. Here, the non-preset external interrupt may refer to an interrupt, the generation time of which may not be predicted.

FIG. 3is a flowchart showing an order of operations of the power measuring apparatus according to the embodiment of the present invention.

Referring toFIGS. 2 and 3, first, when the operation of the power measuring apparatus100starts, respective set values may be initialized (S10).

Thereafter, initialized system information may be displayed (S20), the power source to be measured input to the power measuring apparatus100may be converted into a digital signal through the ADC, and the measuring unit may measure an amount of consumed power based on the converted digital signal. In this case, the flash memory130may perform a metering calculation on the measured power amount (S30).

Finally, the metering information by the calculation may be stored in the flash memory130(S40).

Meanwhile, the interrupt may be generated while the metering information is stored in a specific address of the flash memory130. In the case in which the generated interrupt is an internal interrupt, the generation time of which is predicted in advance, the flash memory130may store an interrupt service routine with respect to the preset internal interrupt so as not to be interrupted in storing the metering information in the specific address to thereby provide a corresponding interrupt service routine.

On the other hand, in the case in which the generated interrupt is an external interrupt, the generation time of which is not predicted, the random access memory120may provide a corresponding interrupt service routine among the stored interrupt service routines.

For example, a time necessary for storing the metering information in the specific address of the flash memory130is in a range from tens of milliseconds to hundreds of milliseconds. When a non-preset interrupt instructing a storage of 128 bytes of data is generated, a large amount of data may be lost and it is likely that an error will be generated. In this case, in the case in which the controlling unit110controls the random access memory120to indicate an interrupt service routine address with respect to the corresponding external interrupt, the non-preset interrupt instructing the storage of 128 bytes of data maybe implemented by storing the data without data loss.

FIGS. 4A through 4Care diagrams showing stable operations of the power measuring apparatus according to the embodiment of the present invention.

FIG. 4Ais an image received from the power measuring apparatus when 2044 bytes of data is interrupted in the case in which there is no operation of using a specific sector of the flash memory130. In the case in which there is no operation of using a specific sector, it may be appreciated that no data loss is generated and the 2044 bytes of data is accurately received.

On the other hand,FIG. 4Bis an image received from the power measuring apparatus when the 2044 bytes of data is interrupted during an operation of erasing a specific sector of the flash memory130. In the case in which the interrupt is generated during the operation of using the specific sector, an amount of data received is 1596 bytes. Therefore, it may be appreciated that a large amount of data loss may be generated, as compared to 2044 bytes of raw data.

Finally, as shown inFIG. 4C, in the case in which the 2044 bytes of data is interrupted during the operation of erasing a specific sector of the flash memory130, the controlling unit110controls the random access memory120to indicate the corresponding interrupt service routine address, and the 2044 bytes of data may be received by the power measuring apparatus without data loss due to the corresponding interrupt service routine.

As set forth above, a power measuring apparatus according to the embodiments of the invention may accurately obtain metering information and may be manufactured at low cost by storing the metering information in an internal flash memory to decrease the possibility of the occurrence of malfunctions.