A kind of function test method of I2S interface
[technical field]
The present invention relates to a kind of SOC functional test field, whether qualified the pin that relates in particular to function test method and the corresponding interface of a kind of I2S controller bind technology method of testing.
[background technology]
IIS (InterIC Sound Bus representes with I2S usually, hereinafter claims I2S) is that PHILIPS Co. is a kind of bus interface that the audio data transmission between the digital audio-frequency apparatus is formulated.In the I2S of PHILIPS Co. standard, also stipulated the form of digital audio-frequency data.I2S has following 3 main signals:
1. serial clock SCLK signal: also be bit clock (BCLK), i.e. each data of corresponding DAB, SCLK has 1 pulse.The frequency of SCLK=2 * sample frequency * sampling resolution;
2. frame clock LRCK signal: (also claiming WS), be used for the data of switching right and left sound channel, what LRCK was transmitting for " 1 " expression is the data of L channel, and what then represent to transmit for " 0 " is the data of R channel, and the frequency of LRCK promptly is a sample frequency;
3. major clock MCLK signal: can to need transmission between system better synchronously in order making, also to be system clock (System Clock), the frequency of MCLK is 256 times or 384 times of sample frequency.
In addition, the I2S interface is used for common two pins of digital data transmission, and one as data inputs (SDI), and one as data outputs (SDO), supports serial data transmission.
Just present SOC (system level chip) functional test field is to the test of I2S interface; Major part still rests on the test of simple pin package situation and technology thereof; The SOC than complicated comprising the I2S interface in enormous quantities is comprehensive inadequately, also can't remedy the possibility of CP (chip prober refers at encapsulation money wafer tested) test institute leftover problem simultaneously.
[summary of the invention]
The technical matters that the present invention will solve is to provide a kind of function test method of I2S interface, carries out functional test and checking through the application that Simulation with I 2S interface is actual, makes test specification more comprehensive.
The present invention is achieved in that a kind of function test method of I2S interface, it is characterized in that: comprise the steps:
Step 10, with corresponding connection of three pins of I2S_MCLK, I2S_SCLK, I2S_LRCK of the I2S interface of SOC to be measured and outside CODEC equipment; With corresponding connection of pin that is used on the SOC to be measured on the I2C interface of I2C interface and said outside CODEC equipment of auxiliary I2S interface testing, at last I2S_SDO on the I2S interface and the direct short circuit of I2S_SDI pin are got up then;
The I2S interface of step 20, SOC to be measured is set to the slave pattern, and the I2C interface through said outside CODEC equipment is set to the master pattern to outside CODEC equipment, and corresponding work frequency and sampling rate are set;
Step 30, the initialization of being correlated with: the I2C interface that is used for auxiliary I2S interface testing on the SOC said to be measured in the given step 10 after connect corresponding with the I2C interface of said outside CODEC equipment uses interface as test; The initialization of outside CODEC device power, it is MIC pattern or LINE pattern that mode of operation is set, and suitable sample frequency is set;
Step 40, setup test data, but need adopt the data combination of full test;
The I2S interface of step 50, startup SOC to be measured sends data;
The I2S interface of step 60, SOC to be measured receives data: the data of corresponding reception buffer are read in the corresponding memory, the contrast that the data of data that receive and transmission are carried out, obtained final test result.
Wherein, when starting the I2S interface transmission data of SOC to be measured in the said step 50, be that employing direct memory method for carrying or the method for directly writing register are sent.In the said step 20, the sample frequency of outside CODEC equipment is set to 44.1MHZ.In the said step 40, but the data combination of full test is: 0x00,0xFF, 0x55,0X66,0x99,0x5a, 0xa5.
The present invention has following advantage:
1, the present invention tests simply, and the function of the actual I2S interface of direct modeling is used, as long as the people that I2S is had gained some understanding can accept easily;
2, the accuracy of test result of the present invention is high, and the data of sending in the test process all are numerical datas with the data that receive, and do not have error; And conventional test methods to be all signal pins with the I2S interface of I2S interface to be measured and CODEC link to each other with impression data is corresponding; Convert its data-signal to audio analog signals through the CODEC coding; Then the simulating signal of output is being analyzed, and to the analysis of simulating signal and judgement than being easier to occur error;
But 3, the test data of employing full test of the present invention can more help full test;
4, the present invention can be applicable to the checking of I2S interface function, also can be applicable to simultaneously in the FT test in enormous quantities of SOC, because the test employing is the method for Simulation with I 2S interface actual functional capability, the requirement of Ce Shi time and hardware environment simultaneously also realizes than being easier to;
5, testing cost is low; Conventional test methods generally can be to corresponding signal; Adopt comparatively complicated instrument to analyze; Ce Shi cost has just increased undoubtedly like this; And test needs more time simultaneously; The invisible cost that also increases test, and the method for using among the present invention can draw test result through the data that receive are judged accurately on a common hardware plank.
[description of drawings]
The present invention is further illustrated to combine embodiment with reference to the accompanying drawings.
Fig. 1 is the I2S interface of SOC to be measured in the inventive method and the IC equipment connection status synoptic diagram of outside CODEC.
[embodiment]
As shown in Figure 1, method of testing of the present invention is that outside CODEC (compressing and decompressing audio file device) equipment 20 through subtest assist completion with the I2C interface.Said I2C interface comprises two parts, and a part is for having the I2C interface that is used for auxiliary I2S interface testing on the SOC to be measured, and another part is the I2C interface on the outside CODEC equipment 20, wherein:
The I2S interface 10 of said SOC to be measured: comprise the pin that I2S_MCLK, I2S_SCLK, I2S_LRCK, I2S_SDO, I2S_SDO are correlated with; Wherein require I2S_SDO directly to link to each other in this test with I2S_SDI;
Said outside CODEC equipment 20: comprise the pin that I2S_MCLK, I2S_SCLK, I2S_LRCK, I2S_SDO, I2S_SDO are correlated with, I2S_SDO and I2S_SDI do not use in this method of testing, can unsettled or directly be changed to high level or low level;
Have the I2C interface 30 that is used for auxiliary I2S interface testing on the said SOC to be measured: major function is to be used to be provided with the pattern of CODEC and relevant control register;
The I2C interface 40 of said outside CODEC equipment: mainly be to be used to receive the CODEC that the I2C of SOC to be measured transmits information is set.
Method of testing of the present invention comprises the steps:
Step 10, with corresponding connection of three pins of I2S_MCLK, I2S_SCLK, I2S_LRCK of the IC equipment 20 of the I2S interface 10 of SOC to be measured and outside CODEC; Then the pin correspondence that is used on the SOC to be measured on the I2C interface 40 of I2C interface 30 and said outside CODEC equipment of auxiliary I2S interface testing is connected, at last I2S_SDO on the I2S interface 10 of SOC to be measured and the direct short circuit of I2S_SDI pin is got up.Its state as shown in Figure 1.
Step 20, the I2S interface 10 of SOC to be measured is set to the slave pattern, the 40 pairs of outside CODEC equipment 20 of I2C interface through said outside CODEC equipment are set to the master pattern, and corresponding work frequency and sampling rate are set.Sampling rate generally is made as 44.1KHZ, but also can select other frequency, does not influence final test result, so long as frequency that normal CODEC can support all can, like 32KHZ, 48KHZ etc.; Frequency of operation also is work clock, major clock or system clock, and normally 256 of sampling rate times or 384 times, select 256 times (44.1KHZ*256 just) among the present invention, can certainly select 384 times, do not need necessarily to be made as 256 times.
Step 30, the initialization of being correlated with: the pin multiplexing of I2C interface 40 that is used for I2C interface 30 and the outside CODEC equipment of auxiliary I2S interface testing on the SOC to be measured is selected; IC equipment 20 power-up initializings of outside CODEC, it is microphone modes or LINE pattern that mode of operation is set, and suitable sample frequency is set, and selects 44.1MHZ usually.
Step 40, setup test data, but the data combination of full test need to be adopted, as can adopting 0x00,0xFF, 0x55,0X66,0x99,0x5a, 0xa5 etc., the data that it is concrete selects to send are considered with the actual conditions of the SOC that surveyed.
The I2S interface 10 of step 50, startup SOC to be measured sends data, is that employing direct memory method for carrying or the method for directly writing register are sent, and it is fixed that the sending method of employing can be come according to actual SOC situation.
The I2S interface 10 of step 60, SOC to be measured receives data: because each the I2S interface on the SOC to be measured all has a corresponding reception buffer and storer; When receiving data the data of corresponding reception buffer are read in the corresponding memory; The contrast that the data of data that receive and transmission are carried out, obtain final test result.
The principle of the inventive method is: this method must be the I2S_SDO of the I2S interface 10 of SOC to be measured and the direct short circuit of I2S_SDI on hardware; The I2S interface 10 of SOC to be measured must be set to the slave pattern, and said outside CODEC equipment 20 is set to the master pattern.Use with actual is the same, the setting of outside CODEC equipment 20 being correlated with earlier through the I2C interface, as be operated in master pattern, frequency of operation, sampling rate or the like.The I2S interface 10 that starts SOC to be measured then sends data; Because I2S_SDO directly links to each other with I2S_SDI; If outside CODEC equipment 20 is in proper working order; All relevant clock signals all are normal;, the I2S interface 10 that starts SOC to be measured has no progeny in receiving so; The identical data that just can receive and originally send out; Correctness by the data that relatively receive; Whether the I2S interface 10 that just can judge SOC to be measured is in proper working order; When obtaining this conclusion; Yes will guarantee outside CODEC equipment 20 energy operate as normal earlier, can produce relevant work clock etc.
Why to use outside CODEC equipment 20; Be because will have slave and two equipment of master to communicate during I2S interface 10 operate as normal of SOC to be measured; And adopt outside CODEC equipment 20 mainly is to be used for the test of I2S interface 10 of auxiliary SOC to be measured; The data consistent that provides work clock signal etc. just can make output in the test process and receive guarantees the correctness of test.The 2nd, for the I2S_MCLK of the I2S interface 10 of verifying SOC to be measured; I2S_BCLK, whether the I2S_LRCK pin can normally be exported, if any one of these signals goes wrong; After all will causing the I2S interface 10 of SOC to be measured to send data, can't receive data.
In addition; Need to prove; Later stage software debugging demand for ease; In the connection procedure of step 10; The resistance that between the line that links to each other in twos, connects one 0 ohm simultaneously (mainly is because in the software debugging process; Need verify the instruments such as waveform employing oscillograph of each clock signal and data-signal unavoidably; So connecing the resistance in 0 Europe is better to operate for instruments such as CRO couplings); Can use oscillograph eaily in the time of software debugging; Instruments such as multimeter judge whether relevant signal output, can judge also simultaneously whether output is normal.
Though more than described the specific embodiment of the present invention; But the technician who is familiar with the present technique field is to be understood that; We described concrete embodiment is illustrative; Rather than be used for qualification to scope of the present invention; Those of ordinary skill in the art are in the modification and the variation of the equivalence of doing according to spirit of the present invention, all should be encompassed in the scope that claim of the present invention protects.