WO2015024414A1 - Chip and method for debugging mcu by using i2c slave device - Google Patents

Chip and method for debugging mcu by using i2c slave device Download PDF

Info

Publication number
WO2015024414A1
WO2015024414A1 PCT/CN2014/080725 CN2014080725W WO2015024414A1 WO 2015024414 A1 WO2015024414 A1 WO 2015024414A1 CN 2014080725 W CN2014080725 W CN 2014080725W WO 2015024414 A1 WO2015024414 A1 WO 2015024414A1
Authority
WO
WIPO (PCT)
Prior art keywords
output
mcu
gate
chip
flop
Prior art date
Application number
PCT/CN2014/080725
Other languages
French (fr)
Chinese (zh)
Inventor
郭正伟
王光耀
Original Assignee
深圳市汇顶科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市汇顶科技股份有限公司 filed Critical 深圳市汇顶科技股份有限公司
Publication of WO2015024414A1 publication Critical patent/WO2015024414A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware

Definitions

  • a chip and method for debugging an MCU through an I2C slave device A chip and method for debugging an MCU through an I2C slave device
  • the present invention relates to the field of electronic circuit technologies, and in particular, to a chip and method for debugging an MCU through an I2C slave device. Background technique
  • I2C slaves are typically used as general purpose data transfer interfaces.
  • the external communication and debugging of the chip and the MCU mainly use JTAG, UART, etc., so that when the chip does not integrate JTAG, UART and other interfaces, additional interfaces are added for debugging, which wastes system resources. Summary of the invention
  • the technical problem to be solved by the present invention is to provide a chip and a method for debugging an MCU through an I2C slave device, so that the I2C slave device can stop and release the MCU at any time, and can perform a handshake operation with a program executed by the MCU.
  • the I2C slave device is used to implement peripheral debugging of the MCU, saving system resources and making debugging more flexible.
  • a chip for debugging an MCU through an I2C slave device includes an I2C bus, an MCU connected through an I2C bus, an I2C slave device, and two or more peripheral devices, wherein the I2C slave device is further used for Enter or exit the mode of debugging MCU under the control of the external I2C master of the chip.
  • the I2C slave device includes an I2C finite state machine, a command parsing module, an I2C interrupt processing module, an I2C register, a FIFO write module, and a FIFO read module, wherein the command parsing module, the I2C interrupt processing module, the I2C register, the FIFO write module, and The FIFO read module is connected to the I2C finite state machine, and the FIFO write module and the FIFO read module are also respectively connected to the command parsing module, and the I2C register is also connected to the I2C interrupt processing module;
  • the I2C slave device further includes a mode control module, and the mode control module is respectively connected to the command parsing module and the I2C finite state machine, and is configured to receive the first predetermined character string sent by the command parsing module, and then send the stop MCU to the instruction state machine of the MCU. Signal, and wait for a predetermined number of system clock cycles after occupying
  • the bus handshaking between the I2C master device external to the chip and the program executed by the MCU and is further configured to: after receiving the second predetermined character string sent by the command parsing module, release the bus, and send a signal for releasing the MCU to the instruction state machine of the MCU. .
  • the debug control module comprises:
  • a monitoring unit configured to monitor whether a first predetermined character string or a second predetermined character string is received
  • the MCU control unit is configured to: after receiving the first predetermined character string, send a signal for stopping the MCU to the instruction state machine of the MCU; and further, after receiving the second predetermined character string, send the release to the instruction state machine of the MCU. MCU signal.
  • the bus control unit is configured to: after receiving the first predetermined character string, wait for a predetermined number of system clock cycles to occupy the bus; and further, after receiving the second predetermined character string, release the bus.
  • the debug control module comprises:
  • a string register 701, configured to receive a string written by the I2C master device
  • the comparator 702 is configured to compare the string of the string register 701 with the preset string, and output a high level or low level signal to the first flip flop 703 according to the comparison result;
  • the first trigger 703 is configured to register the result of the comparator 702 once, and output to the first NOT gate 704 and the second AND gate 707;
  • the first NOT gate 704 is configured to invert the output of the first flip-flop 703 and then output to the first AND gate
  • the first AND gate 706 is configured to perform an AND operation according to the comparison result of the comparator 702 and the result of the first NOT gate 704, for grabbing the rising edge of the signal output by the comparator 702, and when the rising edge thereof comes, generating a The high pulse of the cycle is output to the first OR gate 708;
  • a second NOT gate 705 for inverting the output of the comparator 702 and then outputting to the second AND gate 707; a second AND gate 707; for outputting according to the second NOT gate 705 and the output of the first flip-flop 703 Performing an AND operation for grabbing the falling edge of the output signal of the comparator 702, and when its falling edge comes, generating a high pulse signal of one cycle is output to the first OR gate 708;
  • the counter 709 is configured to start a pulse count of the clock cycle according to a high pulse signal of one cycle from the first OR gate 708, and output a pulse of one clock cycle to the first MUX 710 and the second MUX after the counting is completed. 711 ;
  • the first MUX 710 is configured to select whether to output the low level or the output value of the second flip-flop 713 as an input of the second OR gate 712. When the output of the counter 709 is high, select the low level as the output, otherwise, Selecting an output value of the second flip-flop 713 as an output;
  • the second MUX 711 is configured to select whether to output the high level or the output value of the third flip-flop 715 as an input of the third AND gate 714. When the output of the counter 709 is high, select the high level as the output, otherwise, Selecting an output value of the third flip-flop 715 as an output;
  • the second OR gate 712 and the second flip-flop 713 are configured to generate a signal for stopping the MCU.
  • the output of the comparator 702 transitions to high, the output thereof is correspondingly turned high, and remains high until the comparator
  • the third AND gate 714 and the third flip-flop 715 are configured to generate a signal that the I2C occupies the bus, when the output of the comparator 702 transitions to high, and the counter 709 thus triggered counts and the count ends, a mid-term high When the pulse arrives, its output transitions high and remains high until the output of comparator 702 goes low, pulling its output low.
  • the handshake of the I2C master device external to the chip and the program executed by the MCU includes: control of the read or write operation of the peripheral by the I2C master device outside the chip.
  • the predetermined number of system clock cycles is determined based on the number of clock cycles required by the MCU to perform the longest execution of its instruction set.
  • the on-chip peripherals include: a read register, a write register, a program memory, and/or a data memory.
  • a method for debugging an MCU through an I2C slave device is provided:
  • the I2C After receiving the first predetermined character string from the device, the I2C first sends a signal to the MCU's instruction state machine to stop the MCU;
  • the predetermined number of system clock cycles is determined based on the number of clock cycles required by the MCU to perform the longest execution of its instruction set.
  • the handshake of the I2C master device external to the chip and the program executed by the MCU includes: the I2C master device outside the chip controls the read or write operation of the chip peripheral device.
  • the invention provides a chip and a method for debugging an MCU through an I2C slave device, so that the I2C slave device can access all peripheral devices in the chip while not affecting the general functions of the I2C slave device, and can also stop and The MCU is released, and the debugging interface is used to implement the function of debugging and MCU handshake of the MCU of the chip by the external I2C master device.
  • the debugging function can be realized without additional debugging interface, and the resource consumption is saved.
  • FIG. 1 is a schematic diagram of control of a chip for debugging an MCU through an I2C slave device according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of an I2C slave device according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a mode control module according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a method for debugging an MCU by using an I2C slave device according to an embodiment of the present invention.
  • FIG. 6 is a flow chart of a method for debugging an MCU through an I2C slave device according to a preferred embodiment of the present invention. detailed description
  • FIG. 1 is a control schematic diagram of a chip for debugging an MCU through an I2C slave device according to an embodiment of the present invention.
  • the system includes a chip 10 and an I2C master device 20, wherein:
  • Chip 10 including I2C bus 101, MCU 102, I2C slave device 103 and more than two peripherals 104.
  • the MCU 102, the I2C slave device 103 and the peripheral device 104 are connected through the I2C bus 101.
  • the I2C bus 101 and the MCU 102 belong to the prior art.
  • the I2C slave device 103 can also be used as a debugging interface to enter or exit the debugging MCU under the control of the external I2C master device 20 of the chip.
  • the mode is thus chosen to be used for a general data transfer interface or a debug interface.
  • Peripherals 104 are also conventional and include, but are not limited to, read registers, write registers, program memory, and data memory.
  • the I2C master device 20 is configured to control the I2C slave device 103 of the chip 10 as a general data transmission interface or a debug interface by transmitting a preset character string.
  • the preset first character string is sent to the chip internal I2C slave device 103, and the I2C slave device 103 receives the preset.
  • the MCU 102 is stopped first, and all its states are kept unchanged, and then the I2C bus 101 is occupied.
  • the external I2C master device 20 can complete any operations required; after the operation is completed, the external After the I2C master device 20 receives the second character string preset by the internal I2C slave device 103, and after the I2C slave device 103 receives the preset second character string, the I2C bus 101 is released first, and then the MCU 102 is released.
  • FIG. 2 is a schematic structural diagram of an I2C slave device according to an embodiment of the present invention, including an I2C finite state machine 1031, a command parsing module 1032, an I2C interrupt processing module 1033, an I2C register 1034, a FIFO write module 1035, and a FIF0 read.
  • Module 1036 and mode control module 1037 command parsing module 1032, I2C interrupt processing module 1033, I2C register 1034, FIF0 write module 1035, and FIFO read module 1036 are all coupled to I2C finite state machine 1031, FIFO write module 1036 and FIFO read module 1036. Also connected to the command parsing module 1032, the I2C register 1034 is also connected to the I2C interrupt processing module 1033; the mode control module 1037 is connected to the I2C finite state machine 1031 and the command parsing module 1032, respectively:
  • the I2C Finite State Machine 1031 is used to control the working state of the I2C slave device and receive and transmit data with the I2C master device.
  • I2C interrupt processing module (Interrupts) 1033 used for interrupt control of I2C slave devices, which is a common communication function of I2C slave devices.
  • the I2C register (Registers) 1034 is used for the interaction between the I2C slave device and the MCU, which is a common communication function of the I2C slave device.
  • the FIFO write module 1035 is used for I2C slave device write control of the on-chip peripherals.
  • the FIFO write module 1036 is used for I2C slave device read control of the on-chip peripherals.
  • the mode control module 1037 is configured to: after receiving the first predetermined character string sent by the command parsing module 1032, send a signal for stopping the MCU to the instruction state machine of the MCU, and wait for a predetermined number of system clock cycles to occupy the bus.
  • the I2C master device external to the chip performs a handshake with the program executed by the MCU; and is further configured to: after receiving the second predetermined character string sent by the command parsing module 1032, release the bus, and send the release MCU to the instruction state machine of the MCU. signal.
  • waiting for the predetermined number of system clock cycles is to enable the MCU to have enough time to execute the currently executing instruction, so the predetermined number of clock cycles can be based on the clock cycle required by the MCU to execute the longest execution in its instruction set. Number to determine.
  • the mode control module 1037 can be implemented by a hardware circuit or by running a software program on the I2C slave device. Divided by functional modules, the mode control module may include: a monitoring unit, an MCU control unit, and a bus control unit, where:
  • a monitoring unit configured to monitor whether a first predetermined character string or a second predetermined character string is received; the MCU control unit, configured to send the MCU to the instruction state machine of the MCU after receiving the first predetermined character string The signal is further configured to send a signal for stopping the MCU to the instruction state machine of the MCU after receiving the second predetermined character string.
  • the bus control unit is configured to: after receiving the first predetermined character string, wait for a predetermined number of system clock cycles to occupy the bus; and further, after receiving the second predetermined character string, release the bus.
  • FIG. 3 is a schematic structural diagram of a mode control module according to an embodiment of the present invention.
  • the module includes: a string register 701, a comparator 702, a first flip-flop 703, and a first NOT gate 704. Second NOT gate 705, first AND gate 706, second AND gate 707, first OR gate 708, counter 709, first
  • MUX (multiplexer) 710 second MUX 711, second OR gate 712, second flip-flop 713, third AND gate 714, and third flip-flop 715, wherein:
  • a string register 701, configured to receive a string written by the I2C master device
  • the comparator 702 is configured to compare whether the character string of the string register 701 is the same as the preset character string, and output a high level or a low level signal according to the comparison result (in the logic structure shown in the figure, both are high-powered
  • the level is valid as an example, but it can also be set to be active low. When the active low level is set, the subsequent circuits are reversely adjusted) to the first flip-flop 703;
  • the first trigger 703 is configured to register the result of the comparator 702 once, and output to the first NOT gate 704 and the second AND gate 707;
  • the first NOT gate 704 is configured to invert the output of the first flip-flop 703 and then output to the first AND gate
  • the first AND gate 706 is configured to perform an AND operation according to the comparison result of the comparator 702 and the result of the first NOT gate 704 for grabbing the rising edge of the signal output by the comparator 702 (because the example image is high in comparison result)
  • the circuit structure diagram of the level effective mode design when its rising edge (ie, the comparison result is changed from unequal to equal), a high pulse output of one cycle is generated to the first OR gate 708;
  • a second NOT gate 705 for inverting the output of the comparator 702 and then outputting to the second AND gate 707; a second AND gate 707; for outputting according to the second NOT gate 705 and the output of the first flip-flop 703 Performing an AND operation to capture the falling edge of the output signal of the comparator 702 (because the example figure is a circuit structure diagram designed in a highly efficient manner of comparison), when its falling edge (ie, the comparison result is changed from equal to unequal) When coming, generate a cycle of high pulse signal output to the first OR gate 708;
  • a first OR gate 708 for outputting two high pulse signals from the first AND gate 706 and the second AND gate 707 for one cycle to a subsequent counter 709;
  • the counter 709 is configured to start a pulse counting of the clock cycle according to a high pulse signal of one cycle from the first OR gate 708, and output a pulse of one clock cycle to the first MUX 710 and the second MUX 711 after the counting is completed. .
  • the number of counting cycles is to ensure that the longest instruction of the MCU can be executed as a standard.
  • the first MUX 710 is configured to select whether to output a low level ("0") or an output value of the second flip-flop 713 as an input of the following second OR gate 712.
  • the second MUX 711 is configured to select whether to output a high level ("1") or an output value of the third flip-flop 715 as an input of the following third AND gate 714.
  • the output of the counter 709 is high, select high. Level as an output, otherwise, the output value of the third flip-flop 715 is selected as an output;
  • the second OR gate 712 and the second flip-flop 713 are configured to generate a signal for stopping the MCU.
  • the signal is high-efficiency as an example.
  • the signal is exemplified by high efficiency, when the output of the comparator 702 transitions high (ie, equal), and When the counter 709 thus triggered counts and the mid-high pulse generated by the end of the count comes, its output transitions to high and remains high until the output of comparator 702 transitions low (ie, not equal). When you pull its output low.
  • the mode control module of this embodiment is merely illustrative.
  • all signals are designed with high efficiency as the premise, including the intermediate signal in the circuit implementation process and the final output signal (stopping the MCU signal and occupying the bus signal).
  • the corresponding circuit waveform diagram is shown in Fig. 4.
  • the double slash " ⁇ " in Fig. 4 indicates that several cycles are omitted, and the specific situation is determined by the designer.
  • FIG. 5 is a flowchart of a method for debugging an MCU by using an I2C slave device according to an embodiment of the present invention, where the method includes:
  • the S50U I2C After receiving the first preset character string, the S50U I2C sends a signal to stop the MCU to the instruction state machine of the MCU;
  • the method of this example can be implemented by a hardware circuit or by running on an I2C slave device.
  • Software program to achieve When the I2C slave detects the first predetermined character string sent by the I2C master device, stops the MCU first, keeps all its states unchanged, and then occupies the bus. At this time, the I2C master device can complete any required After the operation is completed, the I2C master device sends a second predetermined string to the internal I2C slave device. After the I2C slave device detects the second predetermined string, the bus is released and the MCU is released. All debugging work is transparent to the MCU, and the MCU can continue to execute the next instruction of the executed instruction before it is released.
  • FIG. 6 is a flowchart of a method for debugging an MCU by using an I2C slave device according to a preferred embodiment of the present invention, where the method includes:
  • I2C slave device maintains common functions
  • step S603 Determine whether the predetermined first character string is received. If yes, execute step S603; otherwise, return to step S601;
  • the I2C master device performs an operation.
  • the I2C master device sends a second preset character string.
  • I2C slave bus releases the bus
  • the invention provides a chip and a method for debugging an MCU through an I2C slave device, so that the I2C slave device can access all peripheral devices in the chip while not affecting the general functions of the I2C slave device, and can also stop and Release the MCU and use the debug interface to implement the external I2C master device to the MCU of the chip.
  • the debugging function can be realized without adding another debugging interface, and the resource consumption is saved.

