A method for realizing print head temperature detection by simulating i2c protocol through GPIO

The communication between the MCU and CPU chip is achieved through GPIO simulation, which solves the problem of the lack of ADC support for the X1000E chip, and the correct transmission and expansion of printhead temperature data is achieved, reducing costs and improving the division of labor.

CN113312286BActive Publication Date: 2024-12-13INGENIC SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010117968.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-26
Publication Date
2024-12-13
Estimated Expiration
2040-02-26

AI Technical Summary

Technical Problem

Existing chips such as X1000E support the i2c interface but lack ADC-related support, which makes it impossible to detect peripherals such as printhead temperature. External MCU chips such as HR7p153 need to be connected to expand the ADC interface, but HR7p153 does not support the i2c protocol, resulting in insufficient communication interface.

Method used

Through GPIO simulation of the i2c protocol, communication between the MCU and the chip containing the CPU is realized, print head temperature data is collected and transmitted to the main chip. The specific steps include using two GPIO pins to simulate the i2c communication protocol, waiting for the clock signal, and sending a confirmation message , read the ADC data and use GPIO to simulate waveform to send data.

Benefits of technology

It realizes the correct transmission of printhead temperature data, expands the ADC function of the X1000E chip, reduces costs and improves the division of labor, and solves the communication problems between chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113312286B_ABST
    Figure CN113312286B_ABST
Patent Text Reader

Abstract

The present invention provides a method for realizing print head temperature detection by simulating an i2c protocol through GPIO, comprising the following steps: S1. an external MCU simulates an i2c communication protocol through two GPIO pins; S2. one of the two GPIO pins in step S1 waits for a clock signal transmitted from a CPU of a main chip, and after the MCU captures the clock signal through the pin, it sends a confirmation message to the main chip; S3. after the main chip confirms the MCU information, it starts to read ADC data; S4. the MCU starts to collect print head temperature data, and sends the collected data to the main chip in a GPIO simulation waveform manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of printers, and in particular to a method for realizing temperature detection of a print head by simulating an i2c protocol through a GPIO. Background Art

[0002] With the continuous development of science and technology, more and more electronic products appear in people's daily life. Thermal receipt printer is a common printer device, which is usually based on a single-chip microcomputer to control the print head to realize the printing function. Thermal receipt printer is a common printer device, which is usually based on a single-chip microcomputer to control the print head to realize the printing function. For example, Beijing Junzheng's X1000E chip is a chip for the field of Internet of Things. For the thermal printer market, Beijing Junzheng has developed a set of printer drivers based on Junzheng chips. However, the X1000E chip lacks relevant support for ADC. ADC is a necessary interface for printers. It needs to detect the temperature of the print head, paper pick-up detection, paper jam detection, power supply voltage detection and other peripherals. For this reason, it is necessary to expand the ability of X1000E to support ADC. Considering low cost and other issues, you can consider using Neusoft's HR7p153 MCU, for example.

[0003] Existing chips such as the X1000E chip support i2c interface devices but lack ADC support. ADC is a necessary interface for printers and needs to detect peripherals such as print head temperature. In order to solve this problem, a low-cost MCU chip HR7p153 is needed to expand the ADC related interface, but HR7p153 does not support the i2c protocol and has a technical defect that there is no interface that can communicate with X1000E.

[0004] Common technical terms include:

[0005] X1000E: A dual-core (large and small core) embedded chip launched by Beijing Ingenic for the Internet of Things.

[0006] MCU: Microcontroller Unit (MCU), also known as Single Chip Microcomputer or Single Chip Microcomputer

[0007] CPU: The main CPU of the chip X1000E released by Beijing Ingenic, referred to as "big core".

[0008] I2C protocol: an interface for communication. The I2C bus is a simple, bidirectional, two-wire synchronous serial bus developed by Philips. It only requires two wires to transmit information between devices connected to the bus.

[0009] GPIO: Short for General Purpose Input Output.

[0010] HR7p153: A third-party MCU that can collect ADC data.

[0011] SerialClock (SCL for short) and SerialData (SDA for short)

[0012] SCL, SDA: These two pins are used to communicate between source (DVD) and display (TV). There is a memory inside the TV, which stores the resolution supported by the TV, such as 720P or 1080P. If the source (DVD) does not know the TV resolution supported by the currently connected TV, the source (DVD) does not know what resolution signal to broadcast. Therefore, at the beginning, the source (DVD) will read the resolution supported by the TV through these two pins. When the source (DVD) knows, it will broadcast the image screen that meets the TV resolution. Among them, SCL is the clock pin, and SDA is the data pin.

[0013] ADC, or analog-to-digital converter, is a type of device used to convert continuous analog signals into discrete digital signals. An analog-to-digital converter can provide signals for measurement. The function of an ADC is to convert continuously changing analog signals into discrete digital signals. Real-world analog signals, such as temperature, pressure, sound, or images, need to be converted into digital forms that are easier to store, process, and transmit. Summary of the invention

[0014] In order to solve the above problems in the prior art, the object of the present invention is to:

[0015] The present invention realizes the communication between an external MCU (such as HR7p153) and a chip containing a CPU (such as X1000E) by simulating an i2c protocol with GPIO, solves the communication problem between the chip containing a CPU (X1000E) and the MCU, and transmits the print head temperature data collected by ADC.

[0016] Specifically, the present invention provides a method for realizing print head temperature detection by simulating an i2c protocol through GPIO, comprising the following steps:

[0017] S1. The external MCU simulates the i2c communication protocol through two GPIO pins;

