CN107995561B - Vehicle-mounted instrument audio control system and control method - Google Patents

Vehicle-mounted instrument audio control system and control method Download PDF

Info

Publication number
CN107995561B
CN107995561B CN201711465050.7A CN201711465050A CN107995561B CN 107995561 B CN107995561 B CN 107995561B CN 201711465050 A CN201711465050 A CN 201711465050A CN 107995561 B CN107995561 B CN 107995561B
Authority
CN
China
Prior art keywords
data
spi
mcu controller
decoder
output end
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.)
Active
Application number
CN201711465050.7A
Other languages
Chinese (zh)
Other versions
CN107995561A (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.)
Chongqing Delco Electronic Instrument Co ltd
Original Assignee
Chongqing Delco Electronic Instrument 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 Chongqing Delco Electronic Instrument Co ltd filed Critical Chongqing Delco Electronic Instrument Co ltd
Priority to CN201711465050.7A priority Critical patent/CN107995561B/en
Publication of CN107995561A publication Critical patent/CN107995561A/en
Application granted granted Critical
Publication of CN107995561B publication Critical patent/CN107995561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04SSTEREOPHONIC SYSTEMS 
    • H04S7/00Indicating arrangements; Control arrangements, e.g. balance control

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The invention provides an audio control system and method of a vehicle-mounted instrument, wherein the system comprises an MCU controller, an I2S decoder and a power amplifier; the decoder enabling signal output end of the MCU controller is connected with the enabling end of the I2S decoder, and the power amplifier enabling signal output end of the MCU controller is connected with the enabling end of the power amplifier; the data output end of the MCU controller is connected with the data input end of the I2S decoder, the analog signal output end of the I2S decoder is connected with the signal input end of the power amplifier, and the output end of the power amplifier is connected with the loudspeaker; and the PWM signal output end of the PWM module of the MCU controller is respectively connected with the serial clock interface of the I2S decoder and the two SPI serial clock interfaces of the SPI module of the MCU controller. The invention has low production cost and high playing quality.

Description

Vehicle-mounted instrument audio control system and control method
Technical Field
The invention relates to the field of automobile instruments, in particular to an audio control system and an audio control method for an automobile instrument.
Background
The voice prompt and the early warning are indispensable functions in the automobile combination instrument. The prior automobile combination instrument has simpler requirements for voice prompt, and can only send out simple voices of 'beep', 'dongdong'.
With the development of industry and the increasing demand of human beings, a large number of automobile host factories have required combination meters to realize the playing of audio files (such as WAV). In order to play audio files on conventional meters, many meter manufacturers use a solution of externally hung voice chips. However, the cost of the externally-hung voice chip is high although the externally-hung voice chip can realize audio playing.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention aims to provide a low-cost vehicle-mounted instrument audio control system and a control method.
In order to achieve the above object, the present invention provides a vehicle-mounted instrument audio control system, comprising an MCU controller, an I2S decoder, and a power amplifier;
the decoder enabling signal output end of the MCU controller is connected with the enabling end of the I2S decoder, and the power amplifier enabling signal output end of the MCU controller is connected with the enabling end of the power amplifier;
the data output end of the MCU controller is connected with the data input end of the I2S decoder, the analog signal output end of the I2S decoder is connected with the signal input end of the power amplifier, and the output end of the power amplifier is connected with the loudspeaker;
and the PWM signal output end of the PWM module of the MCU controller is respectively connected with the serial clock interface of the I2S decoder and the two SPI serial clock interfaces of the SPI module of the MCU controller. The PWM signal clocks both the I2S decoder and the two-way SPI.
The vehicle-mounted instrument audio control system simulates I2S communication through one path of PWM and two paths of SPI in the MCU controller, the MCU controller transmits audio data stored in the MCU controller to the I2S decoder through an simulated I2S channel, the I2S decoder converts the received audio data into DA output, and analog signals output by the DA are transmitted to the loudspeaker for playing after passing through the power amplifier. Because the two SPI serial clock interfaces of the MCU controller share the same clock source, namely PWM signals output by the MCU controller, the output of the two SPIs is completely synchronous. The vehicle-mounted instrument audio control system realizes audio playing only by adding the I2S decoding chip and the power amplifier, and has low production cost and high playing quality compared with the scheme of externally hung voice chips.
Further, the data output end of the MCU controller comprises an audio data output end and a channel clock data output end, the audio data output end is connected with the audio data input end of the I2S decoder and used for sending audio data to the I2S decoder, the channel clock data output end is connected with the frame clock input end of the I2S communication and used for providing a clock for switching left and right channels for the I2S decoder, the left channel data is transmitted when the channel clock data is in a low level, the right channel data is transmitted when the channel clock data is in a high level, and the left channel data and the right channel data are the same data. This results in a better audio playback effect.
Further, the duty ratio of the PWM signal output by the MCU controller is 50%.
The invention also provides a vehicle-mounted instrument audio control method based on the vehicle-mounted instrument audio control system, which comprises the following steps:
s1, loading an audio file into FLASH of the MCU controller;
s2, powering up the MCU controller and initializing the PWM module and the SPI module;
wherein, the initializing content includes: PWM output of the PWM module is forbidden, so that a PWM signal output end outputs low level; setting two paths of SPIs of the SPI module to be in an s-lay mode and prohibiting serial clock transmission; setting SPI communication data length; after the SPI module is set, the SPI module is forbidden to send enabling;
s3, after initialization of the PWM module and the SPI module is completed, setting a decoder enabling signal AUDIO_EN and a power amplifier enabling signal AUDIO_MUTE of the MCU controller to be high level, and enabling an I2S decoder and a power amplifier;
s4, loading data at the head of the PCM of the audio file into SPI FIFO of a transmitting register of two paths of SPIs, and enabling SPI module data transmission after the data loading is completed;
s5, the MCU controller outputs PWM signals to provide clock signals for the SPI module so that the SPI module can send data;
s6, after all data in the SPI FIFO of the sending register are sent, the MCU controller triggers an interrupt, pauses the data sending of the SPI FIFO of the sending register, judges whether all audio data are loaded completely, and continues to load PCM data if the audio data are not loaded completely; if the audio file is loaded, stopping the output of the PWM module and the SPI module after the data transmission of the SPI module is completed, and completing the playing of the whole audio file.
The vehicle-mounted instrument audio control method is simple and easy to realize, saves the production cost in playing the audio file, and achieves the playing effect of the externally hung voice chip.
Further, the communication data length of the SPI module is set to be 8bi t.
Further, when the PCM header data of the audio file is loaded into the two-path SPI transmission register SPI FIFO, the load data size is the size of the transmission register SPI FIFO.
Further, the output frequency of the MCU controller for outputting the PWM signal is determined by the code rate of the played audio file. If the code rate of the played WAV file is 32KHZ, the frequency to be output by PWMUT1 is 1024KHZ.
The beneficial effects of the invention are as follows: according to the invention, the I2S decoding chip and the power amplifier are added to realize audio playing, so that the cost advantage is obvious compared with the scheme of externally hung voice chips; the audio data played through I2S communication and decoding is lossless and better in jitter resistance, and the effect is better than that of a common voice chip.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and may be better understood from the following description of embodiments taken in conjunction with the accompanying drawings in which:
FIGS. 1-2 are schematic circuit diagrams of the present invention;
FIG. 3 is a timing diagram of I2S communication;
fig. 4 is a flow chart of the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
In the description of the present invention, unless otherwise specified and defined, it should be noted that the terms "mounted," "connected," and "coupled" are to be construed broadly, and may be, for example, mechanical or electrical, or may be in communication with each other between two elements, directly or indirectly through intermediaries, as would be understood by those skilled in the art, in view of the specific meaning of the terms described above.
As shown in fig. 1 to 2, the present invention provides a vehicle instrument audio control system including an MCU controller U1, an I2S decoder U2, and a power amplifier U3.
The decoder enabling signal output end of the MCU controller U1 is connected with the enabling end of the I2S decoder U2, and the power amplifier enabling signal output end of the MCU controller U1 is connected with the enabling end of the power amplifier U3.
The data output end of the MCU controller U1 is connected with the data input end of the I2S decoder U2, wherein the data output end of the MCU controller U1 comprises an audio data output end SPIO_MOSI and a channel clock data output end SPI1_MOSI, the audio data output end SPIO_MOSI is connected with the audio data input end DIN of the I2S decoder U2 and sends audio data SD to the I2S decoder U2, the channel clock data output end SPI1_MOSI is connected with the frame clock input end LRCK of the I2S communication, a clock signal WS for switching left and right channels is provided for the I2S decoder U2, left channel data is transmitted when the channel clock data is in a low level, right channel data is transmitted when the channel clock data is in a high level, and the left channel data and the right channel data are the same data.
The analog signal output terminal OUTR of the I2S decoder U2 is connected to the signal input terminal IN+ of the power amplifier U3, and the output terminal VO+ of the power amplifier U3 is connected to a speaker.
The PWM signal output terminal PWMOUT1 of the PWM module of the MCU controller U1 is connected to the serial clock interface BCK of the I2S decoder U2 and the two SPI serial clock interfaces spio_sck and spi1_sck of the SPI module of the MCU controller U1, respectively. The duty ratio of the PWM signal output by the MCU controller U1 is 50%.
The vehicle-mounted instrument audio control system simulates I2S communication through one path of PWM and two paths of SPI in the MCU controller U1, the MCU controller U1 transmits audio data stored in the MCU controller U1 to the I2S decoder U2 through an simulated I2S channel, the I2S decoder U2 converts the received audio data into DA output, and analog signals output by the DA are transmitted to a loudspeaker for playing after passing through the power amplifier U3.
The standard I2S communication timing of this embodiment is shown in fig. 3, where the clock signal WS for switching the left and right channels and the audio data SD change data at the falling edge of the serial clock BCK, and the rising edge latches the data. The audio file adopted in this embodiment is WAV, the PCM data length of the WAV is 16 bits, and two channels are adopted for transmission, so the data length of each channel is 16Bit, and the data length of each sampling point is 32Bit. The left channel data is transmitted when the clock signal WS for switching the left and right channels is low, and the right channel data is transmitted when the clock signal WS for switching the left and right channels is high. The audio data SD is transmitted with one clock period later than the clock signal WS switching the left and right channels.
PWMOUT1 must be set to 50% duty cycle as the clock source for BCK. The output frequency of PWMOUT1 depends on the code rate of the WAV file being played. If the code rate of the played WAV file is 32KHZ, the frequency to be output by PWMUT1 is 1024KHZ.
Since both SPIs share the same clock source, the outputs of SPI0_MOSI and SPI1_MOSI can be completely synchronized. The clock signal WS switching the left and right channels is low when the SPI0_mosi output data is 0, and the clock signal WS switching the left and right channels is high when the SPI0_mosi output data is 1. The alternate outputs of 0x0001 and 0xfffe of SPI0_mosi in one sampling point period can generate the standard timing of the clock signal WS for switching the left and right channels in fig. 3.
Although the data in the I2S is transmitted by adopting two channels, the actual display effect can only be mono because of only one loudspeaker in the automobile combination instrument, so that the data source of the WAV only needs mono. The SPI1 MOSI outputs the same data when the left channel and the right channel.
The invention also provides a vehicle-mounted instrument audio control method, as shown in fig. 4, comprising the following steps:
firstly, loading an audio file into FLASH of the MCU controller U1.
And secondly, powering up the MCU controller U1 and initializing the PWM module and the SPI module.
Wherein, the initializing content includes: PWM output of the PWM module is forbidden, so that a PWM signal output end outputs low level; the two-way SPI of the SPI module is set to s-lay mode and serial clock transmission is disabled. Setting SPI communication data length; and after the SPI module is set, disabling the transmission enabling of the SPI module. The communication data length of the SPI module is preferably set to be 8bi t.
Third, after the initialization of the PWM module and the SPI module is completed, the decoder enable signal audio_en and the power amplifier enable signal audio_mute of the MCU controller U1 are set to high level, and the I2S decoder and the power amplifier U3 are enabled.
And step four, loading the data at the head of the PCM of the audio file into the SPI FIFO of the transmitting register of the two SPIs, wherein the size of the loaded data is the size of the SPI FIFO of the transmitting register, and after the data loading is completed, enabling the SPI module to transmit data.
And fifthly, the MCU controller U1 outputs PWM signals to provide clock signals for the SPI module so that the SPI module can send data.
Sixthly, after all data in the SPI FIFO of the sending register are sent, the MCU controller U1 triggers an interrupt, pauses the data sending of the SPI FIFO of the sending register, judges whether all audio data are loaded completely, and continues to load PCM data if the audio data are not loaded completely; if the audio file is loaded, stopping the output of the PWM module and the SPI module after the data transmission of the SPI module is completed, and completing the playing of the whole audio file.
The output frequency of the PWM signal output by the MCU controller U1 is determined by the code rate of the played audio file. If the code rate of the played WAV file is 32KHZ, the frequency to be output by PWMUT1 is 1024KHZ.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the invention, the scope of which is defined by the claims and their equivalents.

