background image

A N 7 2 6

16

Rev. 0.1

5.9.  Build Configurations

The Precision32 and uVision projects include two build configurations each: Release and Debug. These
configurations change the code optimization settings. In addition, each configuration sets a flag to allow the
firmware to automatically detect the current build configuration and IDE. This enables the firmware to modify the
play/record flash mode array size to appropriate settings based on the code size. The approximate sizes for each
build configuration are shown in Table 4.

To change the active build configuration in the Precision32 IDE, right-click on the project name in the Project view
and select 

Build Configurations

Set Active

Debug

 or 

Release

.

Figure 18. Setting the Active Precision32 IDE Build Configuration

Table 4. Build Code Size Comparisons

IDE

Build

Code Size (bytes)

Precision32

Debug

68200

Release

47200

uVision4

Debug

40200

Release

34700

Summary of Contents for AN726

Page 1: ...put signal before transferring to the output MOSFETs A digital Class D amplifier requires the following PWM output switching frequency 10x faster than the highest input frequency to adequately reconstruct the input signal High resolution control of the PWM pulse width to reduce output quantization distortion Method for sampling or receiving the input waveform Fast core for digital processing and m...

Page 2: ... can be powered from either the Debug J3 or Device J2 USB mini connectors as shown in Figure 2 The green POWER LED DS7 will light up when the board is powered Do not touch the Capacitive Sensing slider during power on as this is when the board calibrates the slider Once the board is ready for use the blue LED DS1 will turn on Figure 2 Powering the Board Change the volume of the output at any time ...

Page 3: ...e device can be selected using the Properties button in this tab Figure 3 Configuring the USB Utility Class D ToolStick as the Playback or Recording Device In the Recording tab of the dialog select the Utility Class D ToolStick microphone and press the Set Default button This will open an interface to the microphone and will display the recorded input volume to the right of the device name If this...

Page 4: ...pressed sound to the flash of the MCU Enter the mode by pressing the MODE button until blue LED DS4 turns on Press the REC slider button to start recording and press the REC slider button again to stop recording The blue LED DS5 will indicate when a record operation is in progress Multiple recordings will append to the full recording in flash Once the flash is full the MCU will indicate no additio...

Page 5: ...ect to PB0 6 S1 and PB0 7 S2 and are currently unused in the Class D firmware The switches are normally open and pull the pin voltage to ground when pressed Port pins PB0 1 PB0 2 PB0 4 PB0 5 PB0 10 and PB0 11 connect to six blue LEDs DS1 DS6 Pin PB3 3 connects to the red LED DS8 The green LED POWER DS7 turns on when USB power is applied to the board from either USB connector The LEDs connect to VI...

Page 6: ...k on page 18 4 3 ToolStick Debug Adapter U3 The Class D ToolStick board features a debug adapter via the mini B USB connector J3 labeled DEBUG This debug adapter can be used with the Precision32 1 0 2 and higher and ARM uVision IDEs 4 54 and higher When using an older version of the IDEs the debug adapter DLLs in the IDE directories must be replaced to support the ToolStick Debug Adapter Contact t...

Page 7: ... points above the slider facilitate adding grounded or shrouded connectors to measure the capacitive sensing pins 4 6 Analog Audio Inputs J1 and MK1 The stereo jack on the board J1 allows the board to measure stereo inputs from an input source The microphone MK1 enables the device to measure voice data directly These signals are conditioned by a bias and gain circuit provided by a quad op amp IC U...

Page 8: ...ated with the Class D ToolStick firm ware This project file includes manual changes to include the si32Library that will be removed when AppBuilder exports the code A saved version of the project file save project is available in the Class D ToolStick firmware package in case this project file is overwritten To restore the project file simply copy the contents of save project to the project file 5...

Page 9: ...ots of memory in a traditional average The weight can be dynamically adjusted easily in firmware depending on the circumstances without dramatically changing the computational time The EWMA is a form of IIR filter which means it can become unstable if the cumulative error becomes too large 5 2 2 Remainder Weighted Dithering The firmware quantizes the 12 bit ADC results or 16 bit signed USB data to...

