CN115243161A - Audio output pin multiplexing circuit, device and method - Google Patents

Audio output pin multiplexing circuit, device and method Download PDF

Info

Publication number
CN115243161A
CN115243161A CN202210827134.5A CN202210827134A CN115243161A CN 115243161 A CN115243161 A CN 115243161A CN 202210827134 A CN202210827134 A CN 202210827134A CN 115243161 A CN115243161 A CN 115243161A
Authority
CN
China
Prior art keywords
pwm
signal
pcm
audio
conversion circuit
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202210827134.5A
Other languages
Chinese (zh)
Other versions
CN115243161B (en
Inventor
汪亮亮
桑圣锋
任春静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Frequen Microelectronics Co ltd
Original Assignee
Shanghai Frequen Microelectronics Co ltd
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 Shanghai Frequen Microelectronics Co ltd filed Critical Shanghai Frequen Microelectronics Co ltd
Priority to CN202210827134.5A priority Critical patent/CN115243161B/en
Publication of CN115243161A publication Critical patent/CN115243161A/en
Application granted granted Critical
Publication of CN115243161B publication Critical patent/CN115243161B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Abstract

The invention discloses an audio output pin multiplexing circuit, device and method. The PWM conversion circuit converts the input PCM format coded audio signal into a PWM signal, the I2S parallel-serial conversion circuit converts the input PCM format coded audio signal into I2S serial data, and the two-way selection circuit selects a corresponding signal to be sent to the multiplexing pin, so that the PWM signal or the I2S serial data can be output by only one pin, the technical problem that the I2S interface needs to be modified when a single interface is used for transmitting the PWM signal or the I2S serial data in the prior art is solved, the technical effect of realizing PWM audio output and I2S audio output by using the single interface on the premise of not changing the I2S interface is achieved, and the use scene is widened.

Description

Audio output pin multiplexing circuit, device and method
Technical Field
The embodiment of the invention relates to the technical field of audio circuits, in particular to an audio output pin multiplexing circuit, device and method.
Background
Pulse Code Modulation (PCM) is an expression form of converting an analog signal into a digital signal at a fixed sampling frequency, and an analog voice signal is PCM after sampling and quantizing and certain data arrangement, so that the PCM can theoretically transmit a single channel, a dual channel and a multi-channel and can be regarded as an original signal of digital audio, and a PCM file has no header information and is all uncompressed audio data after sampling and quantizing, so that the PCM signal is not favorable for transmission and needs to be converted into a PWM signal or I2S serial data.
An Inter-IC Sound (I2S) bus is a bus standard established by philips for audio data transmission between digital audio devices, and is dedicated to data transmission between audio devices, and in the I2S standard of philips, a hardware interface specification and a format of digital audio data are both specified, so that distortion caused by time difference is avoided by separating data and a clock signal, and the quality of output audio can be effectively improved by matching a decoder.
Pulse Width Modulation (PWM) is used for modulating the Width of a series of pulses to be equivalent to required voltage waveform, because the working principle of the loudspeaker is that current with different voltages is input to generate an alternating magnetic field, the alternating magnetic field moves perpendicular to the current direction of a voice coil under the action of a permanent magnet and the alternating magnetic field, the voice coil drives a vibrating diaphragm to vibrate to push air to vibrate to generate sound, and PWM signals are currents with different voltages and can be used as input signals of the loudspeaker to generate sound to output low-quality audio; the audio can also be transmitted in a Digital information manner, and a Digital to Analog Converter (DAC) is matched to output audio with higher quality.
Because the whole trend of modern industrial design is to reduce the number of external interfaces with the same function, one interface is required to be used for transmitting PWM signals or I2S serial data, when the number of interface pins is large, different signals or data can be transmitted through different pins, however, the interface with the large number of pins often uses thicker cables and larger interfaces, which limits the design of products, and when the number of interfaces is insufficient, the I2S interface needs to be changed, the number of pins in the interface is increased, and the cost is increased.
Disclosure of Invention
The embodiment of the invention provides an audio output pin multiplexing circuit, which is used for realizing the technical effects of PWM audio output and I2S audio output by using a single interface on the premise of not changing an I2S interface.
In a first aspect, an embodiment of the present invention provides an audio output pin multiplexing circuit, including a PCM signal input terminal, a PWM conversion circuit, an I2S parallel-serial conversion circuit, a two-way selection circuit, and a multiplexing pin; one end of the PWM conversion circuit and one end of the I2S parallel-serial conversion circuit are connected with a PCM signal input end, the other end of the PWM conversion circuit and the other end of the I2S parallel-serial conversion circuit are respectively connected with a first input end and a second input end of the two-way selection circuit, and an output end of the two-way selection circuit is connected with a multiplexing pin; wherein, the first and the second end of the pipe are connected with each other,
the PWM conversion circuit is used for receiving the PCM format coded audio signal from the PCM signal input end, converting the PCM format coded audio signal into PWM format data and then sending the PWM format data to the two-way selection circuit;
the I2S parallel-serial conversion circuit is used for receiving the PCM format coded audio signal from the PCM signal input end, converting the PCM format coded audio signal into I2S serial data and then sending the I2S serial data to the two-way selection circuit;
the two-way selection circuit is used for receiving the signals sent by the PWM conversion circuit and sending the signals to the multiplexing pin; or receiving the serial data of the I2S sent by the I2S parallel-serial conversion circuit and sending the serial data to the multiplexing pin.
Preferably, the system also comprises a data buffer; the input end of the data buffer is connected with the PCM signal input end, and the first output end and the second output end of the data buffer are respectively connected with the PWM conversion circuit and the I2S parallel-serial converter; wherein, the first and the second end of the pipe are connected with each other,
the data buffer is used for receiving the audio signal coded in the PCM format and sent by the PCM signal input end, taking the speed of the audio data playing sampling rate as the output speed, and sending the audio signal coded in the PCM format to the PWM conversion circuit and the I2S parallel-serial conversion circuit.
Preferably, the PWM conversion circuit is further configured to perform a pre-processing on the PCM format encoded audio signal at a converter, where the pre-processing specifically includes:
acquiring the audio signal coded in the PCM format, and converting the audio signal coded in the PCM format into an unsigned number when the audio signal coded in the PCM format is a signed number;
adjusting the magnitude of the unsigned number value through a multiplier and a shift operation;
and executing addition operation to adjust the DC offset of the audio data after the unsigned number processing.
Preferably, the PWM conversion circuit includes a counter and a PWM converter; the PWM converter is connected with the PCM signal input end and the two-way selection circuit, and the counter is connected with the PWM converter; wherein, the first and the second end of the pipe are connected with each other,
the counter is used for providing a clock signal for the PWM converter;
the PWM converter is used for obtaining a PCM value after direct current offset adjustment, and according to the clock signal, after a preset value is decreased within each clock cycle until the value is less than or equal to 0, the value is kept to be 0, when the decreased value is greater than 0, the output PWM signal is at a high level, and when the decreased value is equal to 0, the output PWM signal is at a low level.
Preferably, the device also comprises a PWM-DAC circuit and a horn; one end of the PWM-DAC circuit is connected with the multiplexing pin, and the other end of the PWM-DAC circuit is connected with the loudspeaker; wherein, the first and the second end of the pipe are connected with each other,
the PWM-DAC circuit is used for converting the PWM signal sent by the PWM conversion circuit into a DAC signal and driving the loudspeaker according to the DAC signal;
the loudspeaker is used for playing corresponding audio when driven by the DAC signals.
Preferably, a decoder is further included; the decoder is connected with the multiplexing pin and used for decoding the audio signal sent by the I2S parallel-serial converter.
The invention also provides an audio output pin multiplexing device which comprises the audio output pin multiplexing circuit.
Preferably, the audio device further comprises a PCM audio output device connected to the PCM signal input for providing a PCM audio signal to the audio output pin multiplexing means.
Preferably, a register is also included; the register is connected with the selection end of the two-way selection circuit, receives the signal sent by the PWM conversion circuit and sends the signal to the multiplexing pin when the register selection signal is a first preset value, and receives the signal sent by the I2S parallel-serial conversion circuit and sends the signal to the multiplexing pin when the register selection signal is a second preset value.
The invention also provides an audio output pin multiplexing method, which comprises the following steps:
the PWM conversion circuit receives the PCM format coded audio signal from the PCM signal input end, converts the PCM format coded audio signal into PWM format data and then sends the PWM format data to the two-way selection circuit;
the I2S parallel-serial conversion circuit receives the PCM format coded audio signal from the PCM signal input end, converts the PCM format coded audio signal into I2S and then sends the I2S audio signal to the two-way selection circuit;
the two-way selection circuit receives the signal sent by the PWM conversion circuit and sends the signal to the multiplexing pin; or receiving the serial data of the I2S sent by the I2S parallel-serial conversion circuit and sending the serial data to the multiplexing pin.
The invention converts the input PCM format coded audio signal into the PWM signal through the PWM conversion circuit, converts the input PCM format coded audio signal into I2S serial data through the I2S parallel-serial conversion circuit, and then selects the corresponding signal to be sent to the multiplexing pin through the two-way selection circuit, thereby reducing the requirement of the number of the pins, leading the transmission of the PWM signal to be dependent on the original I2S interface, achieving the technical effect of realizing PWM audio output and I2S audio output by using a single interface on the premise of not changing the I2S interface, reducing the change of a product shell and the interface, lowering the cost, reducing the number of internal leads of a transmission cable to a certain extent, avoiding the problem of interface increase possibly caused by changing the interface, and enhancing the reliability.
Drawings
FIG. 1 is a functional block diagram of one embodiment of a task autoconfiguration circuit of the present invention;
FIG. 2 is a functional block diagram of another embodiment of the task autoconfiguration circuit of the present invention;
FIG. 3 is a functional block diagram of another embodiment of the task autoconfiguration circuit of the present invention;
FIG. 4 is a flowchart illustrating an embodiment of a task auto-configuration method according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some structures related to the present invention are shown in the drawings, not all of them.
Fig. 1 is a functional block diagram of an audio output pin multiplexing circuit according to an embodiment of the present invention, which includes a PCM signal input terminal, a PWM conversion circuit, an I2S parallel-serial conversion circuit, a two-way selection circuit, and a multiplexing pin; one end of the PWM conversion circuit and one end of the I2S parallel-serial conversion circuit are connected with the PCM signal input end, the other end of the PWM conversion circuit and the other end of the I2S parallel-serial conversion circuit are respectively connected with a first input end and a second input end of the two-way selection circuit, and the output end of the two-way selection circuit is connected with the multiplexing pin; wherein the content of the first and second substances,
the PWM conversion circuit is used for receiving the PCM format coded audio signal from the PCM signal input end, converting the PCM format coded audio signal into PWM format data and then sending the PWM format data to the two-way selection circuit;
the I2S parallel-serial conversion circuit is used for receiving the PCM format coded audio signal from the PCM signal input end, converting the PCM format coded audio signal into I2S serial data and then sending the I2S serial data to the two-way selection circuit;
the two-way selection circuit is used for receiving the signals sent by the PWM conversion circuit and sending the signals to the multiplexing pin; or receiving the serial data of the I2S sent by the I2S parallel-serial conversion circuit and sending the serial data to the multiplexing pin.
It is easy to understand that, in general, the audio signal encoded in the PCM format stores all the audio information that can be recorded, and the audio information is converted into the I2S serial data in a near lossless manner, and there is no loss in the audio information, however, when the audio signal is converted into the PWM format data, there is a loss in the audio information, therefore, the I2S serial data has more audio information than the audio information stored in the PWM format data, when a high-quality decoder and a speaker are used, the sound quality after decoding and playing is better for the I2S serial data than the PWM format data, but in a scenario where the requirement for the sound quality is not high, it is more cost-effective to transmit the audio information using the PWM format data.
It should be noted that, due to the replicability of the digital signal, the audio signal encoded in the PCM format does not disappear after being converted once, and the audio signal encoded in the PCM format can be usually converted into PWM format data and I2S serial data, and then transmitted to the corresponding playing device through different interfaces and lines, and two separate interfaces or an interface with more pins can be used to implement PWM audio output and I2S audio output functions, when the PWM audio output function is added to the existing device that outputs I2S serial data, the number of pins of the original interface needs to be increased or changed, which brings cost up.
It is worth emphasizing that the PWM conversion circuit and the I2S parallel-serial conversion circuit convert the audio signal coded in the PCM format into PWM format data and I2S serial data, the input ends of the two-way selection circuit are two conversion circuits at the front stage, one of the two conversion circuits is selected to be output to a pin at the rear stage, pin multiplexing can be realized, and multiplexing of more pins can be realized only by adding the two-way selection circuit.
According to the technical scheme of the embodiment, the input PCM audio signal is converted into the signal in the PWM format through the PWM conversion circuit, the input PCM audio signal is converted into the serial data in the I2S through the I2S parallel-serial conversion circuit, the signal in the PWM format or the serial data in the I2S is selected to the multiplexing pin through the two-way selection circuit, so that the same pin can be used for outputting the serial data in the I2S or the signal in the PWM format, the number of pins required for realizing the PWM audio output and the I2S audio output is reduced, the technical effect of realizing the PWM audio output and the I2S audio output by using a single interface on the premise of not changing the I2S interface is achieved, the number of wire cores required for realizing the PWM audio output and the I2S audio output by using the interface is reduced, and the use scene is widened.
Referring to fig. 2, the audio output pin multiplexing circuit provided by the present invention further includes a data buffer; the input end of the data buffer is connected with the PCM signal input end, and the first output end and the second output end of the data buffer are respectively connected with the PWM conversion circuit and the I2S parallel-serial converter; wherein, the first and the second end of the pipe are connected with each other,
and the data buffer is used for receiving the audio signal coded in the PCM format and sent by the PCM signal input end, and sending the audio signal coded in the PCM format to the PWM conversion circuit and the I2S parallel-serial conversion circuit by taking the speed of the audio data playing sampling rate as the output speed.
It is easy to understand that, since the speed of inputting the PCM format encoded audio signal to the PWM conversion circuit and the I2S parallel-serial conversion circuit may not be identical to the speed of the playing sampling rate, the audio may be slow and fast in the playing process, and the original audio effect cannot be restored.
The PWM conversion circuit is further configured to pre-process the PCM format encoded audio signal at the converter, where the pre-processing specifically includes:
acquiring an audio signal coded in a PCM format, and converting the audio signal coded in the PCM format into an unsigned number when the audio signal coded in the PCM format is a signed number;
adjusting the magnitude of the unsigned number value through a multiplier and a shift operation;
and executing addition operation to adjust the DC offset of the audio data after the unsigned number processing.
It should be noted that the steps of converting the unsigned number and adjusting the magnitude of the unsigned number are aimed at changing all values into positive values, so as to facilitate outputting high level or low level according to whether the value is greater than 0 during subsequent processing; the treatment process comprises the following steps: adding the absolute value of the minimum value to all the values, the original processed minimum value is 0, the rest values are the original value plus the absolute value of the original minimum value, then adjusting the magnitude of the unsigned number value through a multiplier and a shift operation, thereby realizing the control of the audio playing volume, and then carrying out an addition operation on the data after the volume adjustment, and adjusting the DC offset of the audio data.
Specifically, the PWM conversion circuit includes a counter and a PWM converter; the PWM converter is connected with the PCM signal input end and the two-path selection circuit, and the counter is connected with the PWM converter; wherein the content of the first and second substances,
a counter for providing a clock signal for the PWM converter;
and the PWM converter is used for acquiring the PCM value after the direct current offset adjustment, and keeping the value at 0 after the preset value is reduced within each clock period until the value is less than or equal to 0 according to the clock signal, wherein when the reduced value is greater than 0, the output PWM signal is at a high level, and when the reduced value is equal to 0, the output PWM signal is at a low level.
It is worth emphasizing that the PCM to PWM data converter realizes parallel-to-serial conversion through a counter, the initial value of the counter is updated to the preprocessed unsigned number PCM of the current sampling period, the preprocessed unsigned number PCM is a positive value, in the application, the preset value is set to be 1, the counter value of each clock period is decreased by 1 under the drive of a high-speed clock until the counter value is decreased to 0 and then is kept to 0, after the next sampling period comes, the counter is initialized by the next PCM data, and the conversion process is repeated; when the counter value is zero, the PWM outputs low level, and when the counter value is not zero, the PWM outputs high level, the PCM value is larger, the high point of the PWM output is more even, and the duty ratio of the PWM output is larger.
It is easy to understand that, by the above conversion method, the PCM value can be expressed by the duty ratio of the PWM signal, however, since the preset value of the present application is 1, the PCM value smaller than 1 can be regarded as 1 or 0, and therefore, in the case that the stored audio information is degraded, the degradation of the audio information can be reduced by adjusting the preset value to be a number smaller than 1, but in order to ensure the conversion speed of the PCM to PWM, the conversion time should be longer than the playing speed of the audio, so the setting of the preset value needs to take into consideration the performance of the counter.
Referring to fig. 3, the device further comprises a PWM-to-DAC circuit and a speaker; one end of the PWM-DAC circuit is connected with the multiplexing pin, and the other end of the PWM-DAC circuit is connected with the loudspeaker; wherein the content of the first and second substances,
the PWM-DAC circuit is used for converting the PWM signal sent by the PWM conversion circuit into a DAC signal and driving a loudspeaker according to the DAC signal;
and the loudspeaker is used for playing corresponding audio when driven by the DAC signal.
It should be noted that there are many existing schemes for converting PWM to DAC, most of which output analog signals with varying amplitudes by filtering ac components of PWM signals, and different duty ratios of PWM signals can generate different analog signals, i.e., DAC signals.
It should be emphasized that even if the information loss during the conversion process of the PCM signal into the PWM signal is controlled within the minimum range, after the PWM signal is converted into the DAC signal, the output DAC signal will be different from the input audio information of the PCM signal to some extent, so the PWM transmission audio information is usually only used in the scene with low requirement on the sound quality.
Specifically, a decoder is also included; the decoder is connected with the multiplexing pin and is used for decoding the audio signal sent by the I2S parallel-serial converter.
It is easy to understand that the decoder is used to decode the I2S serial data, so as to obtain the complete audio data contained in the PCM signal, and in the case of multiple channels, the I2S serial data may also contain the data of multiple channels, however, the decoder is relatively expensive due to the higher cost and the larger number of cores of the transmission cable, so that the decoder is generally applied to the scenario with higher requirements on sound quality.
The embodiment improves the technical scheme by disclosing the connection mode of a back-end circuit, and converts a DAC circuit through PWM (pulse-width modulation) to drive a loudspeaker, thereby realizing the playing of low-quality audio through extremely low cost, and realizing the playing of high-quality audio through decoding I2S serial data by a decoder, thereby achieving the technical effect that the same pin outputs PWM audio or I2S audio and plays according to the difference of back-end equipment, and avoiding the condition that the speed of audio playing is inconsistent with the speed of playing sampling rate by adding a data buffer, further improving the quality of output signals, meeting the design requirement and expanding the use scene.
The invention also provides an audio output pin multiplexing device which comprises the audio output pin multiplexing circuit.
The audio output pin multiplexing apparatus provided in the embodiments of the present invention can execute the audio output pin multiplexing circuit method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method, which are not described in detail herein.
Specifically, the PCM audio output device is connected with the PCM signal input end and used for providing a PCM audio signal for the audio output pin multiplexing device.
It should be noted that, usually, the decoded audio file is output as PCM data, the sound data in the PCM is not compressed, and the audio format output under the condition of higher sound quality requirement may be data in RAW format, however, because the difference between the sound quality of the audio file and the PCM is very small, the comprehensive cost is much higher, the application range of the audio file is far from wide PCM, and most of the audio devices supporting RAW output can output audio in PCM format, so the application uses the PCM audio output device as an output source to meet the requirements of compatibility and application range.
Specifically, a register is also included; the register is connected with the selection end of the two-way selection circuit, receives signals sent by the PWM conversion circuit and sends the signals to the multiplexing pin when the register selection signal is a first preset value, and receives signals sent by the I2S parallel-serial conversion circuit and sends the signals to the multiplexing pin when the register selection signal is a second preset value.
It is easy to understand that the two-way selection circuit judges and selects which kind of signal to send to the multiplexing pin according to the value read by the selection end, in the application, the first preset threshold is 1, the second preset threshold is 0, that is, when the value stored in the register is 1, the multiplexing pin outputs the audio data modulated by PWM, when the value stored in the register is 0, the multiplexing pin outputs the audio data in the I2S format, and meanwhile, under the condition that the register and the two-way selection circuit are not used, the multiplexing pin can be controlled to output the target audio data by switching on and off, the advantage of using the register and the two-way selection circuit is that the output of the audio data in different formats can be realized by a simple software command, the complex control of the two-way selection circuit can be realized more simply, the operation difficulty of outputting different audio signals is reduced, and the user experience is improved.
According to the embodiment, the technical scheme is perfected by disclosing the peripheral equipment of the audio output pin multiplexing device, and by means of matching the register with the two-way selection circuit, the output of different audio signals can be realized only by changing the stored numerical value, so that the threshold of complex control is reduced, the operation difficulty of outputting different audio signals is reduced, the technical scheme is perfected, the user experience of using a single interface to realize PWM audio output and I2S audio output is further improved, and the use scene is widened.
Referring to fig. 4, the present invention further provides an audio output pin multiplexing method, which specifically includes:
the PWM conversion circuit receives the PCM format coded audio signal from the PCM signal input end, converts the PCM format coded audio signal into PWM format data and then sends the PWM format data to the two-way selection circuit;
the I2S parallel-serial conversion circuit receives the PCM format coded audio signal from the PCM signal input end, converts the PCM format coded audio signal into I2S and then sends the I2S audio signal to the two-way selection circuit;
the two-way selection circuit receives signals sent by the PWM conversion circuit and sends the signals to the multiplexing pin; or receiving the serial data of the I2S sent by the I2S parallel-serial conversion circuit and sending the serial data to the multiplexing pin.
Of course, the audio output pin multiplexing method provided by the embodiment of the invention has the corresponding functional modules and beneficial effects of the circuit, and is not repeated herein.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods of the embodiments of the present invention.
It should be noted that, in the embodiment of the search apparatus, each included unit and each included module are merely divided according to functional logic, but are not limited to the above division, as long as corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the particular embodiments described herein, and that various obvious changes, rearrangements and substitutions will now be apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An audio output pin multiplexing circuit is characterized by comprising a PCM signal input end, a PWM conversion circuit, an I2S parallel-serial conversion circuit, a two-way selection circuit and a multiplexing pin; one end of the PWM conversion circuit and one end of the I2S parallel-serial conversion circuit are connected with a PCM signal input end, the other end of the PWM conversion circuit and the other end of the I2S parallel-serial conversion circuit are respectively connected with a first input end and a second input end of the two-way selection circuit, and an output end of the two-way selection circuit is connected with a multiplexing pin; wherein the content of the first and second substances,
the PWM conversion circuit is used for receiving the PCM format coded audio signal from the PCM signal input end, converting the PCM format coded audio signal into PWM format data and then sending the PWM format data to the two-way selection circuit;
the I2S parallel-serial conversion circuit is used for receiving the PCM format coded audio signal from the PCM signal input end, converting the PCM format coded audio signal into I2S serial data and then sending the I2S serial data to the two-way selection circuit;
the two-way selection circuit is used for receiving the signals sent by the PWM conversion circuit and sending the signals to the multiplexing pin; or receiving the serial data of the I2S sent by the I2S parallel-serial conversion circuit and sending the serial data to the multiplexing pin.
2. The audio output pin multiplexing circuit according to claim 1, further comprising a data buffer; the input end of the data buffer is connected with the PCM signal input end, and the first output end and the second output end of the data buffer are respectively connected with the PWM conversion circuit and the I2S parallel-serial converter; wherein the content of the first and second substances,
the data buffer is used for receiving the audio signal coded in the PCM format and sent by the PCM signal input end, taking the speed of the audio data playing sampling rate as the output speed, and sending the audio signal coded in the PCM format to the PWM conversion circuit and the I2S parallel-serial conversion circuit.
3. The audio output pin multiplexing circuit of claim 2, wherein the PWM conversion circuit is further configured to pre-process the PCM format encoded audio signal at a converter, the pre-processing specifically comprising:
acquiring the audio signal coded in the PCM format, and converting the audio signal coded in the PCM format into an unsigned number when the audio signal coded in the PCM format is a signed number;
adjusting the magnitude of the unsigned number value through a multiplier and a shift operation;
and executing addition operation to adjust the DC offset of the audio data after the unsigned number processing.
4. The audio output pin multiplexing circuit of claim 3, wherein the PWM conversion circuit comprises a counter and a PWM converter; the PWM converter is connected with the PCM signal input end and the two-way selection circuit, and the counter is connected with the PWM converter; wherein the content of the first and second substances,
the counter is used for providing a clock signal for the PWM converter;
the PWM converter is used for obtaining a PCM value after direct current offset adjustment, and according to the clock signal, after a preset value is decreased within each clock cycle until the value is less than or equal to 0, the value is kept to be 0, when the decreased value is greater than 0, the output PWM signal is at a high level, and when the decreased value is equal to 0, the output PWM signal is at a low level.
5. The audio output pin multiplexing circuit according to claim 4, further comprising a PWM-to-DAC circuit and a speaker; one end of the PWM-DAC circuit is connected with the multiplexing pin, and the other end of the PWM-DAC circuit is connected with the loudspeaker; wherein the content of the first and second substances,
the PWM-DAC circuit is used for converting the PWM signal sent by the PWM conversion circuit into a DAC signal and driving the loudspeaker according to the DAC signal;
the loudspeaker is used for playing corresponding audio when driven by the DAC signals.
6. The audio output pin multiplexing circuit according to claim 2, further comprising a decoder; and the decoder is connected with the multiplexing pin and is used for decoding the audio signal sent by the I2S parallel-serial converter.
7. An audio output pin multiplexing apparatus, characterized in that the audio output pin multiplexing apparatus comprises the audio output pin multiplexing circuit of any one of claims 1 to 6.
8. The audio output pin multiplexing apparatus of claim 7, further comprising a PCM audio output device connected to the PCM signal input, for supplying a PCM audio signal to the audio output pin multiplexing apparatus.
9. The audio output pin multiplexing device according to claim 7, further comprising a register; the register is connected with the selection end of the two-way selection circuit, receives the signal sent by the PWM conversion circuit and sends the signal to the multiplexing pin when the register selection signal is a first preset value, and receives the signal sent by the I2S parallel-serial conversion circuit and sends the signal to the multiplexing pin when the register selection signal is a second preset value.
10. An audio output pin multiplexing method, comprising:
the PWM conversion circuit receives the PCM format coded audio signal from the PCM signal input end, converts the PCM format coded audio signal into PWM format data and then sends the PWM format data to the two-way selection circuit;
the I2S parallel-serial conversion circuit receives the PCM format coded audio signal from the PCM signal input end, converts the PCM format coded audio signal into I2S and then sends the I2S coded audio signal to the two-way selection circuit;
the two-way selection circuit receives the signal sent by the PWM conversion circuit and sends the signal to the multiplexing pin; or receiving the serial data of the I2S sent by the I2S parallel-serial conversion circuit and sending the serial data to the multiplexing pin.
CN202210827134.5A 2022-07-13 2022-07-13 Audio output pin multiplexing circuit, device and method Active CN115243161B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210827134.5A CN115243161B (en) 2022-07-13 2022-07-13 Audio output pin multiplexing circuit, device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210827134.5A CN115243161B (en) 2022-07-13 2022-07-13 Audio output pin multiplexing circuit, device and method

Publications (2)

Publication Number Publication Date
CN115243161A true CN115243161A (en) 2022-10-25
CN115243161B CN115243161B (en) 2023-06-27

Family

ID=83674253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210827134.5A Active CN115243161B (en) 2022-07-13 2022-07-13 Audio output pin multiplexing circuit, device and method

Country Status (1)

Country Link
CN (1) CN115243161B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007243608A (en) * 2006-03-08 2007-09-20 Alps Electric Co Ltd Sound output device
US20150347424A1 (en) * 2014-06-03 2015-12-03 Paul M. Herbst Electronic systems and methods for integrated, automatic, medium-quality audio
CN105955694A (en) * 2012-12-27 2016-09-21 中兴通讯股份有限公司 Method and device for outputting HiFi audio frequency
CN106952650A (en) * 2017-02-28 2017-07-14 大连理工大学 A kind of train voice amplifying unit based on ARM+FPGA frameworks
CN107995561A (en) * 2017-12-28 2018-05-04 重庆德科电子仪表有限公司 Onboard instruments audio control system and control method
CN108649935A (en) * 2018-05-03 2018-10-12 成都黎声科技有限公司 A kind of system and method that digital audio and video signals are directly modulated into PWM waveform
CN208707932U (en) * 2018-08-24 2019-04-05 北京猎户星空科技有限公司 A kind of audio interface conversion circuit, audio collecting system and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007243608A (en) * 2006-03-08 2007-09-20 Alps Electric Co Ltd Sound output device
CN105955694A (en) * 2012-12-27 2016-09-21 中兴通讯股份有限公司 Method and device for outputting HiFi audio frequency
US20150347424A1 (en) * 2014-06-03 2015-12-03 Paul M. Herbst Electronic systems and methods for integrated, automatic, medium-quality audio
CN106952650A (en) * 2017-02-28 2017-07-14 大连理工大学 A kind of train voice amplifying unit based on ARM+FPGA frameworks
CN107995561A (en) * 2017-12-28 2018-05-04 重庆德科电子仪表有限公司 Onboard instruments audio control system and control method
CN108649935A (en) * 2018-05-03 2018-10-12 成都黎声科技有限公司 A kind of system and method that digital audio and video signals are directly modulated into PWM waveform
CN208707932U (en) * 2018-08-24 2019-04-05 北京猎户星空科技有限公司 A kind of audio interface conversion circuit, audio collecting system and electronic equipment

Also Published As

Publication number Publication date
CN115243161B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
US5347587A (en) Speaker driving device
JP2004229250A (en) Pwm signal interface system
WO2015041070A1 (en) Encoding device and method, decoding device and method, and program
WO2022041713A1 (en) Bone conduction audio electric toothbrush
KR20050116828A (en) Coding of main and side signal representing a multichannel signal
CN105681819B (en) Method, device and system for transmitting and receiving signals
US8750801B2 (en) Selective transcoding of encoded media files
CN103187999A (en) Information transmission method and device and mobile terminal
WO2022041712A1 (en) Audio signal drive motor circuit
CN1968010A (en) Apparatus and method to control volume of received sound signals
CN115243161A (en) Audio output pin multiplexing circuit, device and method
US20040223545A1 (en) Multi-level pulse width modulation in digital system
CN106331952B (en) Total digitalization is without sound card multichannel play system and playback method
US20070064960A1 (en) Apparatus to convert analog signal of array microphone into digital signal and computer system including the same
US10650834B2 (en) Audio processing method and non-transitory computer readable medium
JP2007037083A (en) Digital amplifier for personal computer
CN107357547B (en) Audio control method, audio control device and audio equipment
CN105120324A (en) Distributed player implementation method and system
WO2010125857A1 (en) Data transmission device and data transmission method
CN106471434A8 (en) HPI, accessory interface and the method for being connected between managing main frame interface and fittings equipment
CN212992589U (en) Audio signal driving motor circuit
US20230082685A1 (en) Integrated circuitry of speaker
WO2020203330A1 (en) Signal processing device and method, and program
CN109101215A (en) A kind of output method of audio signal, system and equipment
KR20140079400A (en) Digital acoustic system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant