This paper introduces the design of the FPGA-based interface circuit of the audio codec chip WM8731 , including the chip configuration module and the audio data interface module, so that the controller can easily operate it only through registers. The whole design is implemented in Max+Plus Ⅱ with VHDL and Verilog HDL languages and verified.
1 Overview
WM8731 is a powerful low-power stereo 24-bit audio codec chip. Its high-performance headphone driver, low-power design, controllable sampling frequency, and selectable filter make WM8731 chip widely used in portable MP3, CD, and PDA. Its structural block diagram is shown in Figure 1.
WM8731 includes 2 line inputs and 1 microphone input with volume adjustment; built-in on-chip ADC (analog-to-digital converter) and selectable high-pass digital filter; DAC (digital-to-analog converter) with high-quality oversampling rate structure; line output and headphone output; built-in crystal oscillator and configurable digital audio interface and 2 or 3-wire optional microprocessor control interface. The controller can configure WM8731 through the control interface (Control Interface), and then read and write data audio signals through the digital audio interface (Digital Audio Interface). This paper designs a driver module based on FPGA, which converts the control interface and digital audio interface of WM8731 into a common bus interface of the controller, so that the controller can control and use the WM8731 chip like reading and writing external registers.
2 Introduction to WM8731 chip interface timing
2.1 Control interface timing
The control interface of WM8731 has 4 pins, namely: MODE (control interface selection line), CSB (chip select or address selection line), SDIN (data input line) and SCLK (clock input line). It has two modes: 2-wire and 3-wire. 2-wire is MPU interface, 3-wire is compatible with SPI interface. The configuration selection of the control interface can be completed by setting the state of the MODE pin. When MODE is selected as 0, it is 2-wire mode, and when it is 1, it is 3-wire mode. This article uses 2-wire mode to control WM8731. Its timing diagram is shown in Figure 2.
2.2 Digital Audio Interface Timing
The digital audio interface of WM8731 has 5 pins, namely: BCLK (digital audio bit clock), DACDAT (DAC digital audio data input), DACIRC (DAC sampling left/right channel signal), ADC-DAT (ADC digital audio signal output), ADCLRC (ADC sampling left/right channel signal).
The digital audio interface can work in master mode and slave mode. The 6th bit of the register with address 0000111 sets the master/slave mode of the data: "1" is master mode, "0" is slave mode. ADCDAT, /DACDAI and ADCLRC/DACLRC are synchronized with the bit clock BCIK and are transferred once on each falling edge of BCLK. BCLK and ADCLRC/DACLRC are output signals in master mode and input signals in slave mode. DAC-DAT is always an input signal and ADCDAT is always an output signal.
Digital output supports 4 audio data modes: right-aligned, left-aligned, I2S and DSP mode. The data format of the transmission can be set by configuring the registers differently. The register configuration values are as follows:
Bits 1 to 0 of register address 0000111 set the audio format: "11" is DSF' format, "10" is I2S format, "01" is left-aligned format, and "00" is right-aligned format.
3-2 bits set the word length: "11" is 32 bits, "10" is 24 bits, "01" is 20 bits, and "00" is 16 bits.
These four audio formats are all MSB first, 16 to 32 bits, but 32-bit data does not support right-aligned mode.
This article adopts the left-aligned data format of the master mode. The left-aligned data format transmission is shown in Figure 3: In the left-aligned format, the MSB is valid on the first rising edge of BCLK, followed by an ADCLRC or DACLRC transmission.
3.1 Overall design of the driver
The block diagram of the driver designed in this paper is shown in Figure 4. The dual-port RAM and the driver are connected to the data bus and address bus of the controller. The controller only needs to provide a small number of control lines to complete the control and data exchange functions of the audio codec chip wM8731.
The internal structure diagram of the driver is shown in Figure 5. The control part provides the interface between the driver and the controller (including data bus signals, address bus signals and control signals), and generates control signals for the control word conversion unit and the digital audio interface unit; the internal register caches the control word and status word; the control word conversion unit is responsible for sending the control word serially to WM8731 and verifying the transmission signal; the data audio interface unit completes the serial-to-parallel conversion between WM8731 and the external dual-port RAM, realizing the sending and receiving functions of digital audio signals.
drive
Table 1 Corresponding definitions of status register control words
3.2.2 Control word conversion unit
When the START control bit is set to '1', the data in the control word register is sent serially to WM8731. When an error occurs during transmission, the ACK bit in the status register is set to 1. See Figure 6.
3.2.3 Digital Audio Interface Unit
When the read-in digital audio flag C1 is '1', the digital audio data from the WM8731 chip is received and stored in the external dual-port RAM. When the output digital audio data flag C2 is '1', the audio data in the dual-port RAM is sent to the wM8731. See Figure 7.
The following is the timing simulation of the controller writing the control word to WM8731 through the driver module as shown in Figure 8. The definition of each pin in the figure is shown in Table 2.
4 Conclusion
The interface circuit of the audio codec chip WM8731 is designed using FPGA, which realizes the unified control of the control interface and the digital audio interface, simplifies the use steps of the audio codec chip WM8731, and has the advantages of good scalability, simple and convenient use, and easy upgrade. It also has certain reference significance for the interface design of other chips.
Previous article:Implementation of Error Detection and Correction Logic Algorithm Based on FPGA
Next article:FPGA Implementation of PN Code Capture and Tracking in Direct Sequence Spread Spectrum System
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【ST NUCLEO-G071RB Review】PWR
- There are many tricks for salary cuts and layoffs. What should you do if you encounter such a situation?
- [AB32VG1 development board review] TF card and file reading and writing applications
- How to measure power supply rejection ratio?
- 280049Solution to the problem of LaunchPad emulator not being able to connect
- Tips for Powering FPGAs
- [TI recommended course] #[High Precision Laboratory] Interface: 1 RS-485#
- What is the use of connecting Schottky diodes in parallel at both ends of the MOS tube used as a switch at the power input?
- Friends in Xi'an, please get out of this pit as soon as possible.
- Xianyu low-cost wireless digital microphone disassembly (Jerry solution)