Chord was originally a concept in music theory, referring to the combination of three or more tones stacked according to the third degree relationship; in the field of industrial design of audio equipment, chord refers to the simultaneous pronunciation of multiple sound sources , Also called polyphony and polyphony. Polyphonic ringtones have been widely used in mobile phones. Its sound is full and round and has a strong three-dimensional effect. It has completely replaced the previous single-tone ringtones. There are currently many polyphonic ringtone file formats, such as MIDI, MMF, AMR, MP3, IMY, etc. Among them, MIDI is currently the most supported ringtone file format. Its file takes up small space and has strong expressiveness. It has almost become the current polyphony. The standard configuration of ringtone phones.
The MIDI chord music in the mobile phone is realized by playing MIDI music files through the built-in highly integrated chord chip. The sound synthesis and tone calling methods used by the chord chip determine the playing effect of the ringtone. The early FM (Frequency ModulaTIon) synthesis method combined single tones of multiple frequencies into a composite sound to simulate the sound of various musical instruments, resulting in less timbre and poor sound quality. The other is the wavetable synthesis method. This method is to first record the music of various real instruments and then synthesize it. The sound is good and the range is wide. According to the different wavetable generation methods, it can be divided into software chord and hardware chord. Software chords save system overhead than hardware chords and are easier to integrate into mobile devices.
At present, there are many kinds of chord control chips in the mobile phone market. The most used are Yamaha in Japan, Winbond and Macronix in Taiwan, and Vimicro and Zhiduo in the mainland. The chord chips of each company have their own characteristics. Among them, Zhiduowei's C520 can support the playback of national musical instruments, so C520 is used for chord music control.
2 C520 chord chipC520 is a polyphonic chip of Shanghai Zhiduo Microelectronics Co., Ltd. It is specially used to provide crisp and lifelike music ringtones and rich game sound effects for mobile phones. The chip integrates 64 chords, 16-tone color wavetable and 21 Chinese folk music, MIDI synthesizer with 3D stereo surround effect, MIDI GM preset ROM, 16-bit high-performance audio digital-to-analog converter and 2/4-bit ADPCM decoding Device and other functions.
2.1 Chip characteristics
Compared with other cell phone chord chips on the market, C520 has the following characteristics:
â‘ It can synthesize the input MIDI signal through the on-chip music synthesizer, or demodulate the input ADPCM signal through the ADPCM demodulator, and then output the waveform through the built-in DAC.
â‘¡ Integrate a high-quality MIDI GM sound library with a capacity of up to 3 Mb; provide ethnic musical instrument sound libraries other than the GM sound library, support more than 20 ethnic musical instruments such as erhu, guzheng, pipa, etc.; support multi-timbre and polyphony-at most simultaneously Supports 16 tones and 64 polyphony.
â‘¢ With multiple functional ports, it can support mobile phone vibration drive and LCD backlight drive, and can be used to play music synchronized PWM to control colorful lights.
④ The interface with the main control terminal can be a parallel interface or a serial interface; allow the chip to work in DAC input mode and accept input data compatible with the universal serial DAC data format; on-chip integrated FIFO for different input data; typical operating current in standby mode Less than 50 μA.
2.2 Functional unit
The whole chip is composed of IOU (I/O interface unit), SG (music synthesizer), ADEC (ADPCM demodulator), TG (clock module) and ANALOG (logic) modules.
The IOU completes the interface with the external CPU, controls the internal FIFO and other functional interfaces of the chip; the MIDI data that forms the music and the control commands of the external CPU to the chip are also sent through the registers in the IOU. The SG module takes the MIDI data from the FIFO of the IOU and synthesizes the music by means of wavetable synthesis. ADEC receives the compressed PCM data, decodes it according to the corresponding control signal, and outputs the decoded 16-bit PCM code to the DSP unit of the SG. TG multiplies the input clock frequency and generates an internal clock. ANALOG includes a DAC and the internal structure of the AMP.C520 chip that performs low-pass filtering and power amplification on the output signal of the DAC.
3 Application3.1 Typical circuit
The control CPU selects Samsung’s 32-bit RISC chip S3C4510B. This chip is specially developed for embedded Ethernet applications. The core is arm7TDMI. It supports the THUMB instruction set with high code density and is suitable for applications that are sensitive to price and power consumption.
Figure 1C520 internal structure block diagram
Figure 2 Typical Application Circuit
C520 and S3C4510B can be parallel interface or serial interface, but the data transmission speed of parallel interface is faster than serial interface, so use parallel interface in this design. The chip application circuit is shown in Figure 2.
In this circuit, CS_N of C520 is controlled by I/O P0 of S3C4510B. In fact, if the chip select signal line is enough, you can choose any one of the ROM/SRAM/Flash chip select signal Nrcs [5:0] in the S3C4510B, which can save 1 GPIO; in the same way, if If you don’t want to control the C520 reset anymore, you can connect its reset signal to the reset line nRESET of S3C4510B, so that S3C4510B and C520 will reset at the same time when power is on; C520 PD pin is the low power state control pin, "1" is the normal working state , "0" means entering a low power consumption state; C520 IRQ pin is an interrupt output pin, which can be connected to the external interrupt request signal pin XINTREQ [0] of S3C4510B.
3.2 Chip initialization
The initialization of C520 is very simple, including:
①Set the PLL frequency division ratio according to the external clock. The PLL frequency division ratio is determined by the register CLOCK (read:10h/write:11h) and the register Master Clock (read:18h/write:19h). The internal clock frequency fsys=fclock·(DN+1)/(DM+1). Among them, DM is the register CLOCK [4:0], DN is the register Master clock tuning [5:0], fclock is the external input clock, and the internal system clock frequency fsys must be set between 48 MHz and 50 MHz.
â‘¡ Turn on the analog module and write 0 to bit3 of the register Analog Power Down (read:66h/write:67h).
â‘¢ Set the Analog Select, and select the analog function according to the register Analog Select (read:60h/write:61h).
3.3 Play MIDI music files
C520 can play MIDI files in MIDI FORMAT 0 and MMD formats.
The ASCII value of the 4 bytes of data at the beginning of the MIDI FORMAT 0 file is "MThd", and the ASCII value of the 4 bytes of data at the beginning of the MMD file is "MMhd". The process of sending MIDI data in these two formats is different. Before sending, it is based on the 4 words at the beginning of the file. Section data to distinguish.
To send a MIDI file in MIDI FORMAT 0 format, all data in the file must be sent.
A file in MMD format can be divided into four blocks, and each block has an 8-byte header data part at the beginning. The ASCII code value of the first 4 bytes of the header data part of the first block is "MMhd", the ASCII code value of the first 4 bytes of the header data part of the second block is "MMly", and the ASCII code value of the first 4 bytes of the header data part of the third block is "MMdd". The ASCII code value of the first 4 bytes of the header data part of the 4th block is "MMex". The 5th, 6th, 7th, and 8th bytes of each piece of header data are the length of this piece of data (not including the header data), the 5th byte is the low byte, and the 8th byte is the high byte. These 4 The hexadecimal data composed of bytes plus the header data length of 8, is the length of this piece of data. The header data of the MMdd block data is followed by the compressed MIDI data; the MMly block data is the special data used for karaoke, and there is no need to send the block when playing MIDI; the Mmex is an extended block.
Figure 3 Play MIDI file process
When sending MIDI data in MMD format to C520, send the MMhd block first, and then send the MIDI data part of the MMdd block (that is, the part except the block name and block length in the block), and the MMly block does not need to be sent.
Figure 3 shows the process of playing MIDI files.
ConclusionThis article introduces the mobile phone chord chip C520 of Zhiduowei, and gives its principle and internal structure diagram. Using Samsung's RISC chip S3C4510B as the controller, the playback of chord music is realized. The detailed circuit schematic and the process of playing MIDI music files are given in the article, which can be used as a reference for the application of chord chips in mobile products.
China leading manufacturers and suppliers of Level 2 Charger,Ev Charging Stations, and we are specialize in Charging Station,Flexible Group Charging Station, etc.
Level 2 Charger,Ev Charging Stations,Charging Station,Flexible Group Charging Station
Shenzhen Hongjiali New Energy Co., Ltd. , https://www.hjlcharger.com