This paper mainly introduces the application and realization of a new audio chip WT2605 in recording products. It mainly relies on the audio chip to collect data through ADC, encode the data into audio stream data and store it locally, or transmit the data to Bluetooth /WiFi/4G module through peripherals, so that the recorded data can be uploaded to the mobile app or server, which is convenient for monitoring the recorded data.
Table of Contents
The Composition of the System
This scheme mainly uses WT2605 chip to encode, decode and store audio data, and its main parameters are as follows:
- Audio codec with 16 bit DAC and 16 bit ADC
- Support audio equalizer adjustment
- ADC supports sampling rates of 8,11.025,12,16,22.05,32,44.1 and 48KHz.
- 6dB SNR high performance audio DAC and 90dB SNR ADC
- A USB 2.0 interface that supports master and slave modes
- An SPI interface and an SD card interface, which support external SPI Flash and SD card, and can connect computers to access SD card data through USB.
- A full-duplex UART interface with a communication rate of up to 1Mbps, which mainly interacts with external devices.
The Pickup Principle of WT2605:The internal design of MIC can be simply understood as a capacitor. One end of the capacitor is fixed and the other end is movable.
The distance between the two ends is related to the sound input. The magnitude and frequency of the sound cause the vibration of the metal sheet to change in amplitude and frequency. In this way, on the side of the capacitor, it is converted into the amount of capacitor charge and the charging speed, which is expressed as an electrical signal whose amplitude and frequency change with the sound input. WT2605 samples this changed electrical signal through ADC, and after filtering, it is converted into a digital signal and encoded into MP3 data (the principle of ADC sampling is not introduced here, and readers can search for it by themselves).
As the ADC of WT2605 supports the maximum sampling of 48KHz, which means that it can collect 48,000 points per second, resulting in a very large amount of data, so it is generally not directly saved in PCM format. The encoded MP3 format can basically meet most application scenarios, and the signal-to-noise ratio as high as 90dB also makes the sound more reproducible.
2) The whole system is mainly composed of WT2605 chip +4G or WiFi/BLE module. WT2605 collects MIC data, encodes the data and stores it in SPI Flash or TF card. At the same time, it sends the recording data to 4G or WiFi/BLE module through UART serial port and uploads it to the server or mobile APP for storage, realizing the functions of local recording data storage and recording data upload. The system block diagram is as follows:
WT2605 and WiFi Module Circuit
The above circuit takes WiFi module as the main control, which controls WT2605 to collect recording data and store it in SPI Flash, and at the same time, WiFi module acquires WT2605 encoded audio data in real time and uploads it to the server; Pay attention to the data interaction between WiFi module and WT2605 chip by UART. When a large amount of audio data is transmitted, it is necessary to set the bit rate of audio data coding according to the performance parameters of WiFi module itself, which can be generally set to 32kbps, 64kbps, 96kbps, 128kbps, etc. At the same time, set the communication rate of UART according to the set bit rate.
Adjusting the parameters of R3 and R4 can adjust the sensitivity of MIC. From the above introduction to the working principle of MIC, we can know that the current passing through R4 affects the current at the input capacitor, and then affects the dynamic level range of MIC output, that is, the sensitivity. If the current passing through R4 is too small and the output level is small, it will be filtered out as noise during recording. In circuit design, the setting of this circuit parameter needs to consider the noise and sensitivity comprehensively.
WiFi module controls WT2605 to decode the audio data stored in SPI Flash through instructions, and then play it after power amplifier.
Introduction of communication command format
The communication protocol mainly defines the interaction rules between the master and WT2605, how the processor pushes the data to WT2605 for corresponding processing, and WT2605 feeds back the corresponding processing results. Communication data is mainly in the form of command frame. An effective command frame must include five parts: frame header, command packet length, command packet, check code and frame trailer.
|Frame Header||Command Package Length||Command Package||Check Code||Frame Tail|
|0x7E (1 byte)||0xXX (1 byte)||data (N byte)||0xXX (1 byte)||0xEF (1 byte)|
The frame header is represented by a fixed hexadecimal data, and the frame type includes a downlink command frame (the command frame received by the module) and an upload command frame (the command frame fed bACK by the module after receiving the data, that is, ack or NAK).
Command packet length means the number of bytes in the command frame except the header and trailer, that is, command packet length (1 byte)+command packet (n bytes)+check code (1 byte) = N+2 bytes.
Command package is a specific command, which mainly includes: command+parameters.
Check code, which is the sum of command packet length and command packet.
|Frame Header||1 byte||“0x7E” defined as hexadecimal|
|Command Package Length||1 byte||Command to remove the number of bytes in the header and trailer of the frame, N+2 bytes.|
|Command Package||N byte||Command word+parameter, refer to the description of each command for details.|
|Check Code||1 byte||Checksum = [∑ (command packet length+command packet)] & 0xFF|
|Frame Tail||1 byte||“0xEF” defined as hexadecimal|
Based on the good performance parameters of WT2605 chip, it can be widely used in some high-quality recording products, such as recording pens, recording headphones and so on.