AN3959 Application note 2.0-channel demonstration board based on the STA381BW and STA381BWS Introduction The purpose of this application note is to describe: ■ how to connect the STA381BW/STA381BWS 2.0-channel demonstration board ■ how to evaluate the performance of the demonstration board with significant electrical curves ■...
Functional description of the demonstration board AN3959 Functional description of the demonstration board The following terms used in this application note are defined as follows: ● THD+N vs. Freq: Total harmonic distortion (THD) plus noise versus frequency curve ● THD+N vs. Pout: Total harmonic distortion (THD) plus noise versus output power ●...
Page 9
AN3959 Functional description of the demonstration board Table 1. Bill of material Type Footprint Description Reference Manufacturer Jack Speaker jack MP4-16 Songchen Headphone SONGCHEN CKX-3.5-06 Phone jack J2, J13, J19 Songchen jack 3-pin Deviator Switch Deviator switch SW2, SW3 Any source...
Page 10
Functional description of the demonstration board AN3959 Table 1. Bill of material (continued) Type Footprint Description Reference Manufacturer R1206 R10, R11, R30, R41 Murata R1206 20 +/-5% 1/8W R42, R43 Murata R0603 0 ohm 1/16W R1, R3, R36 Murata R0603...
AN3959 Functional description of the demonstration board Figure 8. Block diagram of test connections with equipment Audio Precision Equipment Monitor Output S/PDIF to AP Signal Digital Oscilloscope TDS3034B Tektronix APWLink Board S Input STA380BWS (DC3V3) 2.0CH Demo Board (DC7V) PC with GUI to control the...
AN3959 STA381BWS power section test results Figure 15. THD vs. output power, V = 18 V, R = 8 ohm, f = 1 kHz 0.05 0.02 0.01 100m 200m 500m Test Conditions : VCC=18V, Rl=8ohm, Dual BTL, Volume: +3dB Figure 16. THD vs. output power at different power supplies, R...
AN3959 STA381BW power section test results Figure 23. THD vs. output power, V = 24 V, R = 8 ohm, f = 1 kHz 0.05 0.02 0.01 100m 200m 500m Test Conditions : VCC=24V, Rl=8ohm, Dual BTL, Volume: +3dB Figure 24. THD vs. output power at different power supplies, R...
Analog section test results AN3959 Analog section test results The line/headphone out can be fed either with an external analog source, or with the F3X output, allowing the audio content to come from the digital interface on both the power output and on the line/headphone out.
Page 25
AN3959 Analog section test results Table 4. Line out section test results Filter: 22K LPF Ext Res: 18K + 43K Line out Unit Spec. Test results Reference 200 mV +/-20% Maximum output level Left mVrms 2.0 V↓ 1.86 1.87 Right Frequency response -1 dB↑,+0.5dB↓...
AN3959 Thermal performance Thermal results - test 2 Figure 26. Temperature test 2 Testing conditions: ● = 24 V ● 1 kHz sine wave ● 8 ohm Output power: 2 x 15 W Table 6. Thermal results - test 2 Result Tamb = 25 °C...
Design guidelines for schematic and PCB layout AN3959 Design guidelines for schematic and PCB layout Schematic 6.1.1 Criteria for selection of components ● Absolute maximum rating: STA381BWS V = 27 V ● Bypass capacitor 100 nF in parallel to 1 µF for each power V branch.
AN3959 Design guidelines for schematic and PCB layout 6.1.4 Snubber filter The snubber circuit must be optimized for the specific application. Starting values are 330 pF in series to 22 ohm. The power on this network is dependent on the power supply,...
Design guidelines for schematic and PCB layout AN3959 6.1.5 Main filter The main filter is an L and C based Butterworth filter. The cutoff frequency must be chosen between the upper limit of the audio band (≈20 kHz) and the carrier frequency (384 kHz).
AN3959 Design guidelines for schematic and PCB layout 6.1.7 Recommended power-up and power-down sequence There is no constraint regarding power supply voltages while it is required to release the reset line (RST) only after the master clock (MCLK) is stable, after the power-down (PWDN) is already set high and before any I C commands.
Design guidelines for schematic and PCB layout AN3959 Figure 34. Electrolytic capacitor used first to separate the V branches Figure 35. Path between V and ground pin minimized in order to avoid inductive paths 32/65 Doc ID 022081 Rev 3...
AN3959 Design guidelines for schematic and PCB layout Thermal dissipation It is mandatory to have a large ground plane on the top layer, inner layer2, inner layer3, and bottom layer and solder the slug on the PCB. Figure 36. Large ground plane on the top side Figure 37.
AN3959 Design guidelines for schematic and PCB layout Figure 39. Large ground plane on bottom side Figure 40. Symmetrical paths created for output stage, for differential applications Doc ID 022081 Rev 3 35/65...
Design guidelines for schematic and PCB layout AN3959 Figure 41. Coils separated in order to avoid crosstalk Figure 42. V filter for high frequency Placing the V filter capacitors close to the pins avoids an inductive coil generated by the copper wire, because the system is working in PWM with fast switching (the frequency is 384 kHz with fs = 48 kHz) so the longer copper wire easily becomes an inductor.
AN3959 Design guidelines for schematic and PCB layout Figure 43. Thermal layout with large ground The thermal resistance junction in the bottom of the STA381BWS to ambient, obtainable with a ground copper area of 5.6 x 5.6 mm and with 16 via holes is shown in...
Software setup to use the STA381BW/STA381BWS devices (ST Map) AN3959 Software setup to use the STA381BW/STA381BWS devices (ST Map) Processing configuration Figure 44. Processing path Pro c es s ing F requency = 2x F s X2O v er- Biq uad #5...
Software setup to use the STA381BW/STA381BWS devices (ST Map) AN3959 Figure 48. STCompressor - compression ratio ● The compression ratio is user-programmable ● By default the rate is 1:1 (no variable ratio) ● There are 16 different settings (from 0 to 15) and the ratio varies from 1:1 to 1:16 Figure 49.
AN3959 Software setup to use the STA381BW/STA381BWS devices (ST Map) Figure 50. STCompressor - offset control ● The offset is a user-programmable gain or volume control ● When the STC is used, it is better to use offset instead of volume for location in the processing path There are 192 different settings (from 0 to +48) with 0.25 dB/step...
Software setup to use the STA381BW/STA381BWS devices (ST Map) AN3959 7.2.3 Example settings of the STCompressor Band splitter: ● Biquad 0, biquad 1 of band 0: low-pass filter with Fc = 200 Hz Write in RAM the following values. BQ0 band 0: 0x40→0x000059...
Page 43
AN3959 Software setup to use the STA381BW/STA381BWS devices (ST Map) Compression ratio - 1:2 = 4 ● Coefficient value = HEX [(4/2 ) * 2 ] = HEX (524288) = 0x080000 ● Write in RAM: – 0x57→0x080000 – 0x61→0x080000 Attack rate: +4 dB/msec ●...
Software setup to use the STA381BW/STA381BWS devices (ST Map) AN3959 7.2.4 Test results with APWorkbench The following figure shows the APWorkbench results for the example settings given in Section 7.2.3. Figure 51. APWorkbench results for STC example 44/65 Doc ID 022081 Rev 3...
AN3959 Software setup to use the STA381BW/STA381BWS devices (ST Map) CRC computation In the STA381BW/STA381BWS there are three different CRCs: ● Biquad ● Crossover ● STCompressor 7.3.1 Biquad CRC computation ● Download into RAM the biquad filter coefficients (address 0x00-0x27) ●...
Software setup to use the STA381BW/STA381BWS devices (ST Map) AN3959 7.3.3 STCompressor CRC computation ● Download into RAM the STC band splitter filter coefficients into the RAM (address 0x40-0x53) ● The XOR function calculates bit-to-bit the downloaded coefficients ● Write into RAM the expected value (address 0x72 – CRC expected) ●...
AN3959 Software setup to use the STA381BW/STA381BWS devices (ST Map) Startup ST map selection ● Select register map (ST Map) – 0x7E (MISC4) bit D7 (SMAP) set to 0 (default is 1) Clock and SAI configuration ● Set clock selection (register 0x00) –...
Software setup to use the STA381BW/STA381BWS devices (ST Map) AN3959 Figure 52. F3X output Note: If the digital input is 0 dBFs, the F3X output is 1.8 Vpp (that means 0.64 Vrms). F3X for HPout ● Write in register 0x58 (F3XCFG1) the value 0x80 (default value 0x00) which enables the F3XLNK function.
AN3959 Software setup to use the STA381BW/STA381BWS devices (ST Map) Short-circuit protection for the STA381BW/STA381BWS The device is protected to short circuit at power-on: ● Enable the short-circuit check enable bit (SHEN, bit D0 register 0x4C) ● When the device switches from EAPD = 0 to EAPD = 1 (bit D7 register 0x05), the protection checks the short-circuit ●...
AN3959 Examples of code (TV SoC) FFX381X_Sample.C #include "FFX38X_Sample.h" /* This is the reference source code of STA381BWX series FFX amplifier function reference: I2Cm_Tx(&valueReg,RegAddress,1,DeviceAddress);//write the data to I2C register,DeviceAddress=FFX_I2C_ADDR I2Cm_Rx(&valueReg,RegAddress,1,DeviceAddress);//Read the data from I2C register,DeviceAddress=FFX_I2C_ADDR unsigned char oldMasterVolume; unsigned char oldLeftVolume;...
Page 54
Examples of code (TV SoC) AN3959 I2C_buf1=FilterIndex*5; I2Cm_Tx(&I2C_buf1,0x16,1,FFX_I2C_ADDR); //Write the command to 0x26(3 times) I2C_buf1=0x08; I2Cm_Tx(&I2C_buf1,0x26,1,FFX_I2C_ADDR); I2Cm_Tx(&I2C_buf1,0x26,1,FFX_I2C_ADDR); I2Cm_Tx(&I2C_buf1,0x26,1,FFX_I2C_ADDR); Wait(10);//10-20ms delay //read bank data from 0x17~0x25 for(STA381BWX_tempj=0;STA381BWX_tempj<15;STA381BWX_tempj++){ I2Cm_Rx(&I2C_buf1,(0x17+STA381BWX_tempj),1,FFX_I2C_ADDR); STA381BWX_EQ[STA381BWX_tempj]=I2C_buf1; Intial the EQ curve for coefficient data Write write Filter data from STA381_EQ[],Filter address FilterIndex=0~4 void STA381BWX_CoefficientWrite(unsigned char FilterIndex) unsigned char STA381BWX_tempj;...
Page 55
AN3959 Examples of code (TV SoC) //Write the command to 0x26(3 times) I2C_buf1=0x02; I2Cm_Tx(&I2C_buf1,0x26,1,FFX_I2C_ADDR); initial the system output configuration as below FFX_Configuration=0; 2.0 2*BTL setting with HP FFX_Configuration=1; 2.1 2*SE+1*BTL setting FFX_Configuration=2; 2.1 2*BTL+1*PWMoutput(driver Power stage) setting FFX_Configuration=3; .1 mono BTL setting...
Page 56
Examples of code (TV SoC) AN3959 void STA381BWX_Powerdownonoff(unsigned char FFX_Powerflag){ I2Cm_Rx(&I2C_buf1,FFX_CONFIGURE_F,1,FFX_I2C_ADDR); I2C_buf1&=0xBF; I2C_buf1+=((FFX_Powerflag)<<6); I2Cm_Tx(&I2C_buf1,FFX_CONFIGURE_F,1,FFX_I2C_ADDR); Set Crossover FFX_CrossOver value have define as constant value void STA381BWX_CrossOver(unsigned char FFX_CrossOverValue){ I2Cm_Rx(&I2C_buf1,FFX_AUTO2,1,FFX_I2C_ADDR); I2C_buf1&=0x0F; I2C_buf1+=(FFX_CrossOverValue<<4); I2Cm_Tx(&I2C_buf1,FFX_AUTO2,1,FFX_I2C_ADDR); /* the volume system consist of main volume and channel volume, the main volume is responsible for the overall system control, it's range from -127.5dB to 0dB, every step as 0.5dB,...
Page 57
AN3959 Examples of code (TV SoC) I2Cm_Rx(&I2C_buf1,FFX_MAIN_VOLUME,1,FFX_I2C_ADDR); MUTEVolSave = I2C_buf1; // Save the current Gain I2C_buf1=0xFE; I2Cm_Tx(&I2C_buf1,FFX_MAIN_VOLUME,1,FFX_I2C_ADDR); Wait(10);//10-20ms delay else I2Cm_Tx(&MUTEVolSave,FFX_MAIN_VOLUME,1,FFX_I2C_ADDR); Wait(10);//10-20ms delay return; /*the channel volume is responsible for the each channel volume control, it's range from -79.5dB to 48dB, every step as 0.5dB, channelvolume=255-((dbrequest+79.5)*2);...
Page 58
Examples of code (TV SoC) AN3959 return; Set the FFX DSP bypass or not DSPBypassFlag=0;DSP not bypass DSPBypassFlag=1;DSP bypass void STA381BWX_DSPBypass(unsigned char DSPBypassFlag) I2Cm_Rx(&I2C_buf1,FFX_CONFIGURE_D,1,FFX_I2C_ADDR); I2C_buf1&=0xFB; I2C_buf1+=(DSPBypassFlag<<2); I2Cm_Tx(&I2C_buf1,FFX_CONFIGURE_D,1,FFX_I2C_ADDR); Set the FFX DeEmphasis or not DeEmphasisFlag=0; DeEmphasis disable DeEmphasisFlag=1; DeEmphasis enable void STA381BWX_DeEmphasis(unsigned char DeEmphasisFlag) I2Cm_Rx(&I2C_buf1,FFX_CONFIGURE_D,1,FFX_I2C_ADDR);...
Page 59
AN3959 Examples of code (TV SoC) I2C_buf1+=(FilterlinkFlag<<4); I2Cm_Tx(&I2C_buf1,FFX_CONFIGURE_D,1,FFX_I2C_ADDR); Set the FFX PostScale Link or not PostscalelinkFlag=0;each channel use the own filter PostscalelinkFlag=1;each channel's filter setting same as channel1's void STA381BWX_PostscaleLink(unsigned char PostscalelinkFlag) I2Cm_Rx(&I2C_buf1,FFX_CONFIGURE_D,1,FFX_I2C_ADDR); I2C_buf1&=0xF7; I2C_buf1+=(PostscalelinkFlag<<3); I2Cm_Tx(&I2C_buf1,FFX_CONFIGURE_D,1,FFX_I2C_ADDR); void STA381BWX_Bass(unsigned char basssetting) basssetting=basssetting+1;...
Page 60
Examples of code (TV SoC) AN3959 I2C_buf1+=(treblesetting<<4); I2Cm_Tx(&I2C_buf1,FFX_TONEBASS,1,FFX_I2C_ADDR); /* Write coefficient into the FFX controller using the IIC driver */ void STA381BWX_init(void) unsigned char I2C_buf1; I2C_buf1=STA381BWX_STMAP; I2Cm_Tx(&I2C_buf1,STA381BWX_MAPSEL,1,FFX_I2C_ADDR); /* the master clock select, 256fs, fault detect enable */ I2C_buf1=0x63; I2Cm_Tx(&I2C_buf1,FFX_CONFIGURE_A,1,FFX_I2C_ADDR); /* the serial input format select, I2s format, MSB first*/ I2C_buf1=0x80;...
Page 61
AN3959 Examples of code (TV SoC) /* Switching frequency determined by AMAM setting and set the crossover as 260Hz*/ // STA381BWX_CrossOver(STA381BWX_Cross_260Hz); /* flat mode EQ*/ // I2C_buf1=0x00; // I2C_sendbuf(1,&I2C_buf1,FFX_I2C_WRITE_ADD,FFX_AUTO3); /* channel1 no limit, tone and treble control enable*/ // I2C_buf1=0x00;...
Revision history AN3959 Revision history Table 8. Document revision history Date Revision Changes 02-Sep-2011 Initial release. Updated Figure 2: Schematic-1 on page 7 11-Nov-2011 Added Appendix A: Mono BTL schematic on page 63 05-Dec-2011 Updated Section 8.1: FFX381X_Sample.h Section 8.2: FFX381X_Sample.C...
Page 65
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein.
Need help?
Do you have a question about the AN3959 and is the answer not in the manual?
Questions and answers