DSP input and output bidirectional control circuit, method and program product
By using conversion circuits and drive control MOSFETs, bidirectional input/output control of the digital signal processor (DSP) is achieved, solving compatibility issues and improving configuration efficiency and voltage adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENXIN ELECTRONICS (SUZHOU) CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, the IN and OUT pins of a digital signal processor (DSP) cannot be simultaneously compatible with input and output, leading to signal conflicts and hardware damage. At the same time, existing solutions increase hardware costs or computational overhead.
A conversion circuit is adopted, with independent signal acquisition and output control paths. The input and output bidirectional control of the digital signal processor (DSP) is realized by using a drive control MOSFET and a voltage buffer conversion module. The working voltage is provided by switching control of the working power supply VCC.
It enables flexible switching of the digital signal processor (DSP) in different states, reduces computational overhead, improves configuration efficiency, and can provide an appropriate operating voltage according to the needs of peripherals.
Smart Images

Figure CN121966545A_ABST
Abstract
Description
A DSP input / output bidirectional control circuit, method, and program product Technical Field
[0001] This application relates to a DSP input / output bidirectional control circuit, method, and program product for use in the field of control circuits. Background Technology
[0002] Digital Signal Processors (DSPs) control input and output by configuring their GPIO pins, including IN and OUT pins. These pins establish bidirectional connections with peripherals; the IN pin receives the peripheral's output signal, and the OUT pin outputs the control signal. For bidirectional interfaces compatible with both input and output modes, connecting both IN and OUT pins simultaneously is physically equivalent to shorting them. This can lead to signal conflicts when the DSP attempts to control the signal, causing sink and spool current on the pins, potentially resulting in hardware thermal damage. Therefore, it is not possible to simultaneously connect a set of IN and OUT pins to a bidirectional interface compatible with both input and output modes. Furthermore, DSPs cannot output a specific operating voltage to the external interface via the OUT pin.
[0003] To achieve bidirectional control of the external interface with compatible input and output, the current approach is to connect the GPIO pins to external communication control hardware for signal flow and timing control. However, this approach increases hardware costs and requires complex configuration of GPIO pins, including function mapping and communication protocols. In application environments without external communication control hardware, software programs are needed to dynamically drive and control the pin inputs and outputs to achieve serial communication. However, this approach increases the CPU computational overhead of the digital signal processor (DSP) and places high demands on the timing control logic and conflict risk control of the software. Summary of the Invention
[0004] The purpose of this application is to overcome the shortcomings of the prior art and provide a DSP input / output bidirectional control circuit, method and program product, so that the control circuit can be compatible with the input and output of external devices through the same external interface, realize the state switching of the input and output of the digital signal processor DSP and bidirectional signal control in a convenient and efficient manner, and provide the peripheral device with the required operating voltage.
[0005] In a first aspect, this application provides a DSP input / output bidirectional control circuit, employing the following technical solution: It includes a digital signal processor (DSP), a conversion circuit, and an external interface; the external interface is a compatible input / output interface, and the bidirectional control circuit connects to external devices through the external interface; the conversion circuit includes a signal acquisition path and an output control path; the signal acquisition path is connected to the external interface and the IN pin of the DSP, respectively, transmitting the signal output from the external device to the DSP via the external interface; the output control path includes a drive conversion circuit, which includes a working power supply VCC, and is connected to the external interface and the OUT pin of the DSP, respectively. The drive conversion circuit receives the control signal emitted by the DSP via the OUT pin and performs switching control of the working power supply VCC. When the working power supply VCC is switched on, the external interface is pulled up to the working voltage; when the working power supply VCC is switched off, the external interface ground is pulled down to ground potential.
[0006] By adopting the above technical solution, the digital signal processor (DSP) is connected to the external interface through a conversion circuit. The conversion circuit performs bidirectional transmission control of the DSP's input and output signals through two independent lines, and enables the DSP to switch the power supply of the conversion circuit according to the different states of the peripherals, thereby realizing the control of the working voltage for the input and output states of compatible peripherals.
[0007] Preferably, the drive conversion circuit includes a drive control MOS transistor, the OUT pin of the digital signal processor (DSP) is connected to the gate of the drive control MOS transistor, the source of the drive control MOS transistor is grounded, the drain of the drive control MOS transistor is connected to the operating power supply VCC, and is connected to the external interface.
[0008] By adopting the above technical solution, the OUT pin of the digital signal processor (DSP) is connected to the gate of the drive control MOS transistor, thereby enabling the OUT pin to output high and low potentials to control the conduction or cutoff of the drive control MOS transistor, thus realizing the switching control of the operating power supply VCC.
[0009] Preferably, the operating power supply VCC is connected in series with the pull-up resistor R1, and a pull-down resistor R2 is connected between the gate and source of the drive control MOS transistor.
[0010] By adopting the above technical solution, a stable voltage pull-up and conduction current limiting are achieved through the pull-up resistor R1, and a static discharge path is provided for the drive control MOSFET through the pull-down resistor R2, ensuring that the drive control MOSFET is reliably turned off when the peripheral is in the output state.
[0011] Preferably, the operating voltage of the power supply VCC is configured according to the high potential requirements of the external devices connected to the external interface.
[0012] Preferably, the working power supply VCC is a power supply group composed of several power supplies with different supply voltages, and the working voltage of the working power supply VCC is configured by a switching selection circuit.
[0013] By adopting the above technical solution, it is possible to provide an appropriate working voltage according to the actual needs of external devices, and to provide an adjustable working voltage according to the different functional requirements of different external devices, thereby improving the versatility of the conversion circuit working voltage for different external devices and their different functional applications.
[0014] Preferably, the signal acquisition path includes a voltage buffer conversion module (Buffer), and the external interface is connected to the IN pin of the digital signal processor (DSP) through the voltage buffer conversion module (Buffer). The voltage buffer conversion module (Buffer) converts the level of the status signal output by the external interface into a level that meets the input requirements of the IN pin of the digital signal processor (DSP).
[0015] By adopting the above technical solution, the voltage buffer conversion module Buffer achieves buffer isolation between the external interface and the IN pin of the digital signal processor (DSP), so that the status signal of the external interface meets the input requirements of the DSP.
[0016] Secondly, this application provides a DSP input / output bidirectional control method, implemented based on the aforementioned control circuit. The specific technical solution includes the following steps: configuring the operating power supply VCC to meet the high-potential requirements of external devices connected to the external interface; connecting the external device to the bidirectional control circuit via the external interface; the digital signal processor (DSP) acquires the status signal of the external device being in input or output state; if the external device is in output state, it transmits the signal to the bidirectional control circuit via the external interface; the conversion circuit acquires the external device signal and inputs it to the IN pin of the DSP via the signal acquisition path; simultaneously, the DSP controls the OUT pin to output a control signal, controlling the operating power supply VCC to switch off; if the external device is in input state, the DSP controls the OUT pin to output a timing control signal, controlling the operating power supply VCC to turn on; based on the timing control of the operating power supply VCC, a control signal is output to the external device via the external interface.
[0017] Preferably, the drive conversion circuit uses a drive control MOSFET. If the external device is in output mode, the digital signal processor (DSP) controls the OUT pin to output a low potential to the gate of the drive control MOSFET, the drive control MOSFET remains off, and the operating power supply VCC is switched off. If the external device is in input mode, the DSP controls the OUT pin to output timing control signals of low and high potentials to the gate of the drive control MOSFET. The drive control MOSFET is switched off and on based on the timing control signals, so that the operating power supply VCC is turned on and outputs control signals to the external device.
[0018] Preferably, the digital signal processor (DSP) includes a pre-programmed control program. If the external device is in an input state, the DSP outputs timing control signals for low and high potentials through the pre-programmed control program to control the timing of the power supply VCC and outputs the timing control working voltage signal to the external device through the external interface.
[0019] Thirdly, this application provides an electronic device program product, the technical solution of which includes a program or instructions that enable the program or instructions to implement the steps of the above-mentioned DSP input / output bidirectional control method.
[0020] In summary, this application includes at least one of the following beneficial technical effects: 1. This application realizes the connection between the IN and OUT pins of the digital signal processor (DSP) and the external interface that is compatible with both input and output states through a conversion circuit, so that the DSP can flexibly switch its working mode based on the state changes of the external device.
[0021] 2. The logic control program of the digital signal processor (DSP) in this application does not need to be adjusted or reconstructed. It can respond conveniently and efficiently to the switching of peripherals to input states and perform output drive control of the working power supply. It has high configuration efficiency, low computational overhead, and high real-time performance.
[0022] 3. This application provides the peripherals with the required operating voltage through the power supply. The operating voltage can be flexibly adjusted and configured according to the requirements of the peripherals, which can meet the needs of different types of peripherals to achieve different functions. Attached Figure Description
[0023] Figure 1 is a schematic diagram of a DSP input / output bidirectional control circuit according to an embodiment of this application; Figure 2 is a flowchart of a DSP input / output bidirectional control method according to an embodiment of this application. Detailed Implementation
[0024] This specific embodiment is merely an explanation of this application and is not intended to limit it. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they are within the scope of this application.
[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. It should be noted that in the optional embodiments of this application, the object information and other related data involved require the permission or consent of the object when the embodiments of this application are applied to specific products or technologies, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. That is to say, if the embodiments of this application involve data related to the object, it needs to be obtained with the authorization and consent of the object, the authorization and consent of the relevant departments, and in compliance with the relevant laws, regulations, and standards of the country and region. If personal information is involved in the embodiments, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject is required, and the embodiments also need to be implemented with the authorization and consent of the object.
[0026] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0027] Please refer to Figure 1. An embodiment of this application shows a DSP input / output bidirectional control circuit, including a digital signal processor (DSP), a conversion circuit 1, and an external interface 2. In this embodiment, the external interface 2 specifically refers to an interface compatible with both input and output states.
[0028] Without introducing a designed control program to regulate the state of the pin register group, the configuration of a GPIO pin as either IN (input) or OUT (output) is fixed. Furthermore, IN and OUT pins cannot be simultaneously connected to external interface 2. Therefore, it is impossible to implement state switching and operating voltage switching control of external interface 2 that is compatible with both input and output based on the IN and OUT pins of a single digital signal processor (DSP).
[0029] The embodiments of this application employ a technical solution that connects the digital signal processor (DSP) and the external interface (2) via a conversion circuit 1. The conversion circuit 1 serves as a signal relay channel between the external device and the DSP, assisting the DSP in bidirectional control of input and output signals, as well as operating voltage switching control, through two independent input and output signal channels.
[0030] Specifically, conversion circuit 1 includes a signal acquisition path and an output control path, with the output control path including the operating power supply VCC. Since the voltage and current of the control signals output by the digital signal processor (DSP) are limited and cannot meet the driving requirements of external devices, sufficient output power needs to be provided to the external devices through the operating power supply VCC.
[0031] The signal acquisition path is the input path for external device signals to the digital signal processor (DSP). External device signals are transmitted to the DSP's IN pin via external interface 2 and the signal acquisition path. More specifically, the signal acquisition path includes a voltage buffer module (Buffer), which connects external interface 2 to the DSP's IN pin. The voltage buffer module converts the level of the external device's output signal to a level that meets the input requirements of the DSP's IN pin, thus implementing an isolation buffer function.
[0032] A digital signal processor (DSP) senses whether an external device is in an input or output state based on status signals sent by an external control module. These status signals can be sent by the external device itself or by a control signal sent by a higher-level control module.
[0033] After the digital signal processor (DSP) determines whether the external device is in input or output mode, it outputs a control signal from the OUT pin to the output control path based on the determination result. The output control path then controls the switching of the operating power supply VCC based on the control signal. When the external device is in output mode, the operating power supply VCC is switched off, and the external interface is grounded and pulled down to ground potential. When the external device is in input mode, the operating power supply VCC is switched on, and the external interface 2 is pulled up to the operating voltage of the operating power supply VCC.
[0034] Furthermore, the output control path uses a drive-control MOSFET Q. The OUT pin of the digital signal processor (DSP) is connected to the gate of the drive-control MOSFET Q. The source of the drive-control MOSFET Q is grounded, and the drain of the drive-control MOSFET Q is connected to the operating power supply VCC and the external interface. The operating power supply VCC is connected in series with a pull-up resistor R1, and a pull-down resistor R2 is connected between the gate and source of the drive-control MOSFET. The control signal output from the OUT pin of the DSP is divided into a high-level signal and a low-level signal. When a high-level signal is output, the drive-control MOSFET Q is saturated and turned on, the operating power supply VCC is switched off, and the external interface 2 is pulled down to ground potential. At this time, no operating voltage is output to external devices. When a low-level signal is output, the drive-control MOSFET Q is turned off, the operating power supply VCC is switched on, the external interface 2 is pulled up to the operating voltage of the operating power supply VCC, and output is sent to external devices.
[0035] It should be noted that in the above embodiment, the signal acquisition path of conversion circuit 1 is used for acquiring external device status signals, and the output control path is used for outputting the power supply VCC switching control signal. Although both are connected to external interface 2, they do not affect each other.
[0036] When the external device is in output mode, the signal from the external device is input to the conversion circuit 1 via external interface 2, and then input to the IN pin of the digital signal processor (DSP) via the voltage buffer conversion module in the signal acquisition path. At this time, the DSP outputs a low level through the OUT pin, driving the control MOSFET Q to remain off, and the operating power supply VCC is switched off. Since the operating power supply VCC is connected in series with the pull-up resistor R1, the operating power supply VCC will not affect the external signal input conversion circuit 1. At this time, the OUT pin is also unaffected by the input from the signal acquisition path.
[0037] When the external device is in input mode, the Digital Signal Processor (DSP) outputs low-level and high-level timing control signals through the OUT pin to activate the operating power supply VCC. When the OUT pin outputs a low level, the drive control MOSFET Q is kept off by the pull-down resistor R2, pulling the external interface 2 up to the operating voltage. When the OUT pin outputs a high level, the drive control MOSFET Q is turned on, pulling the external interface 2 down to a low potential. By controlling the corresponding on and off states of the drive control MOSFET Q through high and low-level timing control signals, the external interface switches between ground potential and operating voltage, thereby achieving the output of control signals. At this time, the voltage buffer module operates normally and does not affect the normal acquisition of signals from the external device and input to the DSP through the external interface 2. When the external device changes state, the DSP can immediately switch states and control the switching of the operating power supply VCC based on the control signals from the external control module.
[0038] The operating voltage of the power supply VCC is matched to the input voltage requirements of the external device. This operating voltage is input to the external device via external interface 2, and the external device, based on its functional design, performs corresponding device enabling and circuit control. This control flow is implemented based on the external device's own control logic and is unrelated to the digital signal processor (DSP).
[0039] In another specific embodiment, the operating power supply VCC is a power group composed of several power supplies with different supply voltages. When configuring the operating power supply VCC, a switching selection circuit matches the operating voltage of the power group with the high potential requirements of the external device. This technical solution eliminates the need for specific configuration of the operating power supply VCC for different external device functional requirements; instead, the operating voltage can be set as needed, simplifying the configuration process and improving versatility for different peripherals.
[0040] Unless otherwise stated, pins not explicitly described in this application (GND, EN, etc.) are connected in accordance with the conventional methods used by those skilled in the art, and such connections do not constitute a limitation on the technical solution of this invention. Passive devices such as decoupling capacitors not shown in the figures are connected in accordance with general specifications for electronic circuit design (such as IEEE standards), and specific parameters can be adjusted according to actual application scenarios.
[0041] Those skilled in the art will understand that the structure shown in Figure 1 is merely a circuit diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.
[0042] Please refer to Figure 2. An embodiment of this application provides a DSP input / output bidirectional control method, including the following steps: S1, configuring the operating power supply VCC to meet the high-potential requirements of external devices connected to the external interface. One specific implementation can be to configure the power supply group through a switch selection circuit to obtain the target operating voltage.
[0043] S2, after configuring the operating power supply VCC, initializes the digital signal processor DSP, including configuring the input logic of the IN pin and the output logic of the OUT pin.
[0044] S3 connects external devices to the bidirectional control circuit via an external interface.
[0045] S4, the digital signal processor (DSP) acquires the status signal of the external device, indicating whether it is in input or output state. This status signal synchronously controls the input or output state of the external device, or the external device synchronously responds to the status signal to switch between input and output states. The DSP acquires the status signal through a conversion circuit to determine the status of the external device.
[0046] S51: If the external device is identified as being in an output state via a status signal, the external device transmits the signal to the bidirectional control circuit through its external interface. The conversion circuit acquires the signal from the external device and inputs it to the IN pin of the digital signal processor (DSP) via the signal acquisition path. Simultaneously, the DSP controls the OUT pin to output a control signal, controlling the VCC power supply to be switched off.
[0047] S52: If the external device is identified as an input state through the status signal, the digital signal processor (DSP) controls the OUT pin to output a control signal, controls the working power supply VCC to be turned on, and switches the external interface between the working voltage pulled up to the working power supply VCC and the voltage pulled down to ground, and outputs a control signal to the external device.
[0048] More specifically, the conversion circuit uses a drive-controlled MOSFET. If the external device is in output mode, the DSP controls the OUT pin to output a low potential to the gate of the drive-controlled MOSFET, keeping the MOSFET continuously off and cutting off the operating power supply VCC. If the external device is in input mode, the DSP controls the OUT pin to output timing control signals of low and high potentials to the gate of the drive-controlled MOSFET, switching the MOSFET between off and on, thus putting the operating power supply VCC on. The external interface switches between being pulled up to the operating voltage and pulled down to ground potential, outputting control signals to the external device.
[0049] In another embodiment, S2, initializing the digital signal processor (DSP) includes configuring a pre-programmed control program for the DSP. If the external device is in an input state, the DSP outputs timing control signals for low and high potentials through the pre-programmed control program to control the timing of the power supply VCC.
[0050] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0051] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the DSP input-output bidirectional control method described above can be referred to the corresponding description in the aforementioned circuit embodiments, and will not be repeated here.
[0052] This application also provides an electronic device program product, which includes a program or instructions executed by a digital signal processor (DSP). When the program or instructions are executed, they can implement the steps of the above-described DSP input / output bidirectional control method.
[0053] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0054] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A DSP input / output bidirectional control circuit, characterized in that, The system includes a digital signal processor (DSP), a conversion circuit, and an external interface. The external interface is compatible with both input and output, and the bidirectional control circuit connects to external devices through the external interface. The conversion circuit includes a signal acquisition path and an output control path. The signal acquisition path is connected to the external interface and the IN pin of the DSP, transmitting the signal output from the external device to the DSP via the external interface. The output control path includes a drive conversion circuit, which includes a power supply VCC. The drive conversion circuit is connected to the external interface and the OUT pin of the DSP. The drive conversion circuit receives the control signal sent by the DSP via the OUT pin and controls the switching of the power supply VCC. When the power supply VCC is switched on, the external interface is pulled up to the operating voltage; when the power supply VCC is switched off, the external interface ground is pulled down to ground potential.
2. The DSP input / output bidirectional control circuit according to claim 1, characterized in that, The drive conversion circuit includes a drive control MOS transistor. The OUT pin of the digital signal processor (DSP) is connected to the gate of the drive control MOS transistor. The source of the drive control MOS transistor is grounded, and the drain of the drive control MOS transistor is connected to the operating power supply VCC and the external interface.
3. The DSP input / output bidirectional control circuit according to claim 2, characterized in that, The operating power supply VCC is connected in series with the pull-up resistor R1, and a pull-down resistor R2 is connected between the gate and source of the drive control MOS transistor.
4. The DSP input / output bidirectional control circuit according to claim 2, characterized in that, The operating voltage of the power supply VCC is configured according to the high potential requirements of the external devices connected to the external interface.
5. A DSP input / output bidirectional control circuit according to claim 4, characterized in that, The working power supply VCC is a power supply group composed of several power supplies with different supply voltages. The working voltage of the working power supply VCC is configured by a switching selection circuit.
6. The DSP input / output bidirectional control circuit according to claim 1, characterized in that, The signal acquisition path includes a voltage buffer conversion module (Buffer). The external interface is connected to the IN pin of the digital signal processor (DSP) through the voltage buffer conversion module (Buffer). The voltage buffer conversion module (Buffer) converts the level of the status signal output by the external interface into a level that meets the input requirements of the IN pin of the digital signal processor (DSP).
7. A DSP input / output bidirectional control method, implemented based on the control circuit described in any one of claims 1 to 6, characterized in that, The process includes the following steps: Configuring the operating power supply VCC to meet the high-potential requirements of external devices connected to the external interface; connecting the external device to the bidirectional control circuit via the external interface; acquiring the status signal of the external device as either an input or output device; if the external device is in an output state, it transmits the signal to the bidirectional control circuit via the external interface; the conversion circuit acquires the external device signal and inputs it to the IN pin of the DSP via the signal acquisition path; simultaneously, the DSP controls the OUT pin to output a control signal, controlling the operating power supply VCC to switch off; if the external device is in an input state, the DSP controls the OUT pin to output a timing control signal, controlling the operating power supply VCC to switch on; and based on the timing control of the operating power supply VCC, outputting a control signal to the external device via the external interface.
8. The DSP input / output bidirectional control method according to claim 7, characterized in that, The drive conversion circuit uses a drive control MOSFET. If the external device is in output mode, the digital signal processor (DSP) controls the OUT pin to output a low potential to the gate of the drive control MOSFET, the drive control MOSFET remains off, and the operating power supply VCC is switched off. If the external device is in input mode, the DSP controls the OUT pin to output timing control signals of low and high potentials to the gate of the drive control MOSFET. The drive control MOSFET is switched off and on based on the timing control signals, so that the operating power supply VCC is turned on and outputs control signals to the external device.
9. A DSP input / output bidirectional control method according to claim 8, characterized in that, The digital signal processor (DSP) includes a pre-programmed control program. If the external device is in an input state, the DSP outputs low-potential and high-potential timing control signals through the pre-programmed control program to control the timing of the power supply VCC and outputs the timing control working voltage signal to the external device through the external interface.
10. An electronic device program product, characterized in that, The electronic device program product includes a program or instructions that enable the program or instructions to implement the steps of the DSP input / output bidirectional control method of claim 9.