Abstract

Disclosed are a chip and a method of debugging an MCU by using I2C slave device. The present invention relates to the technical field of electronic circuits. The chip comprises: an I2C bus, an MCU connected through the ICU bus, an I2C slave device, and at least two peripheral units. The I2C slave device is further configured to enter or exit an MCU debugging mode under the control of an I2C master device outside the chip. By means of embodiments of the present invention, an I2C slave device can further be used as a debugging interface without affecting a general function of the I2C slave device, a debugging function can be performed without additionally adding another debugging interface, thereby reducing consumption of resources.

Description

说 明 书 一种通过 I2C从设备调试 MCU的芯片及方法  A chip and method for debugging an MCU through an I2C slave device
技术领域 Technical field
本发明涉及电子电路技术领域, 尤其涉及一种通过 I2C从设备调试 MCU的 芯片及方法。 背景技术  The present invention relates to the field of electronic circuit technologies, and in particular, to a chip and method for debugging an MCU through an I2C slave device. Background technique
在传统的芯片系统中, I2C从设备通常是作为通用的数据传输接口。 芯片外 部与 MCU进行通信和调试主要是使用 JTAG、 UART等方式, 这样在芯片没有集成 JTAG、 UART等接口时, 就要为调试增加了额外的接口, 浪费了系统资源。 发明内容  In traditional chip systems, I2C slaves are typically used as general purpose data transfer interfaces. The external communication and debugging of the chip and the MCU mainly use JTAG, UART, etc., so that when the chip does not integrate JTAG, UART and other interfaces, additional interfaces are added for debugging, which wastes system resources. Summary of the invention
有鉴于此, 本发明要解决的技术问题是提供一种通过 I2C从设备调试 MCU 的芯片及方法, 以使 I2C从设备可随时停住和释放 MCU, 且可与 MCU执行的程序 进行握手操作, 用 I2C从设备来实现外设对 MCU的调试的功能, 节省系统资源, 并让调试更灵活。  In view of this, the technical problem to be solved by the present invention is to provide a chip and a method for debugging an MCU through an I2C slave device, so that the I2C slave device can stop and release the MCU at any time, and can perform a handshake operation with a program executed by the MCU. The I2C slave device is used to implement peripheral debugging of the MCU, saving system resources and making debugging more flexible.
本发明解决上述技术问题所采用的技术方案如下:  The technical solution adopted by the present invention to solve the above technical problems is as follows:
根据本发明的一个方面, 提供的一种通过 I2C从设备调试 MCU的芯片包括 I2C总线、 以及通过 I2C总线相连的 MCU、 I2C从设备和两个以上的外设, 其中, I2C从设备还用于在芯片外部 I2C主设备的控制下进入或退出调试 MCU的模式。  According to an aspect of the present invention, a chip for debugging an MCU through an I2C slave device includes an I2C bus, an MCU connected through an I2C bus, an I2C slave device, and two or more peripheral devices, wherein the I2C slave device is further used for Enter or exit the mode of debugging MCU under the control of the external I2C master of the chip.
优选地, I2C从设备包括 I2C有限状态机、 命令解析模块、 I2C中断处理模 块、 I2C寄存器、 FIFO写模块和 FIFO读模块, 其中, 命令解析模块、 I2C中断 处理模块、 I2C寄存器、 FIFO写模块和 FIFO读模块均与 I2C有限状态机相连, FIFO写模块和 FIFO读模块还分别与命令解析模块相连, I2C寄存器还与 I2C中 断处理模块相连;  Preferably, the I2C slave device includes an I2C finite state machine, a command parsing module, an I2C interrupt processing module, an I2C register, a FIFO write module, and a FIFO read module, wherein the command parsing module, the I2C interrupt processing module, the I2C register, the FIFO write module, and The FIFO read module is connected to the I2C finite state machine, and the FIFO write module and the FIFO read module are also respectively connected to the command parsing module, and the I2C register is also connected to the I2C interrupt processing module;
I2C从设备还包括模式控制模块, 模式控制模块分别与命令解析模块和 I2C 有限状态机相连, 用于接收命令解析模块发送的第一预定的字符串后, 向 MCU 的指令状态机发送停住 MCU 的信号, 并等待预定的系统时钟周期数后, 占据住 总线以供芯片外部的 I2C主设备与 MCU执行的程序进行握手; 还用于接收到命 令解析模块发送的第二预定的字符串后, 释放总线, 并向 MCU 的指令状态机发 送释放 MCU的信号。 The I2C slave device further includes a mode control module, and the mode control module is respectively connected to the command parsing module and the I2C finite state machine, and is configured to receive the first predetermined character string sent by the command parsing module, and then send the stop MCU to the instruction state machine of the MCU. Signal, and wait for a predetermined number of system clock cycles after occupying The bus handshaking between the I2C master device external to the chip and the program executed by the MCU; and is further configured to: after receiving the second predetermined character string sent by the command parsing module, release the bus, and send a signal for releasing the MCU to the instruction state machine of the MCU. .
优选地, 调试控制模块包括:  Preferably, the debug control module comprises:
监测单元, 用于监测是否接收到第一预定的字符串或者第二预定的字符串; a monitoring unit, configured to monitor whether a first predetermined character string or a second predetermined character string is received;
MCU控制单元, 用于接收到第一预定的字符串后, 向 MCU的指令状态机发送 停住 MCU的信号; 还用于接收到第二预定的字符串后, 向 MCU的指令状态机发 送释放 MCU的信号。 The MCU control unit is configured to: after receiving the first predetermined character string, send a signal for stopping the MCU to the instruction state machine of the MCU; and further, after receiving the second predetermined character string, send the release to the instruction state machine of the MCU. MCU signal.
总线控制单元, 用于接收到第一预定的字符串后, 等待预定的系统时钟周 期数后, 占据住总线; 还用于接收到第二预定的字符串后, 释放总线。  The bus control unit is configured to: after receiving the first predetermined character string, wait for a predetermined number of system clock cycles to occupy the bus; and further, after receiving the second predetermined character string, release the bus.
优选地, 调试控制模块包括:  Preferably, the debug control module comprises:
字符串寄存器 701、 比较器 702、 第一触发器 703、 第一非门 704、 第二非 门 705、第一与门 706、第二与门 707、第一或门 708、计数器 709、第一 MUX710、 第二 MUX71 第二或门 712、第二触发器 713、第三与门 714和第三触发器 715, 其中:  String register 701, comparator 702, first flip flop 703, first NOT gate 704, second NOT gate 705, first AND gate 706, second AND gate 707, first OR gate 708, counter 709, first MUX 710, second MUX 71 second OR gate 712, second flip-flop 713, third AND gate 714, and third flip-flop 715, wherein:
字符串寄存器 701, 用于接收 I2C主设备写入的字符串;  a string register 701, configured to receive a string written by the I2C master device;
比较器 702,用于比较字符串寄存器 701的字符串与预设的字符串是否相同, 根据比较结果输出高电平或者低电平信号给第一触发器 703;  The comparator 702 is configured to compare the string of the string register 701 with the preset string, and output a high level or low level signal to the first flip flop 703 according to the comparison result;
第一触发器 703, 用于将比较器 702的结果寄存一次, 输出到第一非门 704 和第二与门 707;  The first trigger 703 is configured to register the result of the comparator 702 once, and output to the first NOT gate 704 and the second AND gate 707;
第一非门 704, 用于将第一触发器 703 的输出取反, 然后输出到第一与门 The first NOT gate 704 is configured to invert the output of the first flip-flop 703 and then output to the first AND gate
706; 706;
第一与门 706,用于根据比较器 702的比较结果和第一非门 704的结果进行 与运算, 用于抓取比较器 702输出的信号的上升沿, 当其上升沿到来时, 产生 一个周期的高脉冲输出到第一或门 708;  The first AND gate 706 is configured to perform an AND operation according to the comparison result of the comparator 702 and the result of the first NOT gate 704, for grabbing the rising edge of the signal output by the comparator 702, and when the rising edge thereof comes, generating a The high pulse of the cycle is output to the first OR gate 708;
第二非门 705, 用于将比较器 702的输出取反, 然后输出到第二与门 707 ; 第二与门 707 ;用于根据第二非门 705的输出和第一触发器 703的输出进行 与运算, 用于抓取比较器 702 的输出信号的下降沿, 当其下降沿到来时, 产生 一个周期的高脉冲信号输出到第一或门 708;  a second NOT gate 705 for inverting the output of the comparator 702 and then outputting to the second AND gate 707; a second AND gate 707; for outputting according to the second NOT gate 705 and the output of the first flip-flop 703 Performing an AND operation for grabbing the falling edge of the output signal of the comparator 702, and when its falling edge comes, generating a high pulse signal of one cycle is output to the first OR gate 708;
第一或门 708,用于将来自第一与门 706以及第二与门 707的两个持续一个 周期的高脉冲信号都输出给计数器 709; a first OR gate 708 for continuing the two from the first AND gate 706 and the second AND gate 707 The high pulse signal of the cycle is output to the counter 709;
计数器 709,用于根据来自第一或门 708的持续一个周期的高脉冲信号作为 触发条件, 开始时钟周期的脉冲计数, 计数完毕后输出一个时钟周期的脉冲到 第一 MUX 710 ) 和第二 MUX 711 ;  The counter 709 is configured to start a pulse count of the clock cycle according to a high pulse signal of one cycle from the first OR gate 708, and output a pulse of one clock cycle to the first MUX 710 and the second MUX after the counting is completed. 711 ;
第一 MUX 710, 用于选择是输出低电平还是第二触发器 713的输出值作为第 二或门 712的一个输入, 当计数器 709的输出为高时, 选择低电平作为输出, 否则, 选择第二触发器 713的输出值作为输出;  The first MUX 710 is configured to select whether to output the low level or the output value of the second flip-flop 713 as an input of the second OR gate 712. When the output of the counter 709 is high, select the low level as the output, otherwise, Selecting an output value of the second flip-flop 713 as an output;
第二 MUX 711, 用于选择是输出高电平还是第三触发器 715的输出值作为第 三与门 714的一个输入, 当计数器 709的输出为高时, 选择高电平作为输出, 否则, 选择第三触发器 715的输出值作为输出;  The second MUX 711 is configured to select whether to output the high level or the output value of the third flip-flop 715 as an input of the third AND gate 714. When the output of the counter 709 is high, select the high level as the output, otherwise, Selecting an output value of the third flip-flop 715 as an output;
第二或门 712 以及第二触发器 713, 用于产生停住 MCU的信号, 当比较器 702的输出转变为高时, 其输出相应的转变为高, 并一直保持为高输出, 直到比 较器 702的输出转变为低、 并且由此触发的计数器 709计数且计数结束而产生 的一个周期的高脉冲到来时, 将其输出拉低;  The second OR gate 712 and the second flip-flop 713 are configured to generate a signal for stopping the MCU. When the output of the comparator 702 transitions to high, the output thereof is correspondingly turned high, and remains high until the comparator When the output of 702 transitions to low, and the counter 709 thus triggered counts and the high pulse of one cycle generated by the end of the counting comes, the output is pulled low;
第三与门 714以及第三触发器 715, 用于产生 I2C占住总线的信号, 当比较 器 702的输出转变为高、 并且由此触发的计数器 709计数且计数结束而产生的 一个中期的高脉冲到来时, 其输出相应的转变为高, 并一直保持为高输出, 直 到比较器 702的输出转变为低时, 将其输出拉低。  The third AND gate 714 and the third flip-flop 715 are configured to generate a signal that the I2C occupies the bus, when the output of the comparator 702 transitions to high, and the counter 709 thus triggered counts and the count ends, a mid-term high When the pulse arrives, its output transitions high and remains high until the output of comparator 702 goes low, pulling its output low.
优选地, 芯片外部的 I2C主设备与 MCU执行的程序进行握手包括: 芯片外 部的 I2C主设备对外设的读或写操作控制。  Preferably, the handshake of the I2C master device external to the chip and the program executed by the MCU includes: control of the read or write operation of the peripheral by the I2C master device outside the chip.
优选地, 预定的系统时钟周期数根据 MCU执行其指令集中最长的一条执行 所需要的时钟周期数来确定。  Preferably, the predetermined number of system clock cycles is determined based on the number of clock cycles required by the MCU to perform the longest execution of its instruction set.
优选地, 芯片内部外设包括: 读寄存器、 写寄存器、 程序存储器、 和 /或数 据存储器。  Preferably, the on-chip peripherals include: a read register, a write register, a program memory, and/or a data memory.
根据本发明的另一个方面, 提供的一种通过 I2C从设备调试 MCU的方法包 括:  According to another aspect of the present invention, a method for debugging an MCU through an I2C slave device is provided:
I2C从设备接收到第一预定的字符串后, 先向 MCU 的指令状态机发送停住 MCU的信号;  After receiving the first predetermined character string from the device, the I2C first sends a signal to the MCU's instruction state machine to stop the MCU;
等待预定的系统时钟周期数后, 占据住总线以供芯片外部的 I2C主设备与 MCU执行的程序进行握手; 接收到第二预定的字符串后, 先释放总线, 再向 MCU 的指令状态机发送释 放 MCU的信号。 Waiting for a predetermined number of system clock cycles, occupying the bus for the I2C master device outside the chip to handshake with the program executed by the MCU; After receiving the second predetermined character string, the bus is released first, and then the signal of the release MCU is sent to the instruction state machine of the MCU.
优选地, 预定的系统时钟周期数根据 MCU执行其指令集中最长的一条执行 所需要的时钟周期数来确定。  Preferably, the predetermined number of system clock cycles is determined based on the number of clock cycles required by the MCU to perform the longest execution of its instruction set.
优选地, 芯片外部的 I2C主设备与 MCU执行的程序进行握手包括: 芯片外 部的 I2C主设备对芯片外设的读或写操作控制。  Preferably, the handshake of the I2C master device external to the chip and the program executed by the MCU includes: the I2C master device outside the chip controls the read or write operation of the chip peripheral device.
本发明提供的一种通过 I2C从设备调试 MCU的芯片及方法, 在对 I2C从设 备的通用功能不影响的情况下, 使得 I2C从设备可以访问芯片内部所有的外设, 同时还可以停住和释放 MCU,作为调试接口实现外部 I2C主设备对芯片的 MCU进 行调试与 MCU握手的功能。 在芯片系统有 I2C从设备功能的情况下, 不用额外 增加其他调试接口就可以实现调试功能, 节省了对资源的消耗。 附图说明  The invention provides a chip and a method for debugging an MCU through an I2C slave device, so that the I2C slave device can access all peripheral devices in the chip while not affecting the general functions of the I2C slave device, and can also stop and The MCU is released, and the debugging interface is used to implement the function of debugging and MCU handshake of the MCU of the chip by the external I2C master device. In the case that the chip system has the function of the I2C slave device, the debugging function can be realized without additional debugging interface, and the resource consumption is saved. DRAWINGS
图 1是本发明实施例提供的一种通过 I2C从设备调试 MCU的芯片的控制示 意图。  FIG. 1 is a schematic diagram of control of a chip for debugging an MCU through an I2C slave device according to an embodiment of the present invention.
图 2是本发明实施例提供的一种 I2C从设备的结构示意图。  FIG. 2 is a schematic structural diagram of an I2C slave device according to an embodiment of the present invention.
图 3是本优选发明实施例提供的一种模式控制模块的结构示意图。  FIG. 3 is a schematic structural diagram of a mode control module according to an embodiment of the present invention.
图 4是本优选发明实施例提供的一种电路时序图。  4 is a circuit timing diagram of an embodiment of the preferred invention.
图 5是本发明实施例提供的一种通过 I2C从设备调试 MCU的方法流程图。 图 6是本发明优选实施例提供的一种通过 I2C从设备调试 MCU的方法流程 图。 具体实施方式  FIG. 5 is a flowchart of a method for debugging an MCU by using an I2C slave device according to an embodiment of the present invention. FIG. 6 is a flow chart of a method for debugging an MCU through an I2C slave device according to a preferred embodiment of the present invention. detailed description
为了使本发明所要解决的技术问题、 技术方案及有益效果更加清楚、 明白, 以下结合附图和实施例, 对本发明进行进一歩详细说明。 应当理解, 此处所描 述的具体实施例仅仅用以解释本发明, 并不用于限定本发明。  The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
实施例一  Embodiment 1
图 1是本发明实施例提供的一种通过 I2C从设备调试 MCU的芯片的控制示 意图, 该系统包括芯片 10和 I2C主设备 20, 其中:  1 is a control schematic diagram of a chip for debugging an MCU through an I2C slave device according to an embodiment of the present invention. The system includes a chip 10 and an I2C master device 20, wherein:
芯片 10, 包括 I2C总线 101、 MCU102、 I2C从设备 103和两个以上的外设 104。 MCU102、 I2C从设备 103和外设 104通过 I2C总线 101相连。 Chip 10, including I2C bus 101, MCU 102, I2C slave device 103 and more than two peripherals 104. The MCU 102, the I2C slave device 103 and the peripheral device 104 are connected through the I2C bus 101.
其中, I2C总线 101和 MCU102属于现有技术, I2C从设备 103除了保持现 有的通用数据传输接口功能外, 还可以用作调试接口, 在芯片外部 I2C主设备 20的控制下进入或退出调试 MCU的模式, 从而达到选择用于通用数据传输接口 或者调试接口。 外设 104也是现有的, 包括但不限于包括读寄存器、 写寄存器、 程序存储器和数据存储器。  The I2C bus 101 and the MCU 102 belong to the prior art. In addition to maintaining the existing universal data transmission interface function, the I2C slave device 103 can also be used as a debugging interface to enter or exit the debugging MCU under the control of the external I2C master device 20 of the chip. The mode is thus chosen to be used for a general data transfer interface or a debug interface. Peripherals 104 are also conventional and include, but are not limited to, read registers, write registers, program memory, and data memory.
I2C主设备 20, 用于通过发送预设的字符串控制芯片 10的 I2C从设备 103 作为通用数据传输接口或者调试接口。  The I2C master device 20 is configured to control the I2C slave device 103 of the chip 10 as a general data transmission interface or a debug interface by transmitting a preset character string.
具体来说, 在 I2C主设备 20需要对 MCU102进行调试或者访问芯片中的外 设 104时, 向芯片内部 I2C从设备 103发送预设的第一字符串, I2C从设备 103 接收到该预设的第一字符串后, 先停住 MCU102 , 且保持其所有状态不变, 然后 占据住 I2C总线 101, 这时, 外部 I2C主设备 20就可以完成所需要进行的任何 操作; 在操作完成之后, 外部 I2C主设备 20再向内部 I2C从设备 103预设的第 二字符串, I2C从设备 103接收到该预设的第二字符串后,先释放 I2C总线 101, 再释放 MCU102。内部 I2C从设备 103可以像 MCU102—样控制所有的芯片内部的 外设 104, 从而可以做到所有的调试工作都对 MCU102透明, MCU102可以在被释 放后正确的继续执行。 如图 2所示是本发明实施例提供的一种 I2C从设备的结构示意图,包括 I2C 有限状态机 1031、命令解析模块 1032、I2C中断处理模块 1033、I2C寄存器 1034、 FIFO写模块 1035、FIF0读模块 1036和模式控制模块 1037, 命令解析模块 1032、 I2C中断处理模块 1033、 I2C寄存器 1034、FIF0写模块 1035和 FIFO读模块 1036 均与 I2C有限状态机 1031相连, FIFO写模块 1036和 FIFO读模块 1036还分别 与命令解析模块 1032相连, I2C寄存器 1034还与 I2C中断处理模块 1033相连; 模式控制模块 1037分别与 I2C有限状态机 1031及命令解析模块 1032相连, 其 中:  Specifically, when the I2C master device 20 needs to debug the MCU 102 or access the peripheral device 104 in the chip, the preset first character string is sent to the chip internal I2C slave device 103, and the I2C slave device 103 receives the preset. After the first string, the MCU 102 is stopped first, and all its states are kept unchanged, and then the I2C bus 101 is occupied. At this time, the external I2C master device 20 can complete any operations required; after the operation is completed, the external After the I2C master device 20 receives the second character string preset by the internal I2C slave device 103, and after the I2C slave device 103 receives the preset second character string, the I2C bus 101 is released first, and then the MCU 102 is released. The internal I2C slave device 103 can control all of the internal peripherals 104 of the chip like the MCU 102, so that all debugging work is transparent to the MCU 102, and the MCU 102 can continue to execute correctly after being released. FIG. 2 is a schematic structural diagram of an I2C slave device according to an embodiment of the present invention, including an I2C finite state machine 1031, a command parsing module 1032, an I2C interrupt processing module 1033, an I2C register 1034, a FIFO write module 1035, and a FIF0 read. Module 1036 and mode control module 1037, command parsing module 1032, I2C interrupt processing module 1033, I2C register 1034, FIF0 write module 1035, and FIFO read module 1036 are all coupled to I2C finite state machine 1031, FIFO write module 1036 and FIFO read module 1036. Also connected to the command parsing module 1032, the I2C register 1034 is also connected to the I2C interrupt processing module 1033; the mode control module 1037 is connected to the I2C finite state machine 1031 and the command parsing module 1032, respectively:
I2C有限状态机(Finite State Machine) 1031 , 用于对 I2C从设备的工作 状态控制以及与 I2C主设备之间数据接收与发送。  The I2C Finite State Machine 1031 is used to control the working state of the I2C slave device and receive and transmit data with the I2C master device.
命令解析模块 (Command Decode ) 1032 , 用于对 I2C从设备接收到的命令 进行解析。 I2C中断处理模块(Interrupts) 1033, 用于对 I2C从设备的中断控制, 这 是 I2C从设备通用的通信功能。 Command Decode 1032 is used to parse commands received by the I2C slave device. I2C interrupt processing module (Interrupts) 1033, used for interrupt control of I2C slave devices, which is a common communication function of I2C slave devices.
I2C寄存器(Registers ) 1034,用于 I2C从设备与 MCU之间的交互,这是 I2C 从设备通用的通信功能。  The I2C register (Registers) 1034 is used for the interaction between the I2C slave device and the MCU, which is a common communication function of the I2C slave device.
FIFO写模块 1035,用于 I2C从设备对芯片内外设的写操作控制。  The FIFO write module 1035 is used for I2C slave device write control of the on-chip peripherals.
FIFO写模块 1036,用于 I2C从设备对芯片内外设的读操作控制。  The FIFO write module 1036 is used for I2C slave device read control of the on-chip peripherals.
模式控制模块 1037, 用于接收所述命令解析模块 1032发送的第一预定的 字符串后, 向 MCU的指令状态机发送停住 MCU的信号, 并等待预定的系统时钟 周期数后占据住总线以供芯片外部的 I2C主设备与 MCU执行的程序进行握手; 还用于接收到所述命令解析模块 1032发送的第二预定的字符串后, 释放总线, 并向 MCU的指令状态机发送释放 MCU的信号。  The mode control module 1037 is configured to: after receiving the first predetermined character string sent by the command parsing module 1032, send a signal for stopping the MCU to the instruction state machine of the MCU, and wait for a predetermined number of system clock cycles to occupy the bus. The I2C master device external to the chip performs a handshake with the program executed by the MCU; and is further configured to: after receiving the second predetermined character string sent by the command parsing module 1032, release the bus, and send the release MCU to the instruction state machine of the MCU. signal.
这里, 等待预定的系统时钟周期数是为了使 MCU有足够的时间将当前正在 执行的指令执行完毕, 故预定的时钟周期数可以根据本 MCU执行其指令集中最 长的一条执行所需要的时钟周期数来确定。  Here, waiting for the predetermined number of system clock cycles is to enable the MCU to have enough time to execute the currently executing instruction, so the predetermined number of clock cycles can be based on the clock cycle required by the MCU to execute the longest execution in its instruction set. Number to determine.
其中,模式控制模块 1037可以通过硬件电路来实现,也可以通过运行在 I2C 从设备上软件程序来实现。 按功能模块来划分, 模式控制模块可以包括: 监测 单元、 MCU控制单元和总线控制单元, 其中:  The mode control module 1037 can be implemented by a hardware circuit or by running a software program on the I2C slave device. Divided by functional modules, the mode control module may include: a monitoring unit, an MCU control unit, and a bus control unit, where:
监测单元, 用于监测是否接收到第一预定的字符串或者第二预定的字符串; MCU控制单元, 用于接收到第一预定的字符串后, 向 MCU的指令状态机发送 停住 MCU的信号; 还用于接收到第二预定的字符串后, 向 MCU的指令状态机发 送停住 MCU的信号。  a monitoring unit, configured to monitor whether a first predetermined character string or a second predetermined character string is received; the MCU control unit, configured to send the MCU to the instruction state machine of the MCU after receiving the first predetermined character string The signal is further configured to send a signal for stopping the MCU to the instruction state machine of the MCU after receiving the second predetermined character string.
总线控制单元, 用于接收到第一预定的字符串后, 等待预定的系统时钟周 期数后, 占据住总线; 还用于接收到第二预定的字符串后, 释放总线。  The bus control unit is configured to: after receiving the first predetermined character string, wait for a predetermined number of system clock cycles to occupy the bus; and further, after receiving the second predetermined character string, release the bus.
本实施例提供的一种 I2C从设备, 通过增加模式控制模块, 实现对 MCU的 停住或释放操作的控制以及 MCU被停住期间对总线的完全占用或释放的控制, 从而控制进入或退出调试 MCU模式, 使得 I2C从设备根据需要充当通用数据传 输接口或者调试接口。 如图 3 所示是本优选发明实施例提供的一种模式控制模块的结构示意图, 该模块包括: 字符串寄存器 701、 比较器 702、 第一触发器 703、 第一非门 704、 第二非门 705、 第一与门 706、 第二与门 707、 第一或门 708、 计数器 709、 第一The I2C slave device provided in this embodiment controls the stop or release operation of the MCU and the complete occupation or release of the bus during the MCU being stopped by adding the mode control module, thereby controlling the entry or exit of the debugging. The MCU mode enables the I2C slave device to act as a general data transfer interface or debug interface as needed. FIG. 3 is a schematic structural diagram of a mode control module according to an embodiment of the present invention. The module includes: a string register 701, a comparator 702, a first flip-flop 703, and a first NOT gate 704. Second NOT gate 705, first AND gate 706, second AND gate 707, first OR gate 708, counter 709, first
MUX (多路复用器) 710、 第二 MUX 711、 第二或门 712、 第二触发器 713、 第三与 门 714和第三触发器 715, 其中: MUX (multiplexer) 710, second MUX 711, second OR gate 712, second flip-flop 713, third AND gate 714, and third flip-flop 715, wherein:
字符串寄存器 701, 用于接收 I2C主设备写入的字符串;  a string register 701, configured to receive a string written by the I2C master device;
比较器 702,用于比较字符串寄存器 701的字符串与预设的字符串是否相同, 根据比较结果输出高电平或者低电平信号 (在本图所示的逻辑结构中, 均以高 电平有效作为示例, 但也可以设置低电平有效, 当设置低电平有效时, 后续电 路都进行相反调整) 给第一触发器 703 ;  The comparator 702 is configured to compare whether the character string of the string register 701 is the same as the preset character string, and output a high level or a low level signal according to the comparison result (in the logic structure shown in the figure, both are high-powered The level is valid as an example, but it can also be set to be active low. When the active low level is set, the subsequent circuits are reversely adjusted) to the first flip-flop 703;
第一触发器 703, 用于将比较器 702的结果寄存一次, 输出到第一非门 704 和第二与门 707;  The first trigger 703 is configured to register the result of the comparator 702 once, and output to the first NOT gate 704 and the second AND gate 707;
第一非门 704, 用于将第一触发器 703 的输出取反, 然后输出到第一与门 The first NOT gate 704 is configured to invert the output of the first flip-flop 703 and then output to the first AND gate
706; 706;
第一与门 706,用于根据比较器 702的比较结果和第一非门 704的结果进行 与运算, 用于抓取比较器 702输出的信号的上升沿 (因为本示例图是以比较结 果高电平有效方式设计的电路结构图) , 当其上升沿 (即比较结果由不相等转 变为相等) 到来时, 产生一个周期的高脉冲输出到第一或门 708;  The first AND gate 706 is configured to perform an AND operation according to the comparison result of the comparator 702 and the result of the first NOT gate 704 for grabbing the rising edge of the signal output by the comparator 702 (because the example image is high in comparison result) The circuit structure diagram of the level effective mode design, when its rising edge (ie, the comparison result is changed from unequal to equal), a high pulse output of one cycle is generated to the first OR gate 708;
第二非门 705, 用于将比较器 702的输出取反, 然后输出到第二与门 707 ; 第二与门 707 ;用于根据第二非门 705的输出和第一触发器 703的输出进行 与运算, 用于抓取比较器 702 的输出信号的下降沿 (因为本示例图是以比较结 果高有效方式设计的电路结构图) , 当其下降沿 (即比较结果由相等转变为不 相等) 到来时, 产生一个周期的高脉冲信号输出到第一或门 708;  a second NOT gate 705 for inverting the output of the comparator 702 and then outputting to the second AND gate 707; a second AND gate 707; for outputting according to the second NOT gate 705 and the output of the first flip-flop 703 Performing an AND operation to capture the falling edge of the output signal of the comparator 702 (because the example figure is a circuit structure diagram designed in a highly efficient manner of comparison), when its falling edge (ie, the comparison result is changed from equal to unequal) When coming, generate a cycle of high pulse signal output to the first OR gate 708;
第一或门 708,用于将来自第一与门 706以及第二与门 707的两个持续一个 周期的高脉冲信号都输出给后面的计数器 709 ;  a first OR gate 708 for outputting two high pulse signals from the first AND gate 706 and the second AND gate 707 for one cycle to a subsequent counter 709;
计数器 709,用于根据来自第一或门 708的持续一个周期的高脉冲信号作为 触发条件, 开始时钟周期的脉冲计数, 计数完毕后输出一个时钟周期的脉冲到 第一 MUX 710和第二 MUX 711。 其中, 计数周期个数以保证 MCU最长的一条指令 可以执行完为标准。  The counter 709 is configured to start a pulse counting of the clock cycle according to a high pulse signal of one cycle from the first OR gate 708, and output a pulse of one clock cycle to the first MUX 710 and the second MUX 711 after the counting is completed. . Among them, the number of counting cycles is to ensure that the longest instruction of the MCU can be executed as a standard.
第一 MUX 710, 用于选择是输出低电平 ( " 0 " ) 还是第二触发器 713的输 出值作为后面的第二或门 712的一个输入, 当计数器 709的输出为高时, 选择 低电平作为输出, 否则, 选择第二触发器 713的输出值作为输出; 第二 MUX 711, 用于选择是输出高电平 ( " 1 " ) 还是第三触发器 715的输 出值作为后面的第三与门 714的一个输入, 当计数器 709的输出为高时, 选择 高电平作为输出, 否则, 选择第三触发器 715的输出值作为输出; The first MUX 710 is configured to select whether to output a low level ("0") or an output value of the second flip-flop 713 as an input of the following second OR gate 712. When the output of the counter 709 is high, select low. Level as an output, otherwise, the output value of the second flip-flop 713 is selected as an output; The second MUX 711 is configured to select whether to output a high level ("1") or an output value of the third flip-flop 715 as an input of the following third AND gate 714. When the output of the counter 709 is high, select high. Level as an output, otherwise, the output value of the third flip-flop 715 is selected as an output;
第二或门 712以及第二触发器 713, 用于产生停住 MCU的信号, 在本示例中 以该信号高有效作为示例, 当比较器 702 的输出转变为高 (即相等) 时, 其输 出相应的转变为高, 并一直保持为高输出,直到比较器 702的输出转变为低(即 不相等) 、 并且由此触发的计数器 709计数且计数结束而产生的一个周期的高 脉冲到来时, 将其输出拉低;  The second OR gate 712 and the second flip-flop 713 are configured to generate a signal for stopping the MCU. In this example, the signal is high-efficiency as an example. When the output of the comparator 702 transitions to high (ie, equal), its output The corresponding transition is high and remains high until the output of comparator 702 transitions low (ie, unequal), and the counter 709 thus triggered counts and the high pulse of one cycle resulting from the end of the count arrives, Pull its output low;
第三与门 714以及第三触发器 715, 用于产生 I2C占住总线的信号, 在本示 例中, 该信号以高有效作为示例, 当比较器 702 的输出转变为高 (即相等) 、 并且由此触发的计数器 709计数且计数结束而产生的一个中期的高脉冲到来时, 其输出相应的转变为高, 并一直保持为高输出, 直到比较器 702 的输出转变为 低 (即不相等) 时, 将其输出拉低。  a third AND gate 714 and a third flip-flop 715 for generating a signal that the I2C occupies the bus. In this example, the signal is exemplified by high efficiency, when the output of the comparator 702 transitions high (ie, equal), and When the counter 709 thus triggered counts and the mid-high pulse generated by the end of the count comes, its output transitions to high and remains high until the output of comparator 702 transitions low (ie, not equal). When you pull its output low.
本实施例的模式控制模块仅仅举例说明, 该举例中, 所有信号都以高有效 为前提进行的设计, 包括电路实现过程中的中间信号以及最后的输出信号 (停 住 MCU信号以及占住总线信号) , 对应的电路波形图如图 4所示, 图 4中双斜 杠 "〃 "表示省略了若干周期, 具体情况, 由设计者确定。 具体实现中, 只要 能够保证字符串序列的比较器 702的输出与输出信号 (停住 MCU信号以及占住 总线信号) 之间的对应关系, 其他部分均可替换; 输入、 输出信号, 以及中间 的信号是高有效还是低有效, 均可由设计者自行定义。 如图 5所示是本发明实施例提供的一种通过 I2C从设备调试 MCU的方法流 程图, 该方法包括:  The mode control module of this embodiment is merely illustrative. In this example, all signals are designed with high efficiency as the premise, including the intermediate signal in the circuit implementation process and the final output signal (stopping the MCU signal and occupying the bus signal). The corresponding circuit waveform diagram is shown in Fig. 4. The double slash "〃" in Fig. 4 indicates that several cycles are omitted, and the specific situation is determined by the designer. In a specific implementation, as long as the correspondence between the output of the comparator 702 of the string sequence and the output signal (stopping the MCU signal and occupying the bus signal) can be ensured, other parts can be replaced; the input, the output signal, and the middle Whether the signal is active high or low is valid by the designer. FIG. 5 is a flowchart of a method for debugging an MCU by using an I2C slave device according to an embodiment of the present invention, where the method includes:
S50U I2C从设备接收到第一预设的字符串后, 向 MCU的指令状态机发送停 住 MCU的信号;  After receiving the first preset character string, the S50U I2C sends a signal to stop the MCU to the instruction state machine of the MCU;
5502、 等待预定的系统时钟周期数后, 占据住总线以供芯片外部的 I2C主 设备与 MCU执行的程序进行握手;  5502. After waiting for a predetermined number of system clock cycles, occupy the bus for the I2C master device outside the chip to handshake with the program executed by the MCU;
5503、 接收到第二预定的字符串后, 释放总线, 并向 MCU 的指令状态机发 送释放 MCU的信号。  5503. After receiving the second predetermined character string, release the bus, and send a signal for releasing the MCU to the instruction state machine of the MCU.
本实例的方法可以通过硬件电路来实现, 也可以通过运行在 I2C从设备上 软件程序来实现。 当 I2C从设备检测到 I2C主设备发送的第一预定的字符串, 先停住 MCU, 且保持其所有状态不变, 然后占据住总线, 这时, I2C主设备就可 以完成所需要进行的任何操作; 在操作完成之后, I2C 主设备再向内部 I2C从 设备第二预定的字符串, 当 I2C从设备检测到该第二预定的字符串后, 先释放 总线, 再释放 MCU, 从而可以做到所有的调试工作都对 MCU透明, MCU可以在被 释放后正确的继续执行之前执行完的指令的下一条指令。 如图 6所示是本发明优选实施例提供的一种通过 I2C从设备调试 MCU的方 法流程图, 该方法包括: The method of this example can be implemented by a hardware circuit or by running on an I2C slave device. Software program to achieve. When the I2C slave detects the first predetermined character string sent by the I2C master device, stops the MCU first, keeps all its states unchanged, and then occupies the bus. At this time, the I2C master device can complete any required After the operation is completed, the I2C master device sends a second predetermined string to the internal I2C slave device. After the I2C slave device detects the second predetermined string, the bus is released and the MCU is released. All debugging work is transparent to the MCU, and the MCU can continue to execute the next instruction of the executed instruction before it is released. FIG. 6 is a flowchart of a method for debugging an MCU by using an I2C slave device according to a preferred embodiment of the present invention, where the method includes:
5601、 I2C从设备保持通用的功能;  5601, I2C slave device maintains common functions;
5602、 判断是否收到预定的第一字符串, 如果是, 执行歩骤 S603 , 否则回 到歩骤 S601 ;  5602. Determine whether the predetermined first character string is received. If yes, execute step S603; otherwise, return to step S601;
5603、 向 MCU的指令执行状态机发送停止 MCU的信号;  S603. Send a signal for stopping the MCU to the instruction execution state machine of the MCU.
5604、 等待预定的时钟周期, 挂起 MCU;  5604. Wait for a predetermined clock cycle, suspending the MCU;
5605、 占据住总线以供 I2C主设备使用;  5605, occupying the bus for use by the I2C master device;
5606、 I2C主设备执行操作;  5606. The I2C master device performs an operation.
5607、 I2C主设备发送第二预设的字符串;  5607. The I2C master device sends a second preset character string.
5608、 I2C从设备释放总线;  5608, I2C slave bus releases the bus;
5609、 向 MCU的指令状态机发送释放 MCU的信号;  5609. Send a signal for releasing the MCU to the instruction state machine of the MCU.
5610、 MCU继续执行原功能, 转至歩骤 S601。  5610. The MCU continues to perform the original function, and then proceeds to step S601.
以上参照附图说明了本发明的优选实施例, 并非因此局限本发明的权利范 围。 本领域技术人员不脱离本发明的范围和实质, 可以有多种变型方案实现本 发明, 比如作为一个实施例的特征可用于另一实施例而得到又一实施例。 凡在 运用本发明的技术构思之内所作的任何修改、 等同替换和改进, 均应在本发明 的权利范围之内。 工业实用性  The preferred embodiments of the present invention have been described above with reference to the drawings, and are not intended to limit the scope of the invention. A person skilled in the art can implement the invention in various variants without departing from the scope and spirit of the invention. For example, the features of one embodiment can be used in another embodiment to obtain a further embodiment. Any modifications, equivalent substitutions and improvements made within the technical concept of the invention are intended to be included within the scope of the invention. Industrial applicability
本发明提供的一种通过 I2C从设备调试 MCU的芯片及方法, 在对 I2C从设 备的通用功能不影响的情况下, 使得 I2C从设备可以访问芯片内部所有的外设, 同时还可以停住和释放 MCU,作为调试接口实现外部 I2C主设备对芯片的 MCU进 行调试与 MCU握手的功能。 在芯片系统有 I2C从设备功能的情况下, 不用额外 增加其他调试接口就可以实现调试功能, 节省了对资源的消耗。 The invention provides a chip and a method for debugging an MCU through an I2C slave device, so that the I2C slave device can access all peripheral devices in the chip while not affecting the general functions of the I2C slave device, and can also stop and Release the MCU and use the debug interface to implement the external I2C master device to the MCU of the chip. The function of line debugging and MCU handshake. In the case that the chip system has the function of the I2C slave device, the debugging function can be realized without adding another debugging interface, and the resource consumption is saved.

