Digital signal demodulation method, consumable chip and consumable container
Technical Field
The invention relates to the technical field of electronic imaging, in particular to a digital signal demodulation method, a consumable chip for realizing the method and a consumable container.
Background
The electronic imaging device is used as common office equipment, great convenience is provided for modern office, the common electronic imaging device comprises a printer, a copying machine and the like, the existing printer is divided into an inkjet printer and a laser printer, and the inkjet printer uses an ink box containing ink as a consumable container to jet the ink to paper so as to form characters or patterns to be printed on the paper; the laser printer uses a toner cartridge containing toner as a consumable container to form text or patterns on the media to be printed.
Referring to fig. 1, the existing toner cartridge has a housing 11, the housing 11 encloses a cavity for accommodating toner, a chip mounting location 12 is disposed on an outer wall of the housing, and a chip 13 is mounted on the chip mounting location 12. Similar to the chip of the cartridge, the chip 13 of the cartridge has a substrate on which electrical contacts 14 are provided as a communication unit for data exchange with the laser printer. The other side of the substrate is provided with an electronic module electrically connected to the electrical contacts 14, and the electronic module is also provided with a control unit, a nonvolatile memory, a volatile memory, a power supply unit, and the like.
Typically, the cartridge uses two electrical contacts 14 on the chip 13. Since the laser printer needs to supply power to the electronic module and transmit data, one of the electrical contacts 14 is a ground contact and the other electrical contact 14 needs to both receive power and transmit data, i.e., power and data are transmitted on the same signal line.
Referring to fig. 2, after analog-to-digital conversion of the analog signal received by the electrical contact 14, the obtained signal is shown in fig. 2 (a), which is a signal modulated by a carrier wave, and the electronic module rectifies the digital signal on the one hand to obtain a rectified signal shown in fig. 2 (b), and the rectified signal is used to supply power to each device of the electronic module, for example, to a memory or the like. On the other hand, the electronic module demodulates the digital signal to obtain a demodulated signal as shown in fig. 2 (c), and typically, the digital signal is compared with a preset level, if the level of the digital signal is higher than the preset level, the digital signal is confirmed to be high, and if the level of the digital signal is lower than the preset level, the digital signal is confirmed to be low. The mode is usually regulated by using a triode or an operational amplifier, and has the advantages of lower absolute value requirement on the level, adaptability to various voltage amplitudes, complex circuit and poor waveform quality after demodulation.
The existing chip directly converts the signal level by using an analog-to-digital conversion module of the embedded processor, and the method has the advantages of simple circuit structure, but the data after analog-to-digital conversion needs to be compared with a fixed level, so that a demodulated signal is obtained. However, since communication between the laser printer and the consumable chip is easily affected, the signal level after analog-to-digital conversion is unstable, and a change in level may occur.
As shown in fig. 3, in the case of fig. 3 (a), the level amplitude of the digital signal is high as a whole, but in the case where the communication signal is affected, the level amplitude of the digital signal may be changed as a whole, as shown in fig. 3 (b), however, in a period in which the level amplitude of the digital signal is changed, as shown in fig. 3 (c), even the high level signal has a low voltage amplitude in the former period, and even the low level signal has a high voltage amplitude in the latter period. If a fixed level signal is used as a result of the comparison at the time of demodulation, it is liable that the demodulation result of the digital signal is recognized as all low levels in a period in which the level signal is low, and the demodulation result of the digital signal is recognized as all high levels in a period in which the level signal is high, which is not the same as the actual situation.
Disclosure of Invention
In order to solve the above-described problems, a first object of the present invention is to provide a digital signal demodulation method capable of accurately demodulating a digital signal.
The second object of the present invention is to provide a consumable chip for implementing the above digital signal demodulation method.
A third object of the present invention is to provide a consumable container using the above consumable chip.
In order to achieve the first object of the present invention, the present invention provides a digital signal demodulation method comprising: acquiring a current digital signal, acquiring a digital signal recorded in the previous time period, and comparing the level value of the current digital signal with the level value of a corresponding comparison digital signal in the previous time period; if the level value of the current digital signal is greater than the level value of the comparison digital signal, further judging whether the difference value between the level value of the current digital signal and the level value of the comparison digital signal is greater than a first threshold value, if so, confirming that the current digital signal is a high level signal, otherwise, taking the level signal of the comparison digital signal as the level signal of the current digital signal; if the level value of the current digital signal is smaller than the level value of the comparison digital signal, further judging whether the difference value between the level value of the comparison digital signal and the level value of the current digital signal is larger than a second threshold value, if so, confirming that the current digital signal is a low level signal, otherwise, taking the level signal of the comparison digital signal as the level signal of the current digital signal.
As can be seen from the above-mentioned scheme, when demodulating the digital signal, instead of setting a fixed level, the level of the current digital signal is compared with the level of the corresponding digital signal in the previous period, so as to determine whether the current digital signal is a high level or a low level signal. Thus, even if the whole amplitude of the digital signal is changed, the high level and the low level of the digital signal are not affected, and the accuracy of demodulating the digital signal can be improved.
In a preferred embodiment, the previous period is a period of a digital signal, or the previous period is a plurality of periods of the digital signal, and the comparison digital signal is a digital signal with a corresponding serial number in the previous period.
It can be seen that the time period of the previous time period is very short, and can be one digital signal period or a plurality of digital signal periods, so that the condition of inaccurate demodulation caused by overlong time period of the previous time period can be avoided.
Further, if the level value of the current digital signal is equal to the level value of the comparison digital signal, the level signal of the comparison digital signal is used as the level signal of the current digital signal.
It can be seen that if the level value of the current digital signal is equal to the level value of the comparison digital signal, the level of the digital signal remains stable for a period of time, and the level signal of the comparison digital signal is directly used as the level signal of the current digital signal, so that the calculation amount of demodulation can be saved.
Further, the first threshold value is equal to the second threshold value.
Alternatively, the first threshold is half of the amplitude of the preset level; and/or the second threshold is half the magnitude of the preset level.
Therefore, the first threshold value and the second threshold value are set to be half of the amplitude of the preset level, namely half of the amplitude of the high-level signal and the low-level signal under normal conditions, so that the high level and the low level of the digital signal can be accurately identified.
In order to achieve the second object, the consumable chip provided by the invention comprises a substrate, wherein an electronic module is arranged on the substrate, and the electronic module comprises an analog-to-digital conversion module and is used for converting an analog signal into a digital signal; the electronic module further comprises a data latch and a comparison module, wherein the data latch is used for recording the digital signal recorded in the previous time period, and the comparison module is used for comparing the level value of the current digital signal with the level value of the corresponding comparison digital signal in the previous time period; if the level value of the current digital signal is greater than the level value of the comparison digital signal, further judging whether the difference value between the level value of the current digital signal and the level value of the comparison digital signal is greater than a first threshold value, if so, confirming that the current digital signal is a high level signal, otherwise, taking the level signal of the comparison digital signal as the level signal of the current digital signal; if the level value of the current digital signal is smaller than the level value of the comparison digital signal, further judging whether the difference value between the level value of the comparison digital signal and the level value of the current digital signal is larger than a second threshold value, if so, confirming that the current digital signal is a low level signal, otherwise, taking the level signal of the comparison digital signal as the level signal of the current digital signal.
In order to achieve the third object, the consumable container provided by the invention comprises a box body, wherein the consumable chip is arranged on the side wall of the box body.
Drawings
FIG. 1 is an exploded view of a conventional toner cartridge.
Fig. 2 is a waveform diagram of digital signal demodulation.
Fig. 3 is a waveform diagram of a digital signal.
Fig. 4 is a first part of a flowchart of an embodiment of the digital signal demodulation method of the present invention.
Fig. 5 is a second part of a flowchart of an embodiment of the digital signal demodulation method of the present invention.
Fig. 6 is a block diagram of a digital signal demodulation circuit in an embodiment of the consumable chip of the present invention.
The invention is further described below with reference to the drawings and examples.
Detailed Description
The electronic imaging device of the invention is a laser printer, and the toner cartridge as a consumable container can be mounted on the laser printer. Specifically, the laser printer is provided with a machine body, a toner cartridge installation cavity is formed in the machine body, one or more toner cartridges are detachably installed in the toner cartridge installation cavity, each toner cartridge is provided with a cartridge body, the cartridge bodies enclose a powder bin for containing toner, a toner outlet is formed in one side of the powder bin, and the toner can flow out of the powder bin through the toner outlet. A consumable chip is detachably mounted on one side wall of the box body, the consumable chip comprises a substrate, two electric contacts are arranged on one surface of the substrate, contact pins which are in contact with the electric contacts are arranged in the laser printer, an electronic module is arranged on the other surface of the substrate, the electronic module comprises a processing unit and a memory, and information such as carbon powder color, carbon powder allowance and the like is stored in the memory.
Because the consumable chip is only provided with two electrical contacts, the laser printer needs to transmit the power signal and the digital signal through the same wire, namely one of the electrical contacts of the consumable chip needs to transmit both the power signal and the data signal, and the other electrical contact is grounded. The signals transmitted by the laser printer to the electrical contacts of the consumable chip are analog signals, and therefore, the consumable chip needs to convert the analog signals into digital signals and rectify the digital signals to obtain rectified signals. Usually, the voltage amplitude of the rectified signal is 3V, and the rectified signal can be used as a power supply to meet the working requirements of electronic devices in consumable chips.
In addition, the electronic module also needs to demodulate the digital signal to obtain the data sent by the laser printer. Referring to fig. 4 and 5, when demodulating the data signal, step S1 is first performed to obtain the current digital signal, for example, obtain the digital signal at the current time. Preferably, the current digital signal is a signal with one digital signal period, and specifically, the electronic module samples the digital signal according to the frequency of sending data by the laser printer, for example, the sampling frequency is 50K, and the digital signal obtained by each sampling is only one digital signal.
Then, step S2 is performed to acquire the digital signal in the previous period, and acquire the corresponding contrast digital signal in the previous period. In this embodiment, the previous period is a period corresponding to a period of the digital signal, that is, the digital signal in the previous period is only one digital signal, that is, only one sampling value, which is the value of the comparison digital signal.
In practical application, the previous time period may also be multiple digital signal periods, and if the digital signal is adopted once in one digital signal period, there are multiple sampling values in the previous time period, and at this time, the comparison digital signal is a digital signal with a corresponding serial number in the previous time period. For example, the electronic module compares the digital signals according to a preset time period, and if the current digital signal is the digital signal with the sequence number of 5 corresponding to the current time period, the digital signal with the sequence number of 5 in the previous time period is obtained, and the digital signal is the compared digital signal.
For this purpose, a data latch is provided in the electronic module for storing the digital signal acquired during the previous time period. Preferably, the data latch may store the digital signals acquired during the past two time periods, delete the digital signal stored during the oldest time period when one time period ends, and begin storing the digital signal acquired during the new time period. Two data latch areas are arranged in the data latch, and the two data latch areas store digital signals obtained in two time periods in a ping-pong manner.
Then, the level values of the current digital signal and the comparison digital signal may have three cases, respectively: the level value of the current digital signal is larger than that of the comparison digital signal, the level value of the current digital signal is smaller than that of the comparison digital signal, and the level value of the current digital signal is equal to that of the comparison digital signal.
In step S3, it is determined whether the level value of the current digital signal is greater than the level value of the comparison digital signal, if yes, step S4 is performed to further determine whether the difference between the level value of the current digital signal and the level value of the comparison digital signal is greater than a first threshold. In this embodiment, the first threshold is a preset value, preferably half of a preset level amplitude, where the preset level amplitude is a difference between the amplitude of the high level signal and the amplitude of the low level signal in theory. Since the voltage amplitudes of the high-level signal and the low-level signal are fixed when the laser printer sends the digital signal, in this embodiment, half of the voltage amplitudes of the high-level signal and the low-level signal are used as the first threshold.
If the judgment result of step S4 is yes, step S6 is executed to confirm that the current digital signal is a high level signal, if the judgment result of step S4 is no, step S5 is executed to take the level signal of the comparison digital signal as the level signal of the current digital signal, for example, the level of the comparison digital signal is a low level signal, the current digital signal is also a low level signal, and if the level of the comparison digital signal is a high level signal, the current digital signal is also a high level signal.
In order to facilitate the calculation of the initial digital signal, the level of the initial digital signal may be set to a low level signal, i.e. if the current digital signal is the first digital signal, the level of the digital signal is set directly to a low level signal. Of course, the voltage amplitude of the first digital signal may be compared with a preset value, and if the voltage amplitude is greater than the preset value, the level of the first digital signal is set to a high level, and if the voltage amplitude is less than the preset value, the level of the first digital signal is set to a low level.
If the judgment result of the step S3 is no, the step S7 is executed to judge whether the level value of the current digital signal is smaller than the level value of the comparison digital signal, if yes, the step S8 is executed to further judge whether the difference value between the level value of the comparison digital signal and the level value of the current digital signal is larger than the second threshold. In this embodiment, the second threshold is a preset value, preferably half of a preset level amplitude, where the preset level amplitude is a difference between the amplitude of the high level signal and the amplitude of the low level signal in theory. Thus, the first threshold value and the second threshold value are equal. Of course, the first threshold may not be equal to the second threshold.
If the determination result of step S8 is yes, step S9 is performed to confirm that the current digital signal is a low level signal, if the determination result of step S8 is no, step S10 is performed to take the level signal of the comparison digital signal as the level signal of the current digital signal, for example, the level of the comparison digital signal is a low level signal, to confirm that the current digital signal is also a low level signal, and if the level of the comparison digital signal is a high level signal, to confirm that the current digital signal is also a high level signal.
If the judgment result in the step S7 is no, it indicates that the level value of the current digital signal is equal to the level value of the comparison digital signal, and the step S10 is executed to take the level signal of the comparison digital signal as the level signal of the current digital signal.
In order to implement the above method, a corresponding hardware circuit is provided in the electronic module, and referring to fig. 6, an analog-to-digital conversion module 31, a data latch 32, a comparison module 33, and a first flip-flop 34 and a second flip-flop 35 are provided in the electronic module. The analog-to-digital conversion module 31 is configured to convert an analog signal into a digital signal, and the converted digital signal is transmitted to the comparison module 33 and the data latch 32, where the data latch 32 may store the digital signal obtained in the previous period, and the comparison module 33 is configured to compare the current digital signal with a corresponding comparison digital signal obtained in the previous period. Preferably, a plurality of comparators are disposed in the comparing module 33, for example, comparing the magnitude of the current digital signal with the magnitude of the comparison digital signal, and comparing the magnitude of the difference between the level value of the current digital signal and the level value of the comparison digital signal with the first threshold value and the second threshold value, thereby determining the level value of the current digital signal. The first flip-flop 34 is driven to output a high level signal if the current digital signal is determined to be a high level signal, and the second flip-flop 35 is driven to output a low level signal if the current digital signal is determined to be a low level signal.
Therefore, the present digital signal is determined to be a high level signal or a low level signal by comparing the present digital signal with the comparison digital signal obtained in the previous time period, so that the present digital signal is not compared with a fixed level signal, and the level condition of the present digital signal can be effectively and accurately identified under the condition that the level of the digital signal is higher or lower as a whole, and the demodulation result is more accurate. In addition, the circuit arranged in the consumable chip is simpler, and the production cost of the consumable chip can not be greatly increased.
Finally, it should be emphasized that the invention is not limited to the above-described embodiments, for example, changes in the specific values of the first threshold value, the second threshold value, or changes in the internal structure of the comparison module, which are also intended to be included in the scope of the claims of the invention.
The above is only a specific embodiment of the present application, but the scope of the present application is not limited thereto, and the above is only an embodiment adopted for the purpose of facilitating understanding of the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the present application shall be subject to the scope defined by the claims.