Claims (4)

1. The vehicle-mounted instrument audio control system is characterized by comprising an MCU controller, an I2S decoder and a power amplifier;
the decoder enabling signal output end of the MCU controller is connected with the enabling end of the I2S decoder, and the power amplifier enabling signal output end of the MCU controller is connected with the enabling end of the power amplifier;
the data output end of the MCU controller is connected with the data input end of the I2S decoder, the analog signal output end of the I2S decoder is connected with the signal input end of the power amplifier, and the output end of the power amplifier is connected with the loudspeaker;
the PWM signal output end of the PWM module of the MCU controller is respectively connected with the serial clock interface of the I2S decoder and the two SPI serial clock interfaces of the SPI module of the MCU controller;
the data output end of the MCU controller comprises an audio data output end and a channel clock data output end, the audio data output end is connected with the audio data input end of the I2S decoder and used for sending audio data to the I2S decoder, the channel clock data output end is connected with the frame clock input end of I2S communication and used for providing a clock for switching left and right channels for the I2S decoder, the channel clock data are used for transmitting left channel data when the channel clock data are in a low level, the channel clock data are used for transmitting right channel data when the channel clock data are in a high level, and the left channel data and the right channel data are the same data;
the duty ratio of the PWM signal output by the MCU controller is 50%.
2. A vehicle-mounted meter audio control method based on the vehicle-mounted meter audio control system according to claim 1, characterized by comprising the steps of:
s1, loading an audio file into FLASH of the MCU controller;
s2, powering up the MCU controller and initializing the PWM module and the SPI module;
wherein, the initializing content includes: PWM output of the PWM module is forbidden, so that a PWM signal output end outputs low level; setting two paths of SPIs of the SPI module to be in a slave mode and prohibiting serial clock transmission; setting SPI communication data length; after the SPI module is set, the SPI module is forbidden to send enabling;
s3, after initialization of the PWM module and the SPI module is completed, setting a decoder enabling signal AUDIO_EN and a power amplifier enabling signal AUDIO_MUTE of the MCU controller to be high level, and enabling an I2S decoder and a power amplifier;
s4, loading data at the head of the PCM of the audio file into SPI FIFO of a transmitting register of two paths of SPIs, and enabling SPI module data transmission after the data loading is completed;
s5, the MCU controller outputs PWM signals to provide clock signals for the SPI module so that the SPI module can send data;
s6, after all data in the SPI FIFO of the sending register are sent, the MCU controller triggers an interrupt, pauses the data sending of the SPI FIFO of the sending register, judges whether all audio data are loaded completely, and continues to load PCM data if the audio data are not loaded completely; if the audio file is loaded, stopping the output of the PWM module and the SPI module after the data transmission of the SPI module is completed, and completing the playing of the whole audio file.
3. The vehicle-mounted instrument audio control method according to claim 2, wherein the communication data length of the SPI module is set to 8 bits.
4. The vehicle meter audio control method according to claim 2, wherein when the PCM header data of the audio file is loaded into the transmission register SPI FIFO of the two-way SPI, the load data size is the size of the transmission register spifo.
CN201711465050.7A 2017-12-28 2017-12-28 Vehicle-mounted instrument audio control system and control method Active CN107995561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711465050.7A CN107995561B (en) 2017-12-28 2017-12-28 Vehicle-mounted instrument audio control system and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711465050.7A CN107995561B (en) 2017-12-28 2017-12-28 Vehicle-mounted instrument audio control system and control method