Claims

权 利 要 求 书 claims
1、 一种通过 I2C从设备调试 MCU的芯片, 该芯片包括 I2C总线、 以及通过 所述 I2C总线相连的 MCU、 I2C从设备和两个以上的外设, 其中, 所述 I2C从设 备还用于在芯片外部 I2C主设备的控制下进入或退出调试 MCU的模式。 1. A chip for debugging an MCU through an I2C slave device. The chip includes an I2C bus, an MCU, an I2C slave device and two or more peripherals connected through the I2C bus, wherein the I2C slave device is also used for Enter or exit the debugging MCU mode under the control of the external I2C master device of the chip.
2、 根据权利要求 1所述的芯片, 其中, 所述 I2C从设备包括 I2C有限状态 机、 命令解析模块、 I2C中断处理模块、 I2C寄存器、 FIFO写模块和 FIFO读模 块, 其中, 所述命令解析模块、 所述 I2C中断处理模块、 所述 I2C寄存器、 所 述 FIFO写模块和 所述 FIFO读模块均与所述 I2C有限状态机相连, 所述 FIFO 写模块和 所述 FIFO读模块还分别与所述命令解析模块相连, 所述 I2C寄存器 还与所述 I2C中断处理模块相连; 2. The chip according to claim 1, wherein the I2C slave device includes an I2C finite state machine, a command parsing module, an I2C interrupt processing module, an I2C register, a FIFO writing module and a FIFO reading module, wherein the command parsing module, the I2C interrupt processing module, the I2C register, the FIFO writing module and the FIFO reading module are all connected to the I2C finite state machine, and the FIFO writing module and the FIFO reading module are also connected to the FIFO reading module respectively. The command parsing module is connected, and the I2C register is also connected to the I2C interrupt processing module;
所述 I2C从设备还包括模式控制模块, 所述模式控制模块分别与所述命令 解析模块和所述 I2C有限状态机相连, 用于接收所述命令解析模块发送的第一 预定的字符串后, 向 MCU的指令状态机发送停住 MCU的信号, 并等待预定的系 统时钟周期数后, 占据住总线以供芯片外部的 I2C主设备与 MCU执行的程序进 行握手; 还用于接收到所述命令解析模块发送的第二预定的字符串后, 释放总 线, 并向 MCU的指令状态机发送释放 MCU的信号。 The I2C slave device also includes a mode control module, which is connected to the command parsing module and the I2C finite state machine respectively, and is used to receive the first predetermined string sent by the command parsing module, Send a signal to stop the MCU to the instruction state machine of the MCU, and after waiting for a predetermined number of system clock cycles, occupy the bus for the I2C master device outside the chip to shake hands with the program executed by the MCU; also used to receive the command After parsing the second predetermined string sent by the module, the bus is released, and a signal to release the MCU is sent to the instruction state machine of the MCU.
3、 根据权利要求 2所述的芯片, 其中, 所述调试控制模块包括: 3. The chip according to claim 2, wherein the debugging control module includes:
监测单元, 用于监测是否接收到第一预定的字符串或者第二预定的字符串; MCU控制单元, 用于接收到第一预定的字符串后, 向 MCU的指令状态机发送 停住 MCU的信号; 还用于接收到第二预定的字符串后, 向 MCU的指令状态机发 送释放 MCU的信号。 The monitoring unit is used to monitor whether the first predetermined character string or the second predetermined character string is received; the MCU control unit is used to send a message to the MCU's instruction state machine to stop the MCU after receiving the first predetermined character string. Signal; also used to send a signal to release the MCU to the instruction state machine of the MCU after receiving the second predetermined string.
总线控制单元, 用于接收到第一预定的字符串后, 等待预定的系统时钟周 期数后, 占据住总线; 还用于接收到第二预定的字符串后, 释放总线。 The bus control unit is configured to wait for a predetermined number of system clock cycles before occupying the bus after receiving the first predetermined string; and to release the bus after receiving the second predetermined string.
4、 根据权利要求 2所述的芯片, 其中, 所述调试控制模块包括: 4. The chip according to claim 2, wherein the debugging control module includes:
字符串寄存器 ( 701 )、比较器( 702 )、第一触发器 ( 703 ) ,第一非门 ( 704 ) , 第二非门 (705 ) 、 第一与门 (706 ) 、 第二与门 (707 ) 、 第一或门 (708 ) 、 计数器 (709 ) 、 第一 MUX ( 710 ) 、 第二 MUX ( 711 ) 、 第二或门 (712 ) 、 第二 触发器 (713 ) 、 第三与门 (714) 和第三触发器 (715 ) , 其中: 字符串寄存器 (701), 用于接收 I2C主设备写入的字符串; String register (701), comparator (702), first flip-flop (703), first NOT gate (704), second NOT gate (705), first AND gate (706), second AND gate (706) 707), first OR gate (708), counter (709), first MUX (710), second MUX (711), second OR gate (712), second flip-flop (713), third AND gate (714) and the third flip-flop (715), where: String register (701), used to receive strings written by the I2C master device;
比较器 (702) , 用于比较字符串寄存器 (701) 的字符串与预设的字符串 是否相同, 根据比较结果输出高电平或者低电平信号给第一触发器 (703) ; 第一触发器 (703) , 用于将比较器 (702) 的结果寄存一次, 输出到第一 非门 (704) 和第二与门 (707) ; The comparator (702) is used to compare whether the string in the string register (701) is the same as the preset string, and output a high level or low level signal to the first flip-flop (703) according to the comparison result; the first Flip-flop (703), used to register the result of the comparator (702) once and output it to the first NOT gate (704) and the second AND gate (707);
第一非门 (704) , 用于将第一触发器 (703) 的输出取反, 然后输出到第 一与门 (706) ; The first NOT gate (704) is used to invert the output of the first flip-flop (703), and then output it to the first AND gate (706);
第一与门 (706) , 用于根据比较器 (702) 的比较结果和第一非门 (704) 的结果进行与运算, 用于抓取比较器 (702) 输出的信号的上升沿, 当其上升沿 到来时, 产生一个周期的高脉冲输出到第一或门 (708) ; The first AND gate (706) is used to perform an AND operation based on the comparison result of the comparator (702) and the result of the first NOT gate (704), and is used to capture the rising edge of the signal output by the comparator (702). When When its rising edge arrives, a period of high pulse is generated and output to the first OR gate (708);
第二非门 (705) , 用于将比较器 (702) 的输出取反, 然后输出到第二与 门 (707) ; The second NOT gate (705) is used to invert the output of the comparator (702), and then output it to the second AND gate (707);
第二与门 (707) ; 用于根据第二非门 (705) 的输出和第一触发器 (703) 的输出进行与运算, 用于抓取比较器 (702) 的输出信号的下降沿, 当其下降沿 到来时, 产生一个周期的高脉冲信号输出到第一或门 (708) ; The second AND gate (707) is used to perform an AND operation based on the output of the second NOT gate (705) and the output of the first flip-flop (703), and is used to capture the falling edge of the output signal of the comparator (702), When its falling edge arrives, a periodic high pulse signal is generated and output to the first OR gate (708);
第一或门 (708) , 用于将来自第一与门 (706) 以及第二与门 (707) 的两 个持续一个周期的高脉冲信号都输出给计数器 (709) ; The first OR gate (708) is used to output two high pulse signals lasting one cycle from the first AND gate (706) and the second AND gate (707) to the counter (709);
计数器 (709) , 用于根据来自第一或门 (708) 的持续一个周期的高脉冲 信号作为触发条件, 开始时钟周期的脉冲计数, 计数完毕后输出一个时钟周期 的脉冲到第一 MUX (710) 和第二 MUX (711) ; The counter (709) is used to start pulse counting of a clock cycle based on the high pulse signal lasting one cycle from the first OR gate (708) as a trigger condition, and after the counting is completed, output a pulse of a clock cycle to the first MUX (710 ) and the second MUX (711);
第一 MUX (710) , 用于选择是输出低电平还是第二触发器 (713) 的输出 值作为第二或门 (712) 的一个输入, 当计数器 (709) 的输出为高时, 选择低 电平作为输出, 否则, 选择第二触发器 (713) 的输出值作为输出; The first MUX (710) is used to select whether to output a low level or the output value of the second flip-flop (713) as an input of the second OR gate (712). When the output of the counter (709) is high, select The low level is used as the output, otherwise, the output value of the second flip-flop (713) is selected as the output;
第二 MUX (711) , 用于选择是输出高电平还是第三触发器 (715) 的输出 值作为第三与门 (714) 的一个输入, 当计数器 (709) 的输出为高时, 选择高 电平作为输出, 否则, 选择第三触发器 (715) 的输出值作为输出; The second MUX (711) is used to select whether to output a high level or the output value of the third flip-flop (715) as an input of the third AND gate (714). When the output of the counter (709) is high, select High level is used as the output, otherwise, the output value of the third flip-flop (715) is selected as the output;
第二或门 (712) 以及第二触发器 (713) , 用于产生停住 MCU 的信号, 当 比较器 (702) 的输出转变为高时, 其输出相应的转变为高, 并一直保持为高输 出, 直到比较器 (702) 的输出转变为低、 并且由此触发的计数器 (709) 计数 且计数结束而产生的一个周期的高脉冲到来时, 将其输出拉低; 第三与门 (714) 以及第三触发器 (715 ) , 用于产生 I2C占住总线的信号, 当比较器 (702 ) 的输出转变为高、 并且由此触发的计数器 (709 ) 计数且计数 结束而产生的一个中期的高脉冲到来时, 其输出相应的转变为高, 并一直保持 为高输出, 直到比较器 (702 ) 的输出转变为低时, 将其输出拉低。 The second OR gate (712) and the second flip-flop (713) are used to generate a signal to stop the MCU. When the output of the comparator (702) changes to high, its output correspondingly changes to high and remains high. The output is high until the output of the comparator (702) changes to low and the counter (709) triggered thereby counts and the high pulse of one cycle generated when the counting ends arrives, and its output is pulled low; The third AND gate (714) and the third flip-flop (715) are used to generate a signal that the I2C occupies the bus. When the output of the comparator (702) transitions to high, and the counter (709) triggered thereby counts and counts When a mid-term high pulse generated at the end arrives, its output correspondingly changes to high, and remains high until the output of the comparator (702) changes to low, and its output is pulled low.
5、 根据权利要求 2所述的芯片, 其中, 所述芯片外部的 I2C主设备与 MCU 执行的程序进行握手包括: 芯片外部的 I2C主设备对所述外设的读或写操作控 制。 5. The chip according to claim 2, wherein the handshake between the I2C master device outside the chip and the program executed by the MCU includes: the I2C master device outside the chip controls the read or write operation of the peripheral device.
6、 根据权利要求 2所述的芯片,其中,所述预定的系统时钟周期数根据 MCU 执行其指令集中最长的一条执行所需要的时钟周期数来确定。 6. The chip according to claim 2, wherein the predetermined number of system clock cycles is determined based on the number of clock cycles required by the MCU to execute the longest one in its instruction set.
7、 根据权利要求 1-6任意一项权利要求所述的芯片, 其中, 所述芯片内部 外设包括: 读寄存器、 写寄存器、 程序存储器、 和 /或数据存储器。 7. The chip according to any one of claims 1 to 6, wherein the internal peripherals of the chip include: read registers, write registers, program memory, and/or data memory.
8、 一种通过 I2C从设备调试 MCU的方法, 其中, 该方法包括: 8. A method of debugging MCU through I2C slave device, wherein the method includes:
I2C从设备接收到第一预定的字符串后, 先向 MCU 的指令状态机发送停住 MCU的信号; After the I2C slave device receives the first predetermined string, it first sends a signal to the MCU's command state machine to stop the MCU;
等待预定的系统时钟周期数后, 占据住总线以供芯片外部的 I2C主设备与 MCU执行的程序进行握手; After waiting for a predetermined number of system clock cycles, the bus is occupied for handshaking between the I2C master device outside the chip and the program executed by the MCU;
接收到第二预定的字符串后, 先释放总线, 再向 MCU 的指令状态机发送释 放 MCU的信号。 After receiving the second predetermined string, the bus is first released, and then a signal to release the MCU is sent to the instruction state machine of the MCU.
9、 根据权利要求 8所述的方法,其中,所述预定的系统时钟周期数根据 MCU 执行其指令集中最长的一条执行所需要的时钟周期数来确定。 9. The method of claim 8, wherein the predetermined number of system clock cycles is determined based on the number of clock cycles required by the MCU to execute the longest one in its instruction set.
10、 根据权利要求 8所述的方法, 其中, 所述芯片外部的 I2C主设备与 MCU 执行的程序进行握手包括: 芯片外部的 I2C主设备对芯片外设的读或写操作控 制。 10. The method according to claim 8, wherein the handshake between the I2C master device outside the chip and the program executed by the MCU includes: the I2C master device outside the chip controls the read or write operation of the chip peripherals.
PCT/CN2014/080725 2013-08-22 2014-06-25 Chip and method for debugging mcu by using i2c slave device WO2015024414A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310369678.2 2013-08-22
CN201310369678.2A CN103440216B (en) 2013-08-22 2013-08-22 A kind of by I2C from the chip of equipment debugging MCU and method

