MCU pin function configuration method based on SOC chip and SOC chip

文档序号:153089 发布日期:2021-10-26 浏览:210次 中文

阅读说明:本技术 基于soc芯片的mcu引脚功能配置方法及soc芯片 (MCU pin function configuration method based on SOC chip and SOC chip ) 是由 张永强 谭贵勇 彭观振 于 2021-09-22 设计创作,主要内容包括:本发明涉及芯片设计技术领域,包括以下步骤:启动SOC芯片,并带动MCU上电;统一SOC芯片和MCU的通讯接口以及通讯协议;SOC芯片加载客制化配置信息,并将所述客制化配置信息发送给MCU;MCU完成初始配置。通过同意SOC芯片与MCU的通讯接口和通讯协议,从SOC芯片加载客制化配置信息,再将客制化配置信息发送到MCU,使MCU完成初始化配置,在使用过程中还可以从SOC芯片中动态加载不同的配置信息,从而使MCU读取不同的设置状态,全程只需要修改SOC部分功能即可实现MCU引脚功能的配置,使MCU引脚功能的配置过程更加方便快捷,大大地节省了研发成本和维护成本。(The invention relates to the technical field of chip design, which comprises the following steps: starting the SOC chip and driving the MCU to be powered on; unifying communication interfaces and communication protocols of the SOC chip and the MCU; the SOC chip loads customized configuration information and sends the customized configuration information to the MCU; the MCU completes the initial configuration. By agreeing with the communication interface and the communication protocol between the SOC chip and the MCU, customized configuration information is loaded from the SOC chip and then sent to the MCU, so that the MCU completes initialization configuration, different configuration information can be dynamically loaded from the SOC chip in the use process, the MCU reads different setting states, the configuration of the MCU pin function can be realized only by modifying partial functions of the SOC in the whole process, the configuration process of the MCU pin function is more convenient and faster, and the research and development cost and the maintenance cost are greatly saved.)

1. The MCU pin function configuration method based on the SOC chip is characterized by comprising the following steps:

starting the SOC chip and driving the MCU to be powered on;

unifying communication interfaces and communication protocols of the SOC chip and the MCU;

the SOC chip loads customized configuration information and sends the customized configuration information to the MCU;

the MCU completes the initial configuration.

2. The method of claim 1, wherein the MCU further comprises the following steps after completing the initial configuration:

the MCU dynamically reads configuration state information sent by the SOC chip;

the MCU main program executes corresponding setting.

3. The SOC chip-based MCU pin function configuration method of claim 2, wherein the MCU main program executing corresponding settings specifically comprises:

and setting the pin function configuration of the MCU.

4. The method of claim 3, wherein the functional configuration comprises: inquiring version number, setting and/or inquiring IO level, serial port conversion and MCU firmware upgrade.

5. The method of claim 3, wherein the functional configuration further comprises: the USB descriptor is dynamically configured.

6. The method of claim 1, wherein the communication protocol is in the format of:

function + length of parameter + 1 + 2 + 3 +. + n.

7. The method of claim 1, wherein the SOC chip loads customized configuration information, and after sending the customized configuration information to the MCU, the MCU stores the customized configuration information locally.

8. An SOC chip, characterized in that, the method for configuring the pin function of MCU based on SOC chip as claimed in any of claims 1 to 7 is executed, comprising a CPU and an MCU, the CPU sends the content of the communication protocol to the MCU through a communication interface.

9. The SOC chip according to claim 8, wherein the CPU is unified with the MCU.

Technical Field

The invention relates to the technical field of chip design, in particular to an MCU pin function configuration method based on an SOC chip and the SOC chip.

Background

In the System circuit design of an all-in-one machine, the insufficient number of pins of GPIO, UART, USB, and the like of an SOC (System on Chip, also called System on Chip) is often made up by adding an MCU (micro controller Unit, also called a single Chip microcomputer or a single Chip microcomputer). In use, because the peripheral equipment accessed by the system is not fixed, the control modes are different, and the software of the SOC and the MCU needs to be adjusted simultaneously to adapt to the peripheral equipment. Meanwhile, in different board card circuit designs, different pin combinations are often needed, in the prior art, when the MCU pin function is configured each time, the matching can be realized only by respectively adjusting the SOC software and the MCU software, the workload is large, and the MCU software of a plurality of versions needs to be maintained, so that the work is easy to make mistakes.

Disclosure of Invention

In view of the prior art, the problem of insufficient pin numbers of GPIO, UART, USB, and the like of the SOC chip is usually solved by adding the MCU, and in the use process, different pin combinations are often used in the circuit design of different boards, and the MCU pin configuration each time needs to be adjusted for the software of the SOC chip and the MCU to realize matching, which results in a huge workload and a large maintenance cost.

In view of the above technical problems, the technical solution of the present invention provides the following contents:

the MCU pin function configuration method based on the SOC chip comprises the following steps:

starting the SOC chip and driving the MCU to be powered on;

unifying communication interfaces and communication protocols of the SOC chip and the MCU;

the SOC chip loads customized configuration information and sends the customized configuration information to the MCU;

the MCU completes the initial configuration.

Further, after the MCU completes the initial configuration, the method further includes the following steps:

the MCU dynamically reads configuration state information sent by the SOC chip;

the MCU main program executes corresponding setting.

Further, the MCU main program executing the corresponding setting specifically includes:

and setting the pin function configuration of the MCU.

Further, the functional configuration includes: inquiring version number, setting and/or inquiring IO level, serial port conversion and MCU firmware upgrade.

Further, the functional configuration further includes: the USB descriptor is dynamically configured.

Further, the format of the communication protocol is as follows:

function + length of parameter + 1 + 2 + 3 +. + n.

Further, the SOC chip loads customized configuration information, and after the customized configuration information is sent to the MCU, the MCU stores the customized configuration information to the local.

The SOC chip comprises a CPU and an MCU, wherein the CPU sends the content of the communication protocol to the MCU through a communication interface.

Furthermore, the CPU and the MCU are integrated into a communication interface.

The invention discloses an MCU pin function configuration method based on an SOC chip and the SOC chip, which loads customized configuration information from the SOC chip by agreeing with a communication interface and a communication protocol of the SOC chip and the MCU, and then sends the customized configuration information to the MCU, so that the MCU completes initialization configuration.

Drawings

Fig. 1 is a flowchart of the steps of the MCU pin function configuration method based on the SOC chip in this embodiment;

fig. 2 is a flowchart of steps after step S4 in the present embodiment is completed;

FIG. 3 is a schematic block diagram illustrating the interaction between the SOC chip and the MCU in this embodiment;

fig. 4 is a functional block diagram of the MCU pin dynamic management in this embodiment.

Detailed Description

The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

The embodiments of the present disclosure are described below with specific examples, and other advantages and effects of the present disclosure will be readily apparent to those skilled in the art from the disclosure in the specification. It is to be understood that the described embodiments are merely illustrative of some, and not restrictive, of the embodiments of the disclosure. The disclosure may be embodied or carried out in various other specific embodiments, and various modifications and changes may be made in the details within the description without departing from the spirit of the disclosure. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.

Example one

The MCU pin function configuration method based on the SOC chip, as shown in FIG. 1, includes the following steps:

step S1, starting the SOC chip and driving the MCU to be powered on;

in the embodiment of the present application, the SOC (System on Chip, referred to as System on Chip, also referred to as System on Chip) is a product, and is an integrated circuit with a special purpose, which includes a complete System and has all contents of embedded software; an mcu (micro controller Unit), also called a Single Chip Microcomputer (CPU), or a Single Chip Microcomputer (mcu), is to properly reduce the frequency and specification of a CPU (Central processing Unit), and integrate peripheral interfaces such as memory, counter (Timer), USB, a/D conversion, UART, PLC, DMA, etc., and even an LCD driving circuit on a Single Chip to form a Chip-level computer, which is used for different combined control in different applications.

