PWM (Pulse Width Modulation) audio playing system and equipment
By using a PWM audio playback system, the built-in module of the STM32F103 chip is used to directly drive the speaker, which solves the problem of electromagnetic radiation interference caused by external audio modules, simplifies system design, and reduces complexity and cost.
Patent Information
- Application Number
- CN202520133550.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Priority Date
- 2024-01-31
- Filing Date
- 2025-01-17
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2035-01-17
AI Technical Summary
Existing audio playback systems require complex electromagnetic interference avoidance designs when using external audio modules, which increases the complexity of system design.
A PWM audio playback system is adopted, which directly drives the speaker module through the PWM conversion module, omitting the audio decoder and external expansion interface, and realizing the direct playback of audio signals using the built-in module of the STM32F103 chip.
It reduces system design complexity, simplifies circuit layout, reduces electromagnetic radiation interference, and lowers system cost.
Smart Images

Figure CN223816220U_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The utility model relates to audio frequency playing technical field especially, relate to a kind of PWM audio frequency playing system and equipment. BACKGROUND
[0002] For the product with audio playing demand, generally take external audio module to meet the demand, in the case where audio data volume is larger, audio data is stored by expanding flash, processor reads the audio data stored in flash to memory, and sends to external audio module by interface to realize sound playing. When using external audio module, iis, uart, SPI etc. need to be set to connect audio decoder and loudspeaker, and complex signal processing and interface setting are carried out, and audio data is sent to iis, uart, SPI interface constantly, which can produce electromagnetic radiation, and the layout of circuit in system needs to be designed complex to avoid electromagnetic wave to produce interference to audio playing, so as to increase the design complexity of system. SUMMARY
[0003] Therefore, the utility model provides a kind of PWM audio frequency playing system and equipment to realize the design complexity of system reduction.
[0004] The specific technical scheme of the first embodiment of the utility model is as follows: a kind of PWM audio frequency playing system, the system includes: PWM conversion module and loudspeaker module;The input end of the PWM conversion module is connected with preset memory module and preset host computer, the output end of the PWM conversion module is connected with the loudspeaker module and the preset memory module, the PWM conversion module is used to receive the audio information in the preset memory module and the audio information playing instruction sent by the preset host computer, and send PWM signal to the loudspeaker module;The loudspeaker module is used to receive the PWM signal, and play the sound signal of the audio information.
[0005] Preferably, the PWM conversion module comprises a timer module, a DMA module and a PWM register; the input end of the timer module is connected with the preset host computer, the output end of the timer module is connected with the input end of the DMA module, the timer module is used for receiving a playing instruction of the audio information and sending an audio acquisition instruction to the DMA module; the input end of the DMA module is also connected with the preset memory module, the output end of the DMA module is connected with the input end of the PWM register and the preset memory module, the DMA module is used for receiving the audio acquisition instruction, sending the audio acquisition instruction to the preset memory module, receiving the audio information in the preset memory module and sending the audio information to the PWM register; the output end of the PWM register is connected with the loudspeaker module, and the PWM register is used for receiving the audio information and sending a PWM signal to the loudspeaker module.
[0006] Preferably, the system further comprises a filter module; the filter module is located between the PWM register and the loudspeaker module, the filter module is used for filtering the PWM signal and sending the filtered PWM signal to the loudspeaker module; and the loudspeaker module is used for receiving the filtered PWM signal and playing an acoustic signal of the audio information.
[0007] Preferably, the filter module comprises a first resistor, a second resistor, a third resistor, a fourth resistor, a first capacitor, a second capacitor, a third capacitor, a fourth capacitor, a fifth capacitor, a first operational amplifier and a second operational amplifier; one end of the first resistor is connected with the output end of the PWM register, the other end of the first resistor is connected with one end of the second resistor and one end of the second capacitor respectively, the other end of the second resistor is connected with one end of the first capacitor and the positive input end of the first operational amplifier respectively, the other end of the first capacitor is grounded, the negative input end of the first operational amplifier, the other end of the second capacitor and the output end of the first operational amplifier are connected with one end of the third resistor, the other end of the third resistor is connected with one end of the fourth resistor and one end of the third capacitor respectively, the other end of the fourth resistor is connected with one end of the fourth capacitor and the positive input end of the second operational amplifier, the other end of the fourth capacitor is grounded, the negative input end of the second operational amplifier, the output end of the second operational amplifier and the other end of the third capacitor are all connected with the loudspeaker module, the positive side power supply pin of the first operational amplifier and the positive side power supply pin of the second operational amplifier are both connected with one end of the fifth capacitor and a power supply, and the other end of the fifth capacitor, the negative side power supply pin of the first operational amplifier and the negative side power supply pin of the second operational amplifier are all grounded.
[0008] Preferably, the filter module comprises a fifth resistor, a sixth resistor, a seventh resistor, a sixth capacitor, a seventh capacitor and an eighth capacitor; one end of the fifth resistor is connected to the output end of the PWM register, the other end of the fifth resistor is connected to one end of the sixth resistor and the other end of the sixth capacitor respectively, the other end of the sixth capacitor is connected to one end of the seventh capacitor and grounded, the other end of the seventh capacitor is connected to the other end of the sixth resistor and one end of the eighth capacitor respectively, the other end of the eighth capacitor is connected to one end of the seventh resistor, and the other end of the seventh resistor is connected to the speaker module.
[0009] Preferably, the system further comprises an amplification module; the amplification module is located between the filter module and the speaker module, the amplification module is used for amplifying the filtered PWM signal and sending the amplified PWM signal; and the speaker module is used for receiving the amplified PWM signal and playing the sound signal of the audio information.
[0010] Preferably, the amplification module comprises an eighth resistor, a ninth resistor, a tenth resistor, a ninth capacitor, a tenth capacitor, an eleventh capacitor, a twelfth capacitor, a power amplifier chip and an inductor; the fourth pin of the power amplifier chip is connected to the output end of the filter module, the third pin of the power amplifier chip is connected to one end of the tenth resistor, the other end of the tenth resistor is connected to one end of the tenth capacitor, the second pin of the power amplifier chip is connected to one end of the ninth capacitor, the other end of the ninth capacitor and the other end of the tenth capacitor are both grounded, the first pin of the power amplifier chip is connected to one end of the ninth resistor and one end of the eighth resistor respectively, the other end of the ninth resistor is connected to the power amplifier control pin of the PWM conversion module, the other end of the eighth resistor is grounded, the eighth pin and the fifth pin of the power amplifier chip are both connected to the speaker module, the seventh pin of the power amplifier chip is grounded, and the sixth pin of the power amplifier chip is connected to one end of the eleventh capacitor, one end of the twelfth capacitor and one end of the inductor respectively, the other end of the inductor is connected to a power supply, and the other end of the eleventh capacitor and the other end of the twelfth capacitor are grounded.
[0011] Preferably, the amplification module is connected to the speaker module through a front audio output channel and a surround audio output channel.
[0012] Preferably, the PWM conversion module is an STM32F103 chip, and the STM32F103 chip sends the PWM signal through a PA6 pin or a PA11 pin.
[0013] The second embodiment of the utility model discloses a specific technical scheme as follows: a PWM audio playing device comprises the PWM audio playing system of any one of the first embodiment of the utility model.
[0014] The embodiment of the utility model has the following beneficial effects:
[0015] The PWM conversion module in the utility model converts the read audio information into a PWM signal to directly drive the loudspeaker module to play the sound signal of the audio information by receiving the playing instruction of the audio information, so that the sound signal playing can be realized without setting an audio decoder and an externally expanded iis, uart and SPI interface, thereby reducing the design complexity of the system. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0017] Figure 1 It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0018] Figure 2 It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0019] Figure 3 It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0020] Figure 4 It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0021] Figure 5 It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0022] Figure 6 It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0023] Figure 7 It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0024] Figure 8 It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0025] Figure 9a It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0026] Figure 9b It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0027] Figure 10 It is a structural schematic view of the first embodiment of the PWM audio playing system;
[0028] Figure 11The short circuit diagram of STM32F103 chip is shown in the figure;
[0029] Figure 12 The crystal oscillator diagram of STM32F103 chip is shown in the figure;
[0030] Figure 13 The program download circuit diagram of STM32F103 chip is shown in the figure;
[0031] Among them, 101, PWM conversion module; 102, speaker module; 103, preset memory module; 104, preset host computer; 201, timer module; 202, DMA module; 203, PWM register; 301, filter module; 401, amplification module.
DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0033] The terms "first", "second", and the like in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but can optionally include steps or modules that are not listed, or can optionally include other steps or modules inherent to the process, method, product or device.
[0034] In this document, the term "embodiment" means that the specific features, structures or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appears in the specification does not necessarily refer to the same embodiment, nor is it independent or alternative to other embodiments. The skilled person in the art explicitly and implicitly understands that the embodiments described herein can be combined with other embodiments.
[0035] Please refer to Figure 1A PWM audio playing system structure schematic diagram provided by the first embodiment of the application, the system comprises: a PWM conversion module 101 and a loudspeaker module 102; an input end of the PWM conversion module 101 is connected with a preset memory module 103 and a preset host computer 104, an output end of the PWM conversion module 101 is connected with the loudspeaker module 102 and the preset memory module 103, the PWM conversion module 101 is used for receiving audio information in the preset memory module 103 and a playing instruction of audio information sent by the preset host computer 104, and sending a PWM signal to the loudspeaker module 102; the loudspeaker module 102 is used for receiving the PWM signal and playing a sound signal of the audio information.
[0036] Specifically, the STM32F103 series chip is used to realize the PWM audio playing, wherein the STM32F103 series chip comprises a compiling module, a memory module and a PWM conversion module, the memory module is a flash memory, and can also be a memory device arranged separately from the STM32F103 series chip; the compiling module receives audio to be played, and compiles the audio to be played into audio information and saves the audio information in the memory module; the PWM conversion module reads the audio information in the flash memory, and acquires the audio information in the flash memory in response to a playing instruction sent by a host computer to the STM32F103 series chip, and sends a PWM signal to a loudspeaker module to drive the loudspeaker module to play; wherein the loudspeaker module can be an SPK loudspeaker.
[0037] The PWM conversion module in the embodiment converts the read audio information into a PWM signal to directly drive the loudspeaker module to play a sound signal of the audio information by receiving a playing instruction of the audio information, so that the sound signal playing can be realized without setting an audio decoder and externally expanded iis, uart and SPI interfaces, thereby reducing the design complexity of the system.
[0038] In specific embodiments, please refer to Figure 2The PWM conversion module 101 comprises a timer module 201, a DMA module 202 and a PWM register 203; the input end of the timer module 201 is connected with the preset host computer 104, the output end of the timer module 201 is connected with the input end of the DMA module 202, the timer module 201 is used for receiving the playing instruction of the audio information and sending the audio acquisition instruction to the DMA module 202; the input end of the DMA module 202 is also connected with the preset memory module 103, the output end of the DMA module 202 is connected with the input end of the PWM register 203 and the preset memory module 103, the DMA module 202 is used for receiving the audio acquisition instruction, sending the audio acquisition instruction to the preset memory module 103, receiving the audio information in the preset memory module 103 and sending the audio information to the PWM register 203; the output end of the PWM register 203 is connected with the loudspeaker module 102, the PWM register 203 is used for receiving the audio information and sending the PWM signal to the loudspeaker module 102.
[0039] Specifically, the timer module is used for receiving the playing instruction and sending the audio acquisition instruction to the DMA module, the DMA module receives the audio acquisition instruction, saves the audio information in the flash memory into the DMA module and sends the audio information to the PWM register, the PWM register converts the audio information into the PWM signal and sends the PWM signal to the loudspeaker module to drive the loudspeaker module to realize playing. The timer module, the DMA module and the PWM register in the embodiment are all the hardware modules in the STM32F103 series chip, thus it is not necessary to set additional hardware modules to realize the playing of the audio, thereby reducing the cost of the playing system.
[0040] In specific embodiments, the loudspeaker module is used for receiving the PWM signal and sending the sound signal. Specifically, the PWM signal enters the coil (voice coil) of the loudspeaker module to generate a magnetic field, the magnetic field interacts with the magnetic field of the magnet to generate a pushing force or an attracting force, thereby pushing the loudspeaker module to move, so as to push the air to generate sound.
[0041] In specific embodiments, please refer to Figure 3The system further comprises a filter module 301; the filter module 301 is located between the PWM register 203 and the speaker module 102, and is configured to filter the PWM signal and send the filtered PWM signal to the speaker module 102; and the speaker module 102 is configured to receive the filtered PWM signal and play the sound signal of the audio information. Specifically, the filter module can be a low-pass filter or a band-pass filter, and the low-pass cutoff frequency is 1 / 2 or even smaller than the frequency of the PWM signal. The filter module can filter out unnecessary frequency domain parts of the PWM signal.
[0042] In specific embodiments, referring to Figure 4 The filter module 301 comprises a first resistor R253, a second resistor R254, a third resistor R255, a fourth resistor R256, a first capacitor C158, a second capacitor C159, a third capacitor C160, a fourth capacitor C161, a fifth capacitor C162, a first operational amplifier U88A and a second operational amplifier U88B; one end of the first resistor R253 is connected to the output end of the PWM register 203, and the other end of the first resistor R253 is connected to one end of the second resistor R254 and one end of the second capacitor C159, respectively; the other end of the second resistor R254 is connected to one end of the first capacitor C158 and the positive input end of the first operational amplifier U88A, respectively; the other end of the first capacitor C158 is grounded; the negative input end of the first operational amplifier U88A, the other end of the second capacitor C159 and the output end of the first operational amplifier U88A are connected to one end of the third resistor R255; the other end of the third resistor R255 is connected to one end of the fourth resistor R256 and one end of the third capacitor C160, respectively; the other end of the fourth resistor R256 is connected to one end of the fourth capacitor C161 and the positive input end of the second operational amplifier U88B; the other end of the fourth capacitor C161 is grounded; the negative input end of the second operational amplifier U88B, the output end of the second operational amplifier U88B and the other end of the third capacitor C160 are all connected to the speaker module 102; the positive side power supply pin of the first operational amplifier U88A and the positive side power supply pin of the second operational amplifier U88B are both connected to one end of the fifth capacitor C162 and a power supply; and the other end of the fifth capacitor C162, the negative side power supply pin of the first operational amplifier U88A and the negative side power supply pin of the second operational amplifier U88B are all grounded. The operational amplifier has flexible configuration capability, and different filtering characteristics can be achieved by selecting appropriate capacitor and resistor values, and adjusting parameters such as feedback resistor and input capacitor. By using two operational amplifiers, the configuration flexibility of the filter can be further increased, and more complex filtering functions can be achieved.
[0043] In specific embodiments, referring to Figure 5 , the filter module 301 comprises a fifth resistor R251, a sixth resistor R252, a seventh resistor R223, a sixth capacitor C149, a seventh capacitor C150 and an eighth capacitor C111; one end of the fifth resistor R251 is connected to the output end of the PWM register 203, the other end of the fifth resistor R251 is connected to one end of the sixth resistor R252 and the other end of the sixth capacitor C149 respectively, the other end of the sixth capacitor C149 is connected to one end of the seventh capacitor C150 and grounded, the other end of the seventh capacitor C150 is connected to the other end of the sixth resistor R252 and one end of the eighth capacitor C111 respectively, the other end of the eighth capacitor C111 is connected to one end of the seventh resistor R223, the other end of the seventh resistor R223 is connected to the speaker module 102. In the circuit, high-frequency noise often interferes with the clarity and stability of the signal. The filter formed by the series connection of the resistor and the capacitor, especially the low-pass filter, can effectively filter out these high-frequency noises. This is because the capacitor has small impedance to high-frequency signals, allowing high-frequency noise to flow through the capacitor to the ground, thereby purifying the output signal.
[0044] In specific embodiments, referring to Figure 6 , the system further comprises an amplification module 401; the amplification module 401 is located between the filter module 301 and the speaker module 102, the amplification module 401 is used to amplify the filtered PWM signal and send the amplified PWM signal; the speaker module 102 is used to receive the amplified PWM signal and play the sound signal of the audio information. Specifically, the amplification module amplifies the PWM signal to improve the audio quality when the speaker module plays.
[0045] In specific embodiments, referring to Figure 7The amplification module 401 comprises an eighth resistor R219, a ninth resistor R220, a tenth resistor R221, a ninth capacitor C106, a tenth capacitor C107, an eleventh capacitor C109, a twelfth capacitor C110, a power amplifier chip U22 and an inductor L8. The fourth pin of the power amplifier chip U22 is connected to the output end of the filter module 301. The third pin of the power amplifier chip U22 is connected to one end of the tenth resistor R221. The other end of the tenth resistor R221 is connected to one end of the tenth capacitor C107. The second pin of the power amplifier chip U22 is connected to one end of the ninth capacitor C106. The other end of the ninth capacitor C106 and the other end of the tenth capacitor C107 are both grounded. The first pin of the power amplifier chip U22 is connected to one end of the ninth resistor R220 and one end of the eighth resistor R219 respectively. The other end of the ninth resistor R220 is connected to the power amplifier control pin of the PWM conversion module 101. The other end of the eighth resistor R219 is grounded. The eighth pin and the fifth pin of the power amplifier chip U22 are both connected to the speaker module 102. The seventh pin of the power amplifier chip U22 is grounded. The sixth pin of the power amplifier chip U22 is connected to one end of the eleventh capacitor C109, one end of the twelfth capacitor C110 and one end of the inductor L8 respectively. The other end of the inductor L8 is connected to a power supply. The other end of the eleventh capacitor C109 and the other end of the twelfth capacitor C110 are grounded. The PWM power amplifier circuit adjusts the average power output to the load by changing the duty cycle of the pulse signal (i.e. the ratio of pulse width to pulse period), rather than the traditional way of adjusting the voltage or current amplitude. This way can significantly reduce the energy loss in the power conversion process, and improve the overall efficiency of the system. Therefore, using the power amplifier chip to amplify the PWM signal can ensure that the audio equipment maintains high performance while saving energy.
[0046] In specific embodiments, the amplification module 401 is connected to the speaker module 102 through the front audio output channel and the surround audio output channel. The front audio output channel is a power amplifier front output channel, which is used for functions such as selecting sound sources, arranging sound effects and preliminary amplification, and has the function of preserving audio fidelity. The surround audio output channel is composed of five front channels (left, center, right, left rear and right rear) and one bass channel, so that the listener can experience the stereo and spatial sense of the sound.
[0047] Specifically, the DMA module 202 has the characteristics of releasing CPU resources to alleviate the data processing pressure of the MCU of the chip caused by audio transmission; the DMA module 202 works under the triggering of the timer module 201 and also supports controllable sound playing speed.
[0048] In specific embodiments, the audio information in the memory module is saved to the DMA module 202 in full interrupt mode or half interrupt mode. Specifically, if the audio information transmission process only uses full interrupt mode as the only interrupt source, it may be delayed due to other tasks, and the main frequency of the STM32F103 series chip is relatively low, which may cause the audio information to not be calculated in time. In addition, the DMA module 202 continuously transmits data to the PWM register 203 under the trigger of the overflow of the timer module 201. When full interrupt occurs, the DMA module 202 may transmit 1-2 pieces of audio information that have not been updated, resulting in audio distortion. Therefore, when playing audio, the timer is set to a certain time, and when the timer overflows, the DMA transmission half / full interrupt save mode is entered, as shown in FIG. 8. When saving in half interrupt mode, as shown in FIG. 9, the first half of the audio data 0-4 is updated to the DMA module 202 in real time, and the audio information 5-9 is updated to the DMA module 202 as the next half interrupt save data when the next audio information is obtained. When saving in full interrupt mode, as shown in FIG. 10, the obtained audio data 0-9 is updated to the DMA module 202 in real time, so that the audio data playback is not caused to be stuck. Figure 8 Figure 9a Figure 9b
[0049] Specifically, the audio information is stored in a storage module (ROM), which can be one of a Flash, an EEPROM, and the like. The storage module is usually a non-volatile memory, and the audio data will not be lost after power failure. The memory module (RAM) is a volatile memory for buffering audio information, and the audio information in the storage module is carried to the memory module by the CPU. The DMA module 202 carries the audio information in the memory to the PWM register 203 in the PWM conversion module 101, and the carrying rate of the DMA is controlled by the timer module 201. The carrying rate is the sampling rate of audio playback, and the DMA module 202 generates half interrupts and full interrupts during the carrying process. The filter module 301 and the amplification module 401 constitute a filter amplification module 401, which has two functions. One is to convert the PWM signal to an analog signal, and the other is to amplify the power of the analog signal for driving the speaker module 102 to play and emit sound. Among them, the memory module, the DMA module 202, the PWM register 203, the timer module 201, and the CPU all belong to the MCU, and the STM32F103 is a kind of MCU that simultaneously has the memory module, the DMA module 202, the PWM register 203, the timer module 201, and the CPU. The Chinese name is a single-chip microcomputer.
[0050] Some MCUs also have ROM, and the DMA module 202 of the MCU also supports directly transferring audio information from the ROM to the PWM module, so the memory module (RAM) can also be omitted. The memory module (RAM) also has the function of allowing the CPU to modify the cached audio information in the RMA after reading the audio data in the ROM to the RMA, such as volume amplification, reduction, pitch change, etc., but if the memory module cannot modify the data fixed in the ROM, it cannot realize volume amplification, reduction, pitch change, etc. operation, because the ROM is a read-only and non-modifiable memory. Some MCUs also have large-capacity ROM, and the DMA module 202 of the MCU also supports directly transferring audio information from the ROM to the PWM register 203, so the memory module (RAM) can also be omitted.
[0051] In specific embodiments, please refer to Figure 10 The PWM conversion module 101 is an STM32F103 chip, which sends a PWM signal through a PA6 pin or a PA11 pin. The PA0-PA7, PB0, and PB1 pins of the STM32F103 chip can be used to obtain audio information and play instructions. Figure 11 It is a short cap for the STM32F103 chip, which is connected to the 44th pin of the STM32F103 chip. It is usually referred to as a jumper cap, which is a connector device used for shorting between chip pins. The design of such a device is mainly to realize the electrical connection between the chip pins, so as to change or control the working state of the chip. Figure 12 It is a crystal oscillator for the STM32F103 chip, which is connected to the fifth pin and the sixth pin of the STM32F103 chip. Figure 13 It is a program download circuit diagram for the STM32F103 chip, which is connected to the 34th pin and the 37th pin of the STM32F103 chip.
[0052] In specific embodiments, the second embodiment of the present application provides a PWM audio playback device, which comprises the PWM audio playback system of any one of the first embodiment of the present application.
[0053] The above is the description of the embodiments of the present application. Through the above description of the disclosed embodiments, those skilled in the art can implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0054] The above embodiments only express several implementation ways of the present application, and the description is specific and detailed, but it should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A PWM audio playback system, characterized by, The system comprises a PWM conversion module and a speaker module; The input end of the PWM conversion module is connected with a preset memory module and a preset host computer, the output end of the PWM conversion module is connected with the speaker module and the preset memory module, the PWM conversion module is used for receiving audio information in the preset memory module and a playing instruction of audio information sent by the preset host computer, and sending a PWM signal to the speaker module; The speaker module is used for receiving the PWM signal and playing an acoustic signal of the audio information.
2. The PWM audio playback system of claim 1, wherein, The PWM conversion module comprises a timer module, a DMA module and a PWM register; The input end of the timer module is connected with the preset host computer, the output end of the timer module is connected with the input end of the DMA module, the timer module is used for receiving the playing instruction of the audio information and sending an audio acquisition instruction to the DMA module; The input end of the DMA module is also connected with the preset memory module, the output end of the DMA module is connected with the input end of the PWM register and the preset memory module, the DMA module is used for receiving the audio acquisition instruction, sending the audio acquisition instruction to the preset memory module, receiving the audio information in the preset memory module and sending the audio information to the PWM register; The output end of the PWM register is connected with the speaker module, the PWM register is used for receiving the audio information and sending the PWM signal to the speaker module.
3. The PWM audio playback system of claim 2, wherein, The system further comprises a filter module; The filter module is located between the PWM register and the speaker module, the filter module is used for filtering the PWM signal and sending the filtered PWM signal to the speaker module; The speaker module is used for receiving the filtered PWM signal and playing the acoustic signal of the audio information.
4. The PWM audio playback system of claim 3, wherein, The filter module comprises a first resistor, a second resistor, a third resistor, a fourth resistor, a first capacitor, a second capacitor, a third capacitor, a fourth capacitor, a fifth capacitor, a first operational amplifier and a second operational amplifier; One end of the first resistor is connected to the output end of the PWM register, the other end of the first resistor is connected to one end of the second resistor and one end of the second capacitor respectively, the other end of the second resistor is connected to one end of the first capacitor and the positive input end of the first operational amplifier respectively, the other end of the first capacitor is grounded, the negative input end of the first operational amplifier, the other end of the second capacitor and the output end of the first operational amplifier are connected to one end of the third resistor, the other end of the third resistor is connected to one end of the fourth resistor and one end of the third capacitor respectively, the other end of the fourth resistor is connected to one end of the fourth capacitor and the positive input end of the second operational amplifier, the other end of the fourth capacitor is grounded, the negative input end of the second operational amplifier, the output end of the second operational amplifier and the other end of the third capacitor are all connected to the speaker module, the positive side power supply pin of the first operational amplifier and the positive side power supply pin of the second operational amplifier are both connected to one end of the fifth capacitor and a power supply, the other end of the fifth capacitor, the negative side power supply pin of the first operational amplifier and the negative side power supply pin of the second operational amplifier are all grounded.
5. The PWM audio playback system of claim 3, wherein, The filter module comprises a fifth resistor, a sixth resistor, a seventh resistor, a sixth capacitor, a seventh capacitor and an eighth capacitor. One end of the fifth resistor is connected to the output end of the PWM register, the other end of the fifth resistor is connected to one end of the sixth resistor and the other end of the sixth capacitor respectively, the other end of the sixth capacitor is connected to one end of the seventh capacitor and grounded, the other end of the seventh capacitor is connected to the other end of the sixth resistor and one end of the eighth capacitor respectively, the other end of the eighth capacitor is connected to one end of the seventh resistor, the other end of the seventh resistor is connected to the speaker module.
6. The PWM audio playback system of claim 3, wherein, The system further comprises an amplification module; The amplification module is located between the filter module and the speaker module, and is used for amplifying the filtered PWM signal and sending the amplified PWM signal. The speaker module is used for receiving the amplified PWM signal and playing the sound signal of the audio information.
7. The PWM audio playback system of claim 6, wherein, The amplification module comprises an eighth resistor, a ninth resistor, a tenth resistor, a ninth capacitor, a tenth capacitor, an eleventh capacitor, a twelfth capacitor, a power amplifier chip and an inductor. The fourth pin of the power amplifier chip is connected with the output end of the filter module, the third pin of the power amplifier chip is connected with one end of the tenth resistor, the other end of the tenth resistor is connected with one end of the tenth capacitor, the second pin of the power amplifier chip is connected with one end of the ninth capacitor, the other end of the ninth capacitor and the other end of the tenth capacitor are grounded, the first pin of the power amplifier chip is connected with one end of the ninth resistor and one end of the eighth resistor respectively, the other end of the ninth resistor is connected with the power amplifier control pin of the PWM conversion module, the other end of the eighth resistor is grounded, the eighth pin and the fifth pin of the power amplifier chip are connected with the loudspeaker module, the seventh pin of the power amplifier chip is grounded, and the sixth pin of the power amplifier chip is connected with one end of the eleventh capacitor, one end of the twelfth capacitor and one end of the inductor respectively, the other end of the inductor is connected with the power supply, and the other end of the eleventh capacitor and the other end of the twelfth capacitor are grounded.
8. The PWM audio playback system of claim 6, wherein, The amplification module is connected with the loudspeaker module through the front audio output channel and the surround audio output channel.
9. The PWM audio playback system of claim 1, wherein, The PWM conversion module is an STM32F103 chip, and the STM32F103 chip sends the PWM signal through a PA6 pin or a PA11 pin.
10. A PWM audio playback device, characterized by A PWM audio playing system as claimed in any one of claims 1-9.