Page 10: ...t signed number and adds 32 to the magnitude which ensures that a 1 occurs in bits 5 12 of the value This means the valid input range is 8160 to 8159 This value is then converted to an 8 bit compressed result as shown in Figure 7 where S is the sign bit Finally the 8 bit value is complemented Figure 7 µLaw Algorithm Table Figure 8 shows the plot of the 14 bit signed inputs versus the 8 bit compres...

Page 11: ...me generates the output waveform on the speaker as shown in Figure 9 Figure 9 Class D Output Example Note The output network configuration in Figure 9 is the configuration in Revision 1 0 of the hardware An alternate output net work discussed in 6 Tuning the Class D Output Network on page 18 may provide better performance than the original configuration 5 4 Volume Control The volume control on the...

Page 12: ...WMA algorithm quantizes the data to 9 bits and outputs the PWM waveform on the EPCA0 module Figure 11 shows the data flow for the stereo input jack mode The Class D ToolStick board automatically biases the input waveform to VREF 2 On hardware that does not do this an additional dc offset adjustment algorithm may be required Figure 11 Stereo Jack Input Mode Flow Diagram SiM3U1xx SARADC0 EPCA SARADC...

Page 13: ...veform on the EPCA0 module For recording from board to the PC the firmware measures the microphone MK1 using one SARADC module and sends the data to the PC using the si32Library USB Audio Component Figure 13 shows the data flow for the USB input output mode Figure 13 USB Input Output Mode Flow Diagram Class D RD Board SiM3U1xx SARADC0 EPCA USB R L MIC Host PC sound software SiM3U1xx hardware gain ...

Page 14: ...orithm quantizes the data to 9 bits and outputs the PWM waveform on the EPCA0 module The remainder weighted dithering algorithm is not used at all in this mode since the data LSBs will often be 0s from the compression algorithm Figure 15 shows the data flow for the play prerecorded flash mode Figure 15 Play Prerecorded Flash Mode Flow Diagram Class D RD Board SiM3U1xx Flash EPCA R L SiM3U1xx Flash...

Page 15: ... not used at all in this mode since the data LSBs will often be 0 s from the compression algorithm For recording the firmware measures the microphone MK1 using one SARADC module compresses the data using µLaw and stores the data in flash Figure 17 shows the data flow for the play record flash mode Figure 17 Play Record Flash Mode Flow Diagram Class D RD Board SiM3U1xx SARADC0 EPCA Flash R L MIC Si...

Page 16: ...are to modify the play record flash mode array size to appropriate settings based on the code size The approximate sizes for each build configuration are shown in Table 4 To change the active build configuration in the Precision32 IDE right click on the project name in the Project view and select Build Configurations Set Active Debug or Release Figure 18 Setting the Active Precision32 IDE Build Co...

Page 17: ...uration from the drop down menu shown in Figure 19 Figure 19 Setting the Active uVision4 IDE Build Configuration 5 10 si32 HAL Version The Class D ToolStick firmware was originally developed for v1 1 1 of the HAL or later Compiling against previous versions of the HAL will generate errors ...

Page 18: ...nction with the speaker reactance In almost all applications the ferrite beads should be populated on the board However the other components may or may not be populated depending on the speaker used and the cost requirements of the application If either the L or the C are installed both should be populated to ensure lower power consumption In most cases the easiest method of determining whether to...

Page 19: ...figuration Figure 21 Alternate Class D Output Network Direct Drive For the alternate configuration the recommended components for the board are shown in Table 5 Table 5 Class D ToolStick Alternate Output Network Recommended Components Reference Value L 3 3 µH 1 5 A C 2 2 µF Cg 20 pF CB 0 47 µF PB4 0 R PB4 1 R Cg Cg FB L CB L FB C C placed as close to the device as possible placed as close to the s...

Page 20: ... uninstall the R32 R35 R38 and R41 0 resistors Figure 23 illustrates an alternate full bridge high power output network The diode and RC circuits on the MOSFET gates ensure that the two devices will not both be conducting simultaneously Figure 22 Half Bridge Class D Output Network External MOSFETs The Revision 1 0 hardware provides footprints to a 9 V dc adapter connector and high power LDO These ...

Page 21: ...gh power output network The diode and RC circuits on the MOSFET gates ensure that the two devices will not both be conducting simultaneously The value of these components should be tuned for the gate capacitance of the FETs Figure 23 Full Bridge Class D Output Network External MOSFETs Cg Cg FB L CB L FB C C placed as close to the drivers as possible placed as close to the speaker connectors as pos...

Page 22: ... 11 4 C1 10uF R14 5 11K R18 100K R8 4 99K J1 AUDIO JACK 1 3 2 C8 0 47uF R17 470K R10 470K U1C MC33204 10 9 8 R1 2K R11 10K C4 0 1uF R19 280K MGAIN C3 10uF R9 100 MGAIN R2 21 L_IN C6 0 47uF U1B MC33204 5 6 7 MK1 MICROPHONE 1 2 C7 2 2uF R13 280K R5 200K C5 2 2uF R16 100 R7 21 R6 24 9K R12 100K R3 470K U1D MC33204 12 13 14 R_IN Figure 24 Utility Class D ToolStick Board Schematic 1 of 3 Revision 1 0 ...

Page 23: ... PB0 15 17 PB0 14 18 PB0 13 19 PB0 12 20 PB0 11 21 PB0 10 22 SWDIO 23 SWCLK 24 PB0 9 25 PB0 8 26 PB0 7 27 PB0 6 28 PB0 5 29 PB0 4 30 PB0 3 31 PB0 2 32 PB0 1 33 PB0 0 34 VDD 35 VREGIN 36 VBUS 37 D 38 D 39 RESET 40 R49 1K C21 4 7uF U3 CF326 SX0261GM GPIO 1 GND 2 D 3 D 4 VIO 5 VDD 6 REGIN 7 VBUS 8 RSTb C2CK 9 C2D 10 SUSPEND 11 LED_STOP 12 NC 13 NC 14 NC 15 NC 16 NC 17 LED_RUN 18 NC 19 NC 20 NC 21 GPI...

Page 24: ... C31 0 022uF L4 3 3uH L _I JP1 R46 47K R38 0 R P L R34 0 L5 3 3uH R40 0 L _pin Q2 NTR4170NT1G R47 47K R _I R32 0 P_PWR FB1 600 Ohm R41 0 R N J4 Analog Header 1 3 2 4 R _pin C26 0 022uF R FB2 600 Ohm LS1 Speaker R48 0 M2 NTR4171PT1G R _pin R _I L N R31 0 C28 0 022uF R35 0 FB3 600 Ohm R37 0 L2 3 3uH M1 NTR4171PT1G Figure 26 Utility Class D ToolStick Board Schematic 3 of 3 Revision 1 0 ...

Page 25: ...V SMT ChipLED 0603 DS7 SML LX0603SUGW LUMEX INC GREEN 25 mA 0603 DS8 SML LX0603IW LUMEX INC RED 30 mA 0603 FB1 FB2 FB3 FB4 MPZ1608S601A TDK Corporation 600 1 A SMT 0603 J1 J5 SJ1 3543N CUI Inc Stereo Audio Jack J2 J3 UX60 MB 5ST HIROSE USB mini connector B J4 1729144 Phoenix Contact 1x4 Terminal Block JP1 TSW 102 07 T S Samtec 1x2 Jumper Header L1 NLV25T R68J PF TDK 0 68 µH 300 mA 5 GP L2 L3 L4 L5...

Page 26: ...licon Laboratories SiM3U164 B GQ MCU QFN40 M6x6 P0 5 U3 CF326 SX0261GM Silicon Laboratories ToolStick Debug Adapter MCU Components Not Installed C27 C30 C0603X7R100 225K Venkel 2 2 µF 10 V 10 X7R 0603 Not Installed NI C32 C0603X7R100 334K Venkel 0 33 µF 10 V 10 X7R 0603 Not Installed NI C33 C0603X5R6R3 475K Venkel 4 7 µF 6 3 V 10 X7R 0603 Not Installed NI J6 RAPC722X Switchcraft Inc 3 pin Power Ja...

Page 27: ...AN726 Rev 0 1 27 NOTES ...

Page 28: ...d disclaims responsibility for any consequences resulting from the use of information included herein Additionally Silicon Laboratories assumes no responsibility for the functioning of undescribed fea tures or parameters Silicon Laboratories reserves the right to make changes without further notice Silicon Laboratories makes no warran ty representation or guarantee regarding the suitability of its...

Reviews: