Implementation of Audio File Playback Based on Embedded Microprocessor S3C44B0X

S3C44B0X is a high-performance microprocessor introduced by Samsung for embedded systems. It is a 16/32-bit RISC processor based on ARM7TDMI core and operates at 66MHz. To reduce cost and save product development cycle, S3C44BO0X provides rich built-in. Components, including: internal SRAM, LCD controller, 8-channel 10-bit ADC, IIC bus interface, IIS bus interface, etc. The S3C44B0X IIS interface can be used to connect an external 8/16-bit stereo sound decoder. CS4334 is launched by CIRRUS The series of audio decoding chips. The working principle and application of the series [1, 2, 3] are discussed in detail.

This article refers to the address: http://

This paper studies the connection between S3C44B0X IIS bus interface and CS4334 in detail, and builds an embedded working platform based on the two. On this platform, the WAVE audio file is played and the test program is given.

1IIS bus structure

S3C44B0X IIS (Inter-IC Sound) interface provides DMA transfer mode instead of interrupt mode for FIFO access. It can send data and receive data at the same time. It can also send or receive only.

As shown in Figure 1, the bus interface FIFO control includes the bus interface, internal registers and state machines, control bus interface logic and FIFO access; the 3-bit dual divider includes one as the IIS bus master clock generator and the other as the external The encoder's clock generator; the master serial bit clock generator (master mode), which divides the serial bit clock from the master clock; the channel generator and the state generator generate and control IISCLK and IISLRCK, And control data reception and transmission; 16-bit shift register when the data is transmitted, the data is converted into a string, the opposite action is taken when receiving data.

The IIS bus can use the normal transfer mode, DMA transfer mode and send and receive simultaneous mode.

2 audio digital to analog conversion chip CS4334

CS4334 is an audio digital-to-analog conversion chip produced by CIRRUS Semiconductor. It has the characteristics of simple interface, stable performance and easy operation. It has a wide range of applications in embedded systems. In addition, since WAVE digital audio is converted into analog audio by CS4334, the signal is compared. Weak, need to add an audio power amplifier. This article uses PHILIPS company's TDA7050 low-level mono/stereo power amplifier.

IIS bus structure block diagram

Figure 1 IIS bus structure block diagram

Figure 2 is a schematic diagram of the connection between S3C44B0X and CS4334 and TDA7050

Figure 2 is a schematic diagram of the connection between S3C44B0X and CS4334 and TDA7050

Connection of 3S3C44B0X and CS4334 and TDA7050

S3C44B0X IIS bus interface and CS4334 module have strong versatility, the connection is easy to implement. The connection method is: S3C44B0X port PF6 (IISDO), PF8 (IISCLK), PF5 (IISLRCK), PE8 (END/AN) respectively Connect to pins 1, 2, 3, and 4 of CS4334. When CS4334 is connected to TDA7050, simply connect the output of CS4334 to the corresponding input pin of TDA7050. The specific connection method is shown in Figure 2.

4 programming

The programming assumes that the S3C44B0X has been successfully started. Here we focus on the main function of playing the WAVE file:

Playwave().IIS_Init() is the initialization IIS interface function, BDMA0_Done() is the BDMA0 interrupt handler. They are described below.

4.1 IIS interface initialization

code show as below:

Void IIS_Init(void){

rPCONF = 0x24900a; //Set the I/O port PF so that port PF5~8 works in IIS state

Init_4334(); //Initialize CS4334 chip}

4.2 Play WAVE Audio File Function

Before the Playwave() function runs, you will be prompted to download the wave audio file to the specified RAM area first. The function calculates the file size and prompts it to play or not, and finally returns.

Void Playwave (U32 addr, U32 size){

Unsigned char *pWave;

U32 samplesize; //WAVE file length

U32 save_PLLCON;

save_PLLCON = rPLLCON;

rPLLCON= x69<<12)|(0x17<<4)|0;

SerialChgBaud (115200);

pISR_BDMA0=(unsigned)BDMA0_Done;

rINTMSK=~(BIT_GLOBAL|BIT_BDMA0);//Interrupt setting

pWave=(unsigned char *)addr;//wave file data address

pWave+=0x28; //point to wav sample length

Samplesize=*(pWave+0) | *(pWave+1)<<8 | *(pWave+2)<<16 | *(pWave+3)<<24;

pWave+=4; //point to wav data

Samplesize=(samplesize>>1)<<1;


Printf(nsample start:0x%x,pWave);

Printf(nsamplesize:0x%x,samplesize);

Init_4334();

/****** IIS initialization******/

rIISCON=0x22; //Enable DMA, receive idle, enable crossover

rIISMOD=0x89; //Main mode, IIS format, 16-bit data, 256fs, 32 fs

rIISPSR=0x33; //divide factor

rIISFCON=0xa00; / / receive, send DMA mode, enable FIFO

/****** BDMA0 Initialization******/

rBDISRC0=(1<<30)+(1<<28)+(U32)pWave; //DMA source; 16-bit data, growth mode

rBDIDES0=(1<<30)+(3<<28)+((U32)rIISFIF); //DMA purpose: M2IO, internal module

rBDICNT0=(1<<30)+(1<<26)+(3<<22)+(1<<21)+(0<<20)+samplesize;

rBDICNT0 |= (1<<20);//Set the DMA request source to IIS, interrupt mode, manual reload, enable DMA

rBDCON0 = 0x0<<2;

Printf(nNow play the wave file ...);

Printf(nPush any key to exit!!!);

rIISCON |=0x1;

While(!getkey()); //Press any key to return}

5 Summary

Using S3C44B0X built-in IIS bus and audio digital-to-analog conversion chip CS4334, this paper builds a working platform with both as the core, and discusses in detail how to play WAVE audio files based on this platform. Because S3C44B0X and CS4334 modules have strong universal Sex, so the implementation methods and procedures given in this paper are simple to use, stable in operation, easy to transplant and so on.

The author's innovation lies in the detailed design of the WAVE audio file playback platform based on the embedded microprocessor S3C44B0X and CS4334, which combines the advantages of small power consumption, portability, high code execution efficiency and good sound quality of WAVE audio files. The detailed connection method, the designed program has been successfully run on the hardware platform.

Asia Air Purifier

Kenzo Air Purifier,Air Freshener Aromatic,Water Air Purifier

Fenghua Jade Motor Co., Ltd. , http://www.homeappliancemfg.com

Posted on