Publications (2)

Publication Number Publication Date
CN107995561A CN107995561A (en) 2018-05-04
CN107995561B true CN107995561B (en) 2024-03-01

Family

ID=62042538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711465050.7A Active CN107995561B (en) 2017-12-28 2017-12-28 Vehicle-mounted instrument audio control system and control method

Country Status (1)

Country Link
CN (1) CN107995561B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115243161B (en) * 2022-07-13 2023-06-27 上海富芮坤微电子有限公司 Audio output pin multiplexing circuit, device and method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8059830B1 (en) * 2007-12-07 2011-11-15 Robert Connor Gleason Audio system and method of use
CN102332293A (en) * 2011-07-22 2012-01-25 重庆长安汽车股份有限公司 Vehicle-mounted digital music player
CN104581522A (en) * 2013-10-24 2015-04-29 西安群丰电子信息科技有限公司 High definition lossless audio playing system (HDAP)
CN105301988A (en) * 2014-06-05 2016-02-03 惠州市德赛西威汽车电子股份有限公司 MOST network based universal car audio development platform and signal transmission method
CN206323551U (en) * 2017-01-06 2017-07-11 北京新能源汽车股份有限公司 A kind of automobile warning tone control system and automobile
CN107054210A (en) * 2017-03-16 2017-08-18 吉林航盛电子有限公司 A kind of warning tone generator of new-energy automobile
CN207692037U (en) * 2017-12-28 2018-08-03 重庆德科电子仪表有限公司 The lossless language play back system of onboard instruments low cost

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020177915A1 (en) * 2001-05-23 2002-11-28 Akinobu Kawamura Audio amplifier circuit with digital audio interface and codec device using the same

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8059830B1 (en) * 2007-12-07 2011-11-15 Robert Connor Gleason Audio system and method of use
CN102332293A (en) * 2011-07-22 2012-01-25 重庆长安汽车股份有限公司 Vehicle-mounted digital music player
CN104581522A (en) * 2013-10-24 2015-04-29 西安群丰电子信息科技有限公司 High definition lossless audio playing system (HDAP)
CN105301988A (en) * 2014-06-05 2016-02-03 惠州市德赛西威汽车电子股份有限公司 MOST network based universal car audio development platform and signal transmission method
CN206323551U (en) * 2017-01-06 2017-07-11 北京新能源汽车股份有限公司 A kind of automobile warning tone control system and automobile
CN107054210A (en) * 2017-03-16 2017-08-18 吉林航盛电子有限公司 A kind of warning tone generator of new-energy automobile
CN207692037U (en) * 2017-12-28 2018-08-03 重庆德科电子仪表有限公司 The lossless language play back system of onboard instruments low cost