[0018] S2. One of the two GPIO pins in step S1 waits for the clock signal from the CPU of the main chip. After the MCU catches the clock signal through the pin, it sends a confirmation message to the main chip;

[0019] S3. After the main chip confirms the MCU information, it starts to read the ADC data;

[0020] S4.MCU starts to collect print head temperature data and sends the collected data to the main chip in the form of GPIO analog waveform.

[0021] The steps include: the main chip of the printer is externally connected to an MCU chip.

[0022] The main chip supports i2c interface devices but lacks relevant support for ADC.

[0023] The external MCU chip does not support the i2c protocol, and is used to expand the ADC-related interface of the main chip.

[0024] The advantages of this application are: it can greatly reduce costs and have a more refined division of labor. The external MCU simulates the I2C communication protocol through two GPIOPINs to achieve the correct transmission of ADC collected print head temperature data to X1000E for use, expanding the function of X1000E to collect ADC temperature data. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.

[0026] Figure 1 It is a schematic flowchart of the method of the present invention. DETAILED DESCRIPTION

[0027] At present, the commonly used technical terms in this technical field include:

[0028] GPIO: Short for General Purpose Input Output.

[0029] CPU: Central Processing Unit is a large-scale integrated circuit, which is the computing core and control unit of a computer. Its main function is to interpret computer instructions and process data in computer software.

[0030] MCU: Microcontroller Unit, also known as Single Chip Microcomputer or MCU, is a CPU that reduces the frequency and specifications of the central processing unit (CPU) appropriately. It can integrate peripheral interfaces such as memory, timer, USB, A / D conversion, UART, PLC, DMA, and even LCD driver circuits on a single chip to form a chip-level computer, which can provide different combination controls for different applications.

[0031] like Figure 1 As shown, the present invention relates to a method for realizing print head temperature detection by simulating i2c protocol through GPIO, comprising the following steps:

[0032] S1. The external MCU simulates the i2c communication protocol through two GPIO pins;

[0033] S2. One of the two GPIO pins in step S1 waits for the clock signal from the CPU of the main chip. After the MCU catches the clock signal through the pin, it sends a confirmation message to the main chip;

[0034] S3. After the main chip confirms the MCU information, it starts to read the ADC data;

[0035] S4.MCU starts to collect print head temperature data and sends the collected data to the main chip in the form of GPIO analog waveform.

[0036] The steps include: the main chip of the printer is externally connected to an MCU chip.

[0037] The main chip supports i2c interface devices but lacks relevant support for ADC.

[0038] The external MCU chip does not support the i2c protocol, and is used to expand the ADC-related interface of the main chip.

[0039] The method further comprises:

[0040] S5. The main chip receives the temperature data and passes it to the printer program for processing.

[0041] The step S1 further includes taking two GPIOs of the external MCU chip and initializing them accordingly; one is used as the SCL pin of i2c and the other is used as the SDA pin.

[0042] One of the two GPIO pins in step S2 is a SCL pin.

[0043] The step S2 further comprises:

[0044] After the clock signal is captured, the MCU is tested with the main chip, and the address of the MCU is first verified. After the verification is correct, a confirmation message is sent to the main chip.

[0045] Further, for example, Beijing Ingenic launched a dual-core (big and small core) embedded chip X1000E for the Internet of Things. The main CPU of Beijing Ingenic chip X1000E is referred to as "big core". For example, Beijing Ingenic's X1000E chip is a chip for the Internet of Things field. For the thermal printer market, Beijing Ingenic has developed a set of printer drivers based on Ingenic chips. The CPU is responsible for preparing and transmitting data.

[0046] Taking Beijing Ingenic's X1000E chip as an example, its main technical implementation steps are:

[0047] 1. Take two GPIOs of MCU and do corresponding initialization; one is used as the scl pin of i2c and the other is used as the SDA pin.

[0048] 2. Scl pin waits for the clock signal from the X1000E main CPU. After capturing the signal, it tests with the host to verify the MCU address first. After verification, it sends a confirmation message to X1000E.

[0049] 3. After X1000E confirms the MCU information, it starts to read the ADC data.

[0050] 4. MCU starts to collect print head temperature data and sends the collected data to X1000E using GPIO analog waveform.

[0051] 5. X1000E receives the temperature data and passes it to the printer program for processing.

[0052] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for realizing print head temperature detection by simulating i2c protocol through GPIO, characterized in that: The printer's main chip is connected to an external MCU chip; the main chip supports the i2c interface device but lacks ADC related support; the external MCU chip does not support the i2c protocol and is used to expand the ADC related interface of the main chip; the following steps are included: S1. The external MCU simulates the i2c communication protocol through two GPIO pins; S2. In step S1, one of the two GPIO pins waits for the clock signal transmitted from the CPU of the main chip. After the MCU captures the clock signal through the pin, it sends a confirmation message to the main chip; step S2 further includes that after the clock signal is captured, the MCU and the main chip are tested to first verify the address of the MCU, and after the verification is correct, a confirmation message is sent to the main chip; S3. After the main chip confirms the MCU information, it starts to read the ADC data; S4. MCU starts to collect print head temperature data and sends the collected data to the main chip in the form of GPIO analog waveform; S5. The main chip receives the temperature data and passes it to the printer program for processing.

2. The method for realizing print head temperature detection by simulating i2c protocol through GPIO according to claim 1, characterized in that: The step S1 further includes taking two GPIOs of the external MCU chip and initializing them accordingly; one is used as the SCL pin of i2c and the other is used as the SDA pin.

3. The method for realizing print head temperature detection by simulating i2c protocol through GPIO according to claim 2, characterized in that: One of the two GPIO pins in step S2 is a SCL pin.