Control circuit and printer system
Patent Information
- Application Number
- CN202420273879.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2034-02-04
Smart Images

Figure CN221642144U
Abstract
Description
Technical Field
[0001] The utility model relates to the technical field of printing, in particular to a control circuit and a printer system. Background Art
[0002] When multiple SPI peripherals need to be controlled, designers usually choose an MCU with 2 or more SPI controls, which will increase the cost, increase the complexity of the circuit board pin layout and occupy more PCB space. Utility Model Content
[0003] In view of the deficiencies in the prior art, the purpose of the present invention is to provide a control circuit and a printer system, which are used to reduce the cost of a main control chip, while reducing the complexity of circuit board pin layout circuit design and the occupied PCB space.
[0004] According to a first aspect of the utility model, a control circuit is provided for controlling a first SPI peripheral and a second SPI peripheral, comprising:
[0005] A control module, the control module is used to output a chip select signal, wherein the control module includes:
[0006] SPI interface, the SPI interface is used to be electrically connected to the first SPI peripheral and the second SPI peripheral respectively;
[0007] A chip selection unit, wherein the chip selection unit is respectively used to be electrically connected to the first SPI peripheral and the second SPI peripheral, and the chip selection unit activates the first SPI peripheral or the second SPI peripheral according to the chip selection signal, so that the control module communicates with the first SPI peripheral or the second SPI peripheral through the SPI interface.
[0008] The control circuit of the utility model activates the first SPI peripheral or the second SPI peripheral through the chip selection unit, so that one SPI interface can control two SPI peripherals, thereby reducing the cost of the main control chip, and reducing the complexity of the circuit board pin layout line design and the occupied PCB space.
[0009] In some implementations, the control module is a main control unit, the chip select unit is one of the IO ports of the main control unit, and the IO port is electrically connected to the first SPI peripheral and the second SPI peripheral respectively.
[0010] In some embodiments, the first SPI peripheral and the second SPI peripheral have opposite activation states, and when the chip select signal is a low level signal, one of the first SPI peripheral and the second SPI peripheral is activated, and when the chip select signal is a high level signal, the other of the first SPI peripheral and the second SPI peripheral is activated.
[0011] In some embodiments, the control module includes:
[0012] A main control unit, which is used to output control signals;
[0013] A communication unit is electrically connected to the main control unit, and the communication unit outputs the chip selection signal according to the control signal.
[0014] In some implementations, the chip select unit is two signal ports of the communication unit, one of the two signal ports is electrically connected to the first SPI peripheral, and the other of the two signal ports is electrically connected to the second SPI peripheral.
[0015] In some embodiments, the chip select signal includes a first chip select signal and a second chip select signal, the first chip select signal is transmitted to the first SPI peripheral through one of the two signal ports, so that the first SPI peripheral is activated, and the second chip select signal is transmitted to the second SPI peripheral through the other of the two signal ports, so that the second SPI peripheral is activated.
[0016] In some implementations, the chip selection unit is one of the signal ports of the communication unit, and the signal port is electrically connected to the first SPI peripheral and the second SPI peripheral respectively.
[0017] In some embodiments, the first SPI peripheral and the second SPI peripheral have opposite activation states, and when the chip select signal is a low level signal, one of the first SPI peripheral and the second SPI peripheral is activated, and when the chip select signal is a high level signal, the other of the first SPI peripheral and the second SPI peripheral is activated.
[0018] In some implementations, the communication unit includes the SPI interface, and the communication unit is electrically connected to the main control unit via the communication interface.
[0019] According to a second aspect of the utility model, there is provided a printer system, comprising:
[0020] A control circuit as described in any one of the above items;
[0021] A first SPI peripheral, wherein the first SPI peripheral is electrically connected to the SPI interface and the chip selection unit respectively;
[0022] A second SPI peripheral, the second SPI peripheral is electrically connected to the SPI interface and the chip selection unit respectively;
[0023] The control circuit is used to activate the first SPI peripheral or the second SPI peripheral, so that the control module communicates with the first SPI peripheral or the second SPI peripheral through the SPI interface.
[0024] Compared with the prior art, the control circuit and printer system of the present invention activate the first SPI peripheral or the second SPI peripheral through a chip select unit, so that one SPI interface can control two SPI peripherals, thereby reducing the cost of the main control chip and reducing the complexity of the circuit board pin layout line design and the occupied PCB space. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a schematic diagram of the structure of a first control circuit and an SPI peripheral device in one embodiment of the utility model;
[0026] Figure 2 It is a structural schematic diagram of a second control circuit and an SPI peripheral device in one embodiment of the utility model;
[0027] Figure 3 It is a structural schematic diagram of a third control circuit and an SPI peripheral device according to an embodiment of the present utility model.
[0028] Description of the accompanying drawings: first SPI peripheral 10 , second SPI peripheral 20 , control module 100 , SPI interface 110 , chip selection unit 120 , main control unit 130 , communication unit 140 , communication interface 150 . DETAILED DESCRIPTION
[0029] The utility model is further described in detail below in conjunction with the accompanying drawings.
[0030] According to the first aspect of the utility model, Figure 1 The control circuit according to an embodiment of the present invention is schematically shown, which is used to control the first SPI peripheral 10 and the second SPI peripheral 20. Figure 1As shown, the control circuit includes a control module 100, and the control module 100 is used to output a chip select signal, wherein the control module 100 includes an SPI interface 110 and a chip select unit 120, and the SPI interface 110 is used to be electrically connected to the first SPI peripheral 10 and the second SPI peripheral 20, that is, the control module 100 is electrically connected to the SPI interface of the first SPI peripheral 10 and the SPI interface of the second SPI peripheral 20 through its own SPI interface 110 to form a communication channel. When the first SPI peripheral 10 is activated, the control module 100 can communicate with the first SPI peripheral 10 through the SPI interface 110, and when the second SPI peripheral 20 is activated, the control module 100 can communicate with the second SPI peripheral 20 through the SPI interface 110.
[0031] The chip select unit 120 is used to be electrically connected to the first SPI peripheral 10 and the second SPI peripheral 20, respectively. That is, the control module 100 is electrically connected to the activation port of the first SPI peripheral 10 and the activation port of the second SPI peripheral 20 through the chip select unit 120, so that the chip select unit 120 activates the first SPI peripheral 10 or the second SPI peripheral 20 according to the chip select signal, so that the control module 100 communicates with the first SPI peripheral 10 or the second SPI peripheral 20 through the SPI interface 110.
[0032] In an optional embodiment, if Figure 1 As shown, the control module 100 is the main control unit, the chip selection unit 120 is one of the IO ports of the main control unit, and the IO ports are electrically connected to the first SPI peripheral 10 and the second SPI peripheral 20 respectively, wherein the first SPI peripheral 10 and the second SPI peripheral 20 have opposite activation states, that is, one of the SPI peripherals is configured to be activated when its activation port receives a low-level signal, and the other SPI peripheral is configured to be activated when its activation port receives a high-level signal. At this time, the main control unit can selectively activate the first SPI peripheral 10 or the second SPI peripheral 20 by controlling the level state of the IO port.
[0033] It should be noted that the main control unit can be, for example, an MCU, DSP, MPU, micro CPU, etc., which can process digital signals, analog signals, or perform signal control functions, instruction processing and calculation functions, or a micro central control chip or system-on-chip chip.
[0034] When the chip select signal output by the main control unit is a low level signal, one of the SPI peripherals of the first SPI peripheral 10 and the second SPI peripheral 20 (i.e., the SPI peripheral configured to be activated when receiving a low level signal) is activated, and when the chip select signal output by the main control unit is a high level signal, the other SPI peripheral of the first SPI peripheral 10 and the second SPI peripheral 20 (i.e., the SPI peripheral configured to be activated when receiving a high level signal) is activated.
[0035] Exemplarily, the first SPI peripheral 10 may be an NFC reader, and the second SPI peripheral 20 may be a print head, wherein the NFC reader is configured to be activated when receiving a low-level signal, and the print head is configured to be activated when receiving a high-level signal; when the main control unit pulls down its own IO port to output a low-level signal, the NFC reader is activated, and the main control unit communicates with the reader chip of the NFC reader through the SPI interface 110, such as reading the content to be printed stored in the reader chip, and the content to be printed stored in the reader chip may be the content to be printed temporarily stored in the reader chip after the NFC reader performs NFC communication with an external mobile device; when the main control unit pulls up its own IO port to output a high-level signal, the print head is activated, and the main control unit communicates with the control chip of the print head (which may be the movement of the printer) through the SPI interface 110, such as transmitting the content to be printed to the control chip of the print head, so that the control chip controls the print head to print.
[0036] Since the main control unit has only one SPI interface 110 and the valid bits of the two SPI peripherals are opposite, one IO port in the main control unit can be used to control the chip selects of the two SPI peripherals, which can effectively solve the problem of insufficient pins of the main control unit or effectively save pins of the main control unit.
[0037] It should be noted that the first SPI peripheral 10 may be a print head, and the second SPI peripheral 20 may be an NFC reader. Correspondingly, the print head is configured to be activated when a low-level signal is received, and the NFC reader is configured to be activated when a high-level signal is received.
[0038] In an optional embodiment, if Figure 2As shown, the control module 100 includes a main control unit 130 and a communication unit 140; the main control unit 130 is used to output a control signal, wherein the control signal includes a chip select signal identifier (i.e., specifying the first SPI peripheral 10 or the second SPI peripheral 20) and data that needs to be transmitted to the first SPI peripheral 10 or the second SPI peripheral 20 (such as a read instruction for reading data from the SPI peripheral, or write data that needs to be written to the SPI peripheral); the communication unit 140 is electrically connected to the main control unit 130 to receive the control signal, and the communication unit 140 outputs a chip select signal according to the control signal, and performs a corresponding read or write operation. Exemplarily, the communication unit 140 can be an FPGA unit, and the high performance and parallel processing capability of the FPGA unit can be used to improve the efficiency of data transmission.
[0039] It should be noted that the main control unit 130 can be, for example, an MCU, DSP, MPU, micro CPU, etc., which can process digital signals, analog signals, or perform signal control functions, instruction processing and calculation functions, and a micro central control chip or system-on-chip chip.
[0040] Furthermore, the communication unit 140 and the main control unit can be electrically connected through a communication interface 150, wherein the communication interface 150 can be SPI, I2C, UART, or a parallel interface, that is, the main control unit 130 can communicate with the communication unit 140 through any of the above communication interfaces to output control signals to the communication unit 140.
[0041] The communication unit 140 includes an SPI interface 110. The communication unit 140 is electrically connected to the SPI interface of the first SPI peripheral 10 and the SPI interface of the second SPI peripheral 20 through the SPI interface 110 to form a communication channel, so as to communicate with the first SPI peripheral 10 (or the second SPI peripheral 20) when the first SPI peripheral 10 (or the second SPI peripheral 20) is activated. That is, when the control signal includes a read instruction, the communication unit 140 outputs the read instruction to the first SPI peripheral 10 (or the second SPI peripheral 20) through the SPI interface 110, and the first SPI peripheral 10 (or the second SPI peripheral 20) outputs the corresponding read data to the communication unit 140 through the SPI interface 110 according to the read instruction. When the control signal includes write data, the communication unit 140 outputs the write data to the first SPI peripheral 10 (or the second SPI peripheral 20) through the SPI interface 110, and the first SPI peripheral 10 (or the second SPI peripheral 20) stores the write data in its own storage module.
[0042] The chip select unit 120 is two signal ports (CS1 and CS2) of the communication unit 140 , one of the two signal ports (CS1) is electrically connected to the first SPI peripheral 10 , and the other of the two signal ports (CS2) is electrically connected to the second SPI peripheral 20 .
[0043] The chip select signal includes a first chip select signal and a second chip select signal. When the main control unit 130 specifies the first SPI peripheral 10 (that is, when the chip select signal is identified as the first SPI peripheral 10), the communication unit 140 outputs the first chip select signal, and the output first chip select signal is transmitted to the first SPI peripheral 10 through one of the two signal ports (CS1), so that the first SPI peripheral 10 is activated. The communication unit 140 communicates with the first SPI peripheral 10 through the SPI interface 110. After the communication is completed, the communication unit 140 stops outputting the first chip select signal and stops communicating with the first SPI peripheral 10. The PI peripheral 10 communicates, and when the main control unit 130 specifies the second SPI peripheral 20 (that is, when the chip select signal is identified as the second SPI peripheral 20), the communication unit 140 outputs the second chip select signal, and the second chip select signal is transmitted to the second SPI peripheral 20 through the other one (CS2) of the two signal ports, so that the second SPI peripheral 20 is activated, and the communication unit 140 communicates with the second SPI peripheral 20 through the SPI interface 110. After the communication is completed, the communication unit 140 stops outputting the second chip select signal and stops communicating with the second SPI peripheral 20.
[0044] It should be noted that, if it is necessary to transmit the communication results (such as read data or error status) between the communication unit 140 and the first SPI peripheral 10 and the second SPI peripheral 20 to the main control unit 130, the communication unit 140 can transmit the communication results to the main control unit 130 through the communication interface 150; in addition, the activation states of the first SPI peripheral 10 and the second SPI peripheral 20 can be the same or different, that is, the first chip select signal and the second chip select signal can be high level signals or low level signals at the same time, or one can be a high level signal and the other can be a low level signal.
[0045] Exemplarily, the first SPI peripheral 10 may be an NFC reader, and the second SPI peripheral 20 may be a print head; the main control unit 130 transmits the control signal to the communication unit 140 through the communication interface 150. If the control signal specifies the NFC reader, the communication unit 140 transmits the first chip select signal to the NFC reader through the signal port (CS1). At this time, the NFC reader is activated, and the communication unit 140 communicates with the reader chip of the NFC reader through the SPI interface 110, such as reading the content to be printed stored in the reader chip. The content to be printed stored in the reader chip may be a communication between the NFC reader and an external mobile device. After the NFC communication, the content to be printed is temporarily stored in the reader chip. If necessary, the communication unit 140 can also transmit the content to be printed to the main control unit 130 through the communication interface 150; if the control signal specifies the print head, the communication unit 140 transmits the second chip select signal to the print head through the signal port (CS2). At this time, the print head is activated, and the communication unit 140 communicates with the control chip of the print head (which can be the movement of the printer) through the SPI interface 110, such as transmitting the content to be printed received from the main control unit 130 to the control chip of the print head, so that the control chip controls the print head to print.
[0046] The communication unit 140 controls SPI data transmission according to the instructions of the main control unit 130. This architecture can facilitate data exchange between the main control unit 130 and multiple SPI peripherals. Since the communication unit 140 handles most of the SPI communication work, the main control unit 130 can focus on other tasks, thereby improving the efficiency of the overall system. In addition, the communication unit 140 can be reprogrammed and configured according to specific needs (or the communication unit 140 with corresponding functions can be replaced) without replacing the main control unit 130, thereby adapting to different applications and changing design requirements.
[0047] In an optional embodiment, if Figure 3 As shown, the chip select unit 120 is one of the signal ports (CS1) of the communication unit 140, and the signal port (CS1) is electrically connected to the first SPI peripheral 10 and the second SPI peripheral 20, respectively, wherein the first SPI peripheral 10 and the second SPI peripheral 20 have opposite activation states, that is, one of the SPI peripherals is configured to be activated when its activation port receives a low-level signal, and the other SPI peripheral is configured to be activated when its activation port receives a high-level signal. At this time, the communication unit 140 can selectively activate the first SPI peripheral 10 or the second SPI peripheral 20 according to the level state of the signal port (CS1).
[0048] When the chip select signal output by the communication unit 140 is a low level signal, one of the SPI peripherals of the first SPI peripheral 10 and the second SPI peripheral 20 (i.e., the SPI peripheral configured to be activated when receiving a low level signal) is activated, and when the chip select signal output by the communication unit 140 is a high level signal, the other SPI peripheral of the first SPI peripheral 10 and the second SPI peripheral 20 (i.e., the SPI peripheral configured to be activated when receiving a high level signal) is activated.
[0049] Exemplarily, the first SPI peripheral 10 may be an NFC reader, and the second SPI peripheral 20 may be a print head, wherein the NFC reader is configured to be activated when a low-level signal is received, and the print head is configured to be activated when a high-level signal is received; if the control signal specifies the NFC reader, the communication unit 140 pulls down its own signal port (CS1) to output a low-level signal, at which time the NFC reader is activated, and the communication unit 140 communicates with the reader chip of the NFC reader through the SPI interface 110, such as reading the content to be printed stored in the reader chip, and the content to be printed stored in the reader chip may be the NFC reader. After the reader performs NFC communication with an external mobile device, the content to be printed is temporarily stored in the reader chip. If necessary, the communication unit 140 can also transmit the content to be printed to the main control unit 130 through the communication interface 150; if the control signal specifies the print head, the communication unit 140 pulls up its own (CS1) to output a high-level signal. At this time, the print head is activated. The communication unit 140 communicates with the control chip of the print head (which can be the movement of the printer) through the SPI interface 110, such as transmitting the content to be printed received from the main control unit 130 to the control chip of the print head, so that the control chip controls the print head to print.
[0050] Since the communication unit 140 has only one SPI interface 110 and the valid bits of the two SPI peripherals are opposite, the signal port in the communication unit 140 can be used to control the chip select of the two SPI peripherals, which can effectively solve the problem of insufficient signal ports of the communication unit 140 or effectively save the signal ports of the communication unit 140.
[0051] It should be noted that the first SPI peripheral 10 may be a print head, and the second SPI peripheral 20 may be an NFC reader. Correspondingly, the print head is configured to be activated when a low-level signal is received, and the NFC reader is configured to be activated when a high-level signal is received.
[0052] The control circuit of the utility model activates the first SPI peripheral 10 or the second SPI peripheral 20 through the chip selection unit 120, so that one SPI interface can control two SPI peripherals, thereby reducing the cost of the main control chip and reducing the complexity of the circuit board pin layout line design and the occupied PCB space.
[0053] According to a second aspect of the present invention, Figure 1-3 The printer system according to one embodiment of the present invention is schematically shown. Figure 1-3 As shown, the printer system includes:
[0054] A control circuit for any of the above;
[0055] A first SPI peripheral 10, the first SPI peripheral 10 is electrically connected to the SPI interface 110 and the chip selection unit 120 respectively;
[0056] A second SPI peripheral 20, the second SPI peripheral 20 is electrically connected to the SPI interface 110 and the chip selection unit 120 respectively;
[0057] The control circuit is used to activate the first SPI peripheral device 10 or the second SPI peripheral device 20 , so that the control module 100 communicates with the first SPI peripheral device 10 or the second SPI peripheral device 20 through the SPI interface 110 .
[0058] It should be noted that the working process between the first SPI peripheral 10, the second SPI peripheral 20 and the control circuit has been described in the above embodiment, so it will not be repeated here.
[0059] The above are only some embodiments of the present invention. For those skilled in the art, several modifications and improvements can be made without departing from the inventive concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A control circuit for controlling a first SPI peripheral and a second SPI peripheral, characterized in that: include: A control module, the control module is used to output a chip select signal, wherein the control module includes: SPI interface, the SPI interface is used to be electrically connected to the first SPI peripheral and the second SPI peripheral respectively; A chip selection unit, wherein the chip selection unit is respectively used to be electrically connected to the first SPI peripheral and the second SPI peripheral, and the chip selection unit activates the first SPI peripheral or the second SPI peripheral according to the chip selection signal, so that the control module communicates with the first SPI peripheral or the second SPI peripheral through the SPI interface.
2. The control circuit according to claim 1, characterized in that: The control module is a main control unit, the chip selection unit is one of the IO ports of the main control unit, and the IO ports are electrically connected to the first SPI peripheral and the second SPI peripheral respectively.
3. The control circuit according to claim 2, characterized in that: The first SPI peripheral and the second SPI peripheral have opposite activation states. When the chip select signal is a low level signal, one of the first SPI peripheral and the second SPI peripheral is activated. When the chip select signal is a high level signal, the other of the first SPI peripheral and the second SPI peripheral is activated.
4. The control circuit according to claim 1, characterized in that: The control module comprises: A main control unit, which is used to output control signals; A communication unit is electrically connected to the main control unit, and the communication unit outputs the chip selection signal according to the control signal.
5. The control circuit according to claim 4, characterized in that: The chip selection unit is two signal ports of the communication unit, one of the two signal ports is electrically connected to the first SPI peripheral, and the other of the two signal ports is electrically connected to the second SPI peripheral.
6. The control circuit according to claim 5, characterized in that: The chip select signal includes a first chip select signal and a second chip select signal, the first chip select signal is transmitted to the first SPI peripheral through one of the two signal ports, so that the first SPI peripheral is activated, and the second chip select signal is transmitted to the second SPI peripheral through the other of the two signal ports, so that the second SPI peripheral is activated.
7. The control circuit according to claim 4, characterized in that: The chip selection unit is one of the signal ports of the communication unit, and the signal ports are electrically connected to the first SPI peripheral and the second SPI peripheral respectively.
8. The control circuit according to claim 7, characterized in that: The first SPI peripheral and the second SPI peripheral have opposite activation states. When the chip select signal is a low level signal, one of the first SPI peripheral and the second SPI peripheral is activated. When the chip select signal is a high level signal, the other of the first SPI peripheral and the second SPI peripheral is activated.
9. The control circuit according to any one of claims 4 to 8, characterized in that: The communication unit includes the SPI interface, and the communication unit is electrically connected to the main control unit via the communication interface.
10. A printer system, characterized in that: include: The control circuit according to any one of claims 1 to 9; A first SPI peripheral, wherein the first SPI peripheral is electrically connected to the SPI interface and the chip selection unit respectively; A second SPI peripheral, the second SPI peripheral is electrically connected to the SPI interface and the chip selection unit respectively; The control circuit is used to activate the first SPI peripheral or the second SPI peripheral, so that the control module communicates with the first SPI peripheral or the second SPI peripheral through the SPI interface.