As shown in fig. 3, in the embodiment of the present application, in order to make up for the problem of insufficient pins of the SOC chip, in the embodiment of the present application, the MCU is disposed on the SOC chip, and the SOC chip is powered on to drive the MCU to be powered on, and then the MCU can also be powered on.

Step S2, unifying communication interfaces and communication protocols of the SOC chip and the MCU;

in order to enable the SOC chip and the MCU to be communicated, the communication interfaces of the SOC chip and the MCU must be unified, different usages can be applied to the interfaces of the mainboard in different machine types, and the communication interfaces on the SOC chip and the MCU are unified, so that the SOC chip can conveniently send different configuration information to the MCU.

Step S3, the SOC chip loads the customized configuration information and sends the customized configuration information to the MCU;

MCU pins to be used and related functions are defined in a program of the SOC chip, and a control command of a custom protocol is sent to the MCU through an I2C interface, so that the MCU executes the related functions, such as the functions of setting IO output level, opening ADC, opening a virtual serial port or reading ADC value.

Further, in a preferred embodiment of the present application, the functional configuration includes: inquiring version number, setting and/or inquiring IO level, serial port conversion and MCU firmware upgrade.

Further, in a preferred embodiment of the present application, the functional configuration further includes: the USB descriptor is dynamically configured.

And step S4, finishing the initial configuration by the MCU.

When the system is started for the first time, basic configuration can be set according to the functional requirements of the mainboard, and at the moment, the SOC chip sends related configuration information to the MCU for the first time to complete initialization configuration.

Further, as shown in fig. 2, in a preferred embodiment of the present application, after the MCU completes the initial configuration, the method further includes the following steps:

step S410, the MCU dynamically reads configuration state information sent by the SOC chip;

and step S420, executing corresponding setting by the MCU main program.

As shown in fig. 4, in the working process of the chip, the SOC chip may trigger different applications or different web pages according to a user, so as to dynamically send different configuration state information to the MCU, and the MCU main program receives the configuration state information sent by the SOC chip, so as to execute IO setting or read a related command.

Further, in a preferred embodiment of the present application, the executing of the corresponding setting by the main program of the MCU specifically includes:

and setting the pin function configuration of the MCU.

The IO control module configures the connection state of the signal interaction end of the chip pin processing module connected to the IO control module and the signal interaction end of the functional module connected to the IO control module according to the configuration information of the configuration register, that is, the IO control module determines which functional module the chip pin processing module is to be electrically connected with according to the configuration information of the configuration register.

In summary, by configuring the working mode of the chip pin processing module of the MCU chip and the connection state of the chip pin processing module and the functional module inside the MCU, a functional pin can input or output a signal, where the input or output signal can be an analog signal or a digital signal, and the same functional pin can be accessed to different functional modules inside the MCU chip.

Further, in a preferred embodiment of the present application, the format of the communication protocol is:

function + length of parameter + 1 + 2 + 3 +. + n.

Further, in a preferred embodiment of the present application, the SOC chip loads customized configuration information, and after sending the customized configuration information to the MCU, the MCU stores the customized configuration information locally.

After the SOC is started for the second time, if the customized configuration information does not change, the last configuration history record can be used, the MCU does not need to be repeatedly sent and sent configuration information, and the speed of the whole process can be increased.

The SOC chip comprises a CPU and an MCU, wherein the CPU sends the content of the communication protocol to the MCU through a communication interface.

Further, in a preferred embodiment of the present application, the CPU and the MCU have a unified communication interface.

The communication interface (I2C/UART) of the SOC chip and the MCU and a set of fixed communication protocol are unified, so that the software for fixing the MCU can be realized, and the SOC chip is used for completing the function configuration of the MCU.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

In the embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种数字芯片模块链接的自动化设计方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!