Publications (1)

Publication Number Publication Date
WO2015024414A1 true WO2015024414A1 (en) 2015-02-26

Family

ID=49693907

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/080725 WO2015024414A1 (en) 2013-08-22 2014-06-25 Chip and method for debugging mcu by using i2c slave device

Country Status (2)

Country Link
CN (1) CN103440216B (en)
WO (1) WO2015024414A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033444A (en) * 2022-08-10 2022-09-09 合肥健天电子有限公司 8051 core-based online debugging circuit control device and control method

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440216B (en) * 2013-08-22 2016-12-28 深圳市汇顶科技股份有限公司 A kind of by I2C from the chip of equipment debugging MCU and method
CN104899144B (en) * 2015-06-18 2018-06-15 深圳市新格林耐特通信技术有限公司 A kind of adjustment method interrupted based on serial ports
CN105718396B (en) * 2016-01-21 2018-05-29 哈尔滨理工大学 A kind of I of big data master transmissions2C bus units and its means of communication
CN106021041B (en) * 2016-04-29 2020-01-03 中国科学技术大学 Multi-cycle non-pipeline CPU debugging method based on finite state machine
CN106126452B (en) * 2016-06-17 2019-01-01 北京大学 The method that (SuSE) Linux OS based on IIC agreement is communicated with bare machine
CN105930294A (en) * 2016-06-25 2016-09-07 张宏彬 Digital IIC (Inter-Integrated Circuit) system based on state machine
CN107704417A (en) * 2017-09-13 2018-02-16 成都锐成芯微科技股份有限公司 The method and its communication system to be communicated with equipment under test
CN107967230A (en) * 2017-11-30 2018-04-27 广东高云半导体科技股份有限公司 I3C circuit arrangements, system and communication means
CN110651448B (en) * 2018-03-21 2022-10-04 深圳市汇顶科技股份有限公司 Chip access method, microchip, smart card and debugging equipment
CN112134814B (en) * 2020-08-24 2022-04-12 合肥学院 Board-level internet structure and communication method
CN112052132B (en) * 2020-09-11 2022-09-06 厦门紫光展锐科技有限公司 Method, device, equipment and medium for debugging plug-in chip through SDIO interface
CN112612667B (en) * 2020-12-24 2022-11-22 天津国芯科技有限公司 Tracking debugging information processing circuit and method for SoC chip
CN112948242A (en) * 2021-02-23 2021-06-11 深圳宝新创科技股份有限公司 Debugging method of embedded controller, terminal equipment and storage medium
CN113704104B (en) * 2021-08-25 2024-02-27 宏晶微电子科技股份有限公司 Program debugging method, device, system, electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060069831A1 (en) * 2004-09-29 2006-03-30 Mitsubishi Denki Kabushi Kaisha I2C bus controlling method
CN1821914A (en) * 2006-01-13 2006-08-23 深圳创维-Rgb电子有限公司 Controller soft realizing method from I2C bus
CN101208682A (en) * 2005-04-29 2008-06-25 皇家飞利浦电子股份有限公司 Slave device with latched request for service
CN103440216A (en) * 2013-08-22 2013-12-11 深圳市汇顶科技股份有限公司 Chip and method for debugging MCU through I2C slave unit

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6912606B2 (en) * 2001-06-08 2005-06-28 Sycamore Networks, Inc. Generic serial bus architecture
CN1770883A (en) * 2005-09-16 2006-05-10 深圳创维-Rgb电子有限公司 Method and apparatus for carrying out debugging for 12C component characteristic parameter
KR100801759B1 (en) * 2005-12-29 2008-02-11 엠텍비젼 주식회사 Device and system for debugging device using control bus
CN101998135A (en) * 2009-08-13 2011-03-30 上海摩威电子科技有限公司 System for collecting and playing mobile television signal and control method
CN103164313A (en) * 2011-12-12 2013-06-19 鸿富锦精密工业(深圳)有限公司 Debugging system and debugging method
CN102421010A (en) * 2011-12-31 2012-04-18 四川长虹电器股份有限公司 Software debugging system and method compatible to video graphics array (VGA) port input

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060069831A1 (en) * 2004-09-29 2006-03-30 Mitsubishi Denki Kabushi Kaisha I2C bus controlling method
CN101208682A (en) * 2005-04-29 2008-06-25 皇家飞利浦电子股份有限公司 Slave device with latched request for service
CN1821914A (en) * 2006-01-13 2006-08-23 深圳创维-Rgb电子有限公司 Controller soft realizing method from I2C bus
CN103440216A (en) * 2013-08-22 2013-12-11 深圳市汇顶科技股份有限公司 Chip and method for debugging MCU through I2C slave unit

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HE, YIBIN;: "Research on I2C Bus and Design of its Application System", 24 February 2004 (2004-02-24), pages 3 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115033444A (en) * 2022-08-10 2022-09-09 合肥健天电子有限公司 8051 core-based online debugging circuit control device and control method