Also Published As

Publication number Publication date
CN107995561A (en) 2018-05-04

Similar Documents

Publication Publication Date Title
US9521503B2 (en) Audio player with bluetooth function and audio playing method thereof
WO2007101715A3 (en) System comprising a navigation device and an electronic device
RU2008107745A (en) ADDITIONAL DEVICE OF MOBILE TERMINAL FOR RECEIVING AND PLAYBACK OF DMB DATA, AND METHOD FOR THIS
CN107995561B (en) Vehicle-mounted instrument audio control system and control method
CN207692037U (en) The lossless language play back system of onboard instruments low cost
TW201042944A (en) Signal transmission interface and digital broadcast receiving device
US20210098011A1 (en) Audio Return Channel Data Loopback
US20140328381A1 (en) Electronic device, communication method, audio device and amplifier device using pulse density modulation for communication
TWI240169B (en) Audio-video signal transceiving processing device
TW200611575A (en) Digital audio/video playback system capable of controlling audio and video playback speed
WO2009128921A3 (en) Method and apparatus for producing a metastable flip flop
CN203243505U (en) Electronic device and built-in loudspeaker box system of electronic device
KR20080051883A (en) Audio system of vehicle for connecting portable sound generating device and method for operating the same
CN209017278U (en) A kind of sound system with the enhancing of DSP audio
CN207150808U (en) A kind of voice drive circuit
TWM588285U (en) Automatic audio signal recognition device
CN205068364U (en) Sound card
CN104378666A (en) Audio/video encoding and decoding device based on MOST bus and method
CN218849085U (en) Multifunctional sound console USB flash disk playing system
CN201204046Y (en) I<2>S audio interface circuit with high time accuracy
US20040037426A1 (en) Apparatus for converting to six-channel outputs from two-channel
CN201114604Y (en) A public emergency information receiver
CN110753289B (en) Sound equipment and sound system
RU2771788C1 (en) Terminal device and audio playback circuit
CN203574850U (en) Vehicle-mounted mobile interconnection audio transmission 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