Also Published As

Publication number Publication date
CN103440216B (en) 2016-12-28
CN103440216A (en) 2013-12-11

Similar Documents

Publication Publication Date Title
WO2015024414A1 (en) Chip and method for debugging mcu by using i2c slave device
JP4733877B2 (en) Semiconductor device
US8018784B2 (en) Semiconductor device and data processor
TWI731200B (en) A slave device connnected to host by 12c bus and its communication method
JP5182513B2 (en) Image processing apparatus and power saving control method thereof
CN103914424B (en) LPC peripheral expansion method based on GPIO interface and device
JP2011065685A (en) Bus system based on open type core protocol
CN104881388A (en) FPGA (field programmable gate array) based USB3.0 interface module
US20070240011A1 (en) FIFO memory data pipelining system and method for increasing I²C bus speed
JP2011095978A (en) Bus system and bus control method
WO2023019753A1 (en) Communication control method, system and apparatus for i2c bus
US20050091564A1 (en) Data transfer control device, electronic instrument, and data transfer control method
CN103810127B (en) USB low-speed devices data transfer control method and controller
WO2019217077A1 (en) Latency optimized i3c virtual gpio with configurable operating mode and device skip
CN105718396A (en) I<2>C bus device with big data master device transmission function and communication method thereof
WO2023103297A1 (en) System and method for optimizing ahb bus data transmission performance, and server
CN107566296A (en) Interface equipment and interface method
US6874047B1 (en) System and method for implementing an SMBus/I2C interface on a network interface card
JP2008041106A (en) Semiconductor integrated circuit device, clock control method and data transfer control method
CN204706031U (en) Serial peripheral equipment interface SPI bus circuit and electronic equipment
JP2009163531A (en) Interruption management mechanism and microcomputer
US20200065274A1 (en) Always-on ibi handling
CN102402492B (en) Communication method for server management module and timing control module
CN213715913U (en) Micro control system
CN206991304U (en) A kind of microprocessor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14837387

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14837387

Country of ref document: EP

Kind code of ref document: A1