AN95089 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques Author: Prakhar Agarwal Associated Part Family: CY8C4XX7-BL, CY8C4xx8-BL, CYBL10X6X, CYBL10x7x Related Application Notes: None AN95089 provides insights into the selection and tuning of the external crystal oscillator (ECO) and watch crystal oscillator (WCO) for PSoC 4/ PRoC BLE devices to achieve a good RF performance. This application note introduces basics of crystals and clock accuracy measurements. Cypress-recommended crystals and tuning techniques for optimum performance are also discussed. Contents 1 2 3 4 5 6 1 Introduction ...............................................................1 Crystal Oscillator Basics ...........................................2 2.1 Crystal Oscillator Circuitry................................ 2 2.2 Load Cap Value (CL) ........................................2 2.3 Crystal Equivalent RLC Circuit.........................4 2.4 Drive Level .......................................................5 2.5 PPM Error ........................................................5 Effects of Inaccurate ECO Crystal Frequency on RF Performance ..................................................5 Crystal Tuning Technique for ECO ...........................6 4.1 Steps to Correct Clock Inaccuracy ...................7 Is Tuning Required for Each Board? ........................8 Crystal Analysis for ECO ........................................ 10 6.1 Frequency Variation with Temperature .......... 10 6.2 Frequency Variation with Load Cap Value ..... 10 7 8 Recommendation for ECO ..................................... 11 Crystal Analysis for WCO ....................................... 11 8.1 Frequency Variation with Temperature .......... 11 8.2 Start-Up Time and ESR ................................. 12 8.3 Load Capacitance .......................................... 12 8.4 CL and Clock Accuracy ................................. 13 8.5 Frequency Variation Across Boards .............. 13 9 Recommendations for WCO................................... 14 10 Layout Considerations for PCB .............................. 14 11 Summary ................................................................ 15 12 References ............................................................. 15 13 Appendix: Frequency Error (Transmit Center Frequency Tolerance) ................ 17 Worldwide Sales and Design Support ............................. 19 Introduction This application note helps you select the ECO crystal and the WCO crystal for PSoC 4/PRoC BLE devices and tune them for optimum performance. Bluetooth Low Energy (BLE) is a timing-sensitive technology in which an inaccurate ECO clock can degrade the physical layer RF performance; similarly, an inaccurate WCO clock can lead to increased power consumption in a peripheral. The on-chip ECO circuit with an external crystal is used to synthesize a 24-MHz clock to run the BLE subsystem. The clock sets the protocol timing for link-layer operations and derives the carrier frequency for physical-layer RF circuits. An external WCO crystal is used to derive the 32.768-kHz clock that maintains link-layer timing synchronization when the BLE subsystem is in a low-power mode. www.cypress.com Document No. 001-95089 Rev. *A 1 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques 2 Crystal Oscillator Basics 2.1 Crystal Oscillator Circuitry A typical crystal oscillator circuit is shown in Figure 1. The oscillator circuit has one inverting amplifier, one feedback resistor (R), two capacitors (C1 and C2), and a quartz crystal (XTAL) Figure 1. Basic Crystal Oscillator Circuit Inverting Amplifier R XI XO XTAL C1 C2 During normal operation, the crystal and the capacitors form a π-network band-pass filter that provides a 180-degree phase shift and a voltage gain from the output to input at approximately the resonant frequency of the crystal. The resistor R acts as a feedback resistance, biasing the inverter in its linear region of operation and effectively causing it to function as a high-gain inverting amplifier. The combination of the 180-degree phase shift from the π- network and the negative gain from the inverter results in a positive loop-gain (positive feedback), making the bias point set by the feedback resistor unstable and leading to oscillation. 2.2 Load Cap Value (CL) The load capacitance is the total capacitance seen by the crystal looking into the rest of the circuit (see Figure 2). Figure 2. Load Capacitance Inverting Amplifier R XI XO CL XTAL The correct operation of a crystal oscillator circuit depends on the value of the total load capacitance value CL that is composed of not only the two capacitors C1 and C2, but also the parasitic capacitances and pin capacitances. www.cypress.com Document No. 001-95089 Rev. *A 2 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques Figure 3. Total Load Capacitance Including Parasitic Capacitance and Pin Capacitance Inverting Amplifier R XI XO XTAL CPIN1 CPCB1 C1 C2 CPCB2 CPIN2 CT1 = C1 + CPCB1 + CPIN1 CT2 = C2 + CPCB2 + CPIN2 Equation 1: Where, C1, C2 = Node Capacitance at XI and XO CT1, CT2 = Total node capacitance (including pin capacitance and parasitic capacitance) CPCB1 , CPCB2 = Parasitic Capacitance between PCB pads of the crystal CPIN1, CPIN2 = Input capacitance of the oscillator pins CL = Total load capacitance seen by the crystal The load capacitance required to generate an accurate crystal frequency is specified in the crystal datasheet. Capacitors C1 and C2 in Figure 1 should be chosen such that the value of CL from Equation 1 matches the datasheet value. The oscillator of PSoC4/PRoC BLE devices is designed to work with an 8-pF load capacitance, which requires that the chosen crystal has 8-pF load capacitance. The crystal will not oscillate at the frequency specified in the crystal datasheet if the passive crystal load circuitry does not provide the load capacitance (CL) that is required for the crystal. Too low a capacitive load will result in a crystal oscillator frequency higher than the specified value, while too high a capacitive load will result in a lower oscillation frequency. This frequency offset will be directly translated to an offset in the RF carrier frequency and symbol timing accuracy of the device. www.cypress.com Document No. 001-95089 Rev. *A 3 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques 2.3 Crystal Equivalent RLC Circuit Figure 4 shows the equivalent RLC circuit of the crystal. Figure 4. Equivalent RLC Circuit of the Crystal Inverting Amplifier R XI XO CL C0 LM RM CM Where, RM = Motional resistance of the crystal C0 = Shunt capacitance CL = Load capacitance CM = Motional capacitance LM = Motional inductance This circuit represents parallel resonant mode. The frequency of oscillation is derived from Equation 2: Equation 2: Where 2.3.1 is the series resonant frequency of the oscillator and is the frequency of oscillation. E q u i va l e n t S e r i e s R e s i s t a n c e ( E S R ) This resistance represents the resistive element of the quartz crystal equivalent circuit. It is the equivalent impedance of the crystal at its natural resonant frequency (series resonance). The gain of the oscillator amplifier directly depends on the ESR: the higher the ESR value, the higher will be the gain required by the oscillator amplifier to oscillate at the desired frequency. Internal oscillator circuits in every chip are designed to work with a maximum specified value of ESR such that the biasing point of the amplifier becomes unstable, resulting in oscillations. The ESR for a crystal is given by the following equation: Equation 3: See the crystal datasheet for the ESR value. Its value depends on the crystal frequency and usually varies from 20 Ω to 100 Ω. www.cypress.com Document No. 001-95089 Rev. *A 4 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques 2.4 Drive Level This is a measure of the amount of power dissipated (in µW) across the crystal. The maximum drive level is the maximum power a crystal can dissipate while still maintaining the specified performance. A high drive-level causes problems such as instability and aging. The drive level should be considered in your design to avoid premature aging and damage to the crystal. You should choose a crystal whose drive level specification meets your design drive level requirement. 2.5 PPM Error The crystal clock accuracy is usually defined in parts per million (ppm), which means the inaccuracy in the number of 6 clock cycles measured per 10 (1 million) clock cycles. Equation 4: For example, if a 24-MHz crystal oscillator provides a clock of 23.999928 MHz, then the clock accuracy is -72/24 = -3 ppm There are many reasons for ppm variation. Some of these are discussed below: Initial Tolerance (ppm): The deviation from the nominal crystal frequency for different devices under identical conditions (temperature, PCB layout, voltage, etc). This is a datasheet parameter. Temperature Drift (ppm): The deviation from the nominal crystal frequency over temperature. Aging (ppm/year): The cumulative change in the frequency of oscillation experienced by a crystal over a year. The variation due to aging may be different in different years. This may be +/- 1 ppm for the first year and +/- 20 ppm after 15 years. Pullability: This is the change in crystal oscillator frequency due to a change in the load capacitance. It is typically 20 ppm/pF. The parasitic load capacitance varies between 2.5 to 3.5 pF, which can cause the ppm to shift outside the BLE specification limit of +/-50 ppm. Therefore, the board parasitic capacitance should also be considered while choosing the load capacitor value for the crystal. Parasitic Capacitance: Stray capacitances from the PCB and pin input add to the overall parasitic capacitance seen by the crystal. This parasitic capacitance changes the load capacitance value. 3 Effects of Inaccurate ECO Crystal Frequency on RF Performance The data transmitted over BLE has a symbol rate of 1 mega-symbol per second (symbol timing of 1 µs), where a symbol refers to one bit of baseband signal that modulates the carrier. The symbol timing accuracy should be better than ± 50 ppm. In addition, the deviation in the RF center frequency during a packet transmission should not exceed ± 150 kHz (See Appendix: Frequency Error (Transmit Center Frequency Tolerance)).The symbol timing and the centre frequency are both derived from the 24-MHz crystal oscillator. Therefore, you should use a crystal that meets the BLE specification because the deviation in the crystal oscillator clock directly impacts the RF performance. A higher RF center-frequency deviation of the transmitter increases transmission leakages in adjacent channels that result in the following: Higher interference for receivers in adjacent channels Possibility of not meeting the radio specifications Increase in the spurious spillover in the adjacent channel that could result in failures in a band-edge test A higher frequency-deviation of the receiver with respect to the transmitter could cause a part of the received energy to fall outside the bandwidth of the baseband filter. This causes valid signal energy to be lost in the filter and results in a reduced sensitivity (and hence a reduced range). For GFSK receivers, the frequency deviation also causes a DC shift in the demodulated output and could result in the decoded symbols to be erroneous This results in a higher PER (packet error rate) and reduced sensitivity. Apart from these, a higher frequency-deviation of the receiver makes the receiver move closer to the adjacent channel. Consequently, signals in adjacent channels impact the reception, thus reducing the selectivity. www.cypress.com Document No. 001-95089 Rev. *A 5 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques The most important measure of RF performance is the receiver sensitivity. For BLE, receiver sensitivity is the lowest power-level up to which the receiver can receive packets with a maximum of 30.8 percent packet error rate (PER). Internal receiver characterization has shown that the receiver sensitivity can degrade by as much as 1 dBm if the ECO clock drifts beyond ± 20 ppm. Another important RF performance parameter is the Carrier to Interference (C/I) ratio xpressed in dB. This ratio indicates how strong or weak can the interferer signal be as compared to the carrier signal such that PER is ≤ 30.8 percent. A more negative C/I ratio is better as it means that even if the carrier power level is much weaker than the interference power level (i.e., strong interference), the receiver can still receive packets with a maximum of 30.8 percent PER. The C/I ratio can degrade by as much as 5 to 8 dBm if the ECO clock is inaccurate by -20 ppm. While the chosen crystal may have a good accuracy, the ppm may vary due to the reasons mentioned in Crystal Oscillator Basics. This requires the ability to tune the ppm to ensure a good RF performance. 4 Crystal Tuning Technique for ECO Tuning is the method of correcting any inaccuracy in the crystal clock that may occur in the system. Tuning aims at improving the accuracy of the generated frequency by adjusting the load capacitance value seen by the crystal oscillator circuit. Typically, tuning is done by directly adjusting the externally mounted load capacitance values or by having an external variable capacitor that can offset the mounted load capacitance value. However, external capacitors add additional system cost. PSoC 4/PRoC BLE devices have internal programmable trim capacitances (instead of an externally mounted load capacitance) on pins XI and XO (shown in Figure 5) as a part of the oscillator circuit. These load capacitances are tuned by firmware to correct the load capacitance offset, and therefore the frequency. Figure 5. Internal Programmable Trim Capacitors in PSoC 4/PRoC BLE Devices C1 C2 R PSoC4/PRoC BLE XI XO XTAL CPIN1 CPCB1 CPCB2 CPIN2 For tuning, the 24-MHz ECO clock is routed out of the chip to a GPIO to measure the clock accuracy. The clock accuracy is measured with a high-precision frequency measurement instrument like a universal time interval counter (Model SR620 from Stanford Research Systems). Equation 4 gives the clock ppm deviation. The clock inaccuracy is corrected by changing the value of the internal trimmable capacitances C1 and C2 using register writes (which effectively change the overall CL seen by the crystal) to bring the clock to the required ppm. www.cypress.com Document No. 001-95089 Rev. *A 6 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques 4.1 Steps to Correct Clock Inaccuracy Step 1: Enable radio Step 2: Enable WCO Step 3: Enable ECO Step 4: Bring the ECO clock on a GPIO and observe the clock accuracy (Example - clock on Port 2 Pin 7) Step 5: Trim the internal capacitance to achieve 0 ppm Function Code: void trim_capacitance() { /* Step1:Enable Radio */ *(uint32*) CYREG_BLE_BLESS_RF_CONFIG = 0x01; /* Step2:Enable WCO */ *(uint32*) CYREG_BLE_BLESS_WCO_CONFIG |= 0x80000000; /* Step3:Enable ECO */ *(uint32*) CYREG_BLE_BLERD_DBUS = 0xC992; /* Step4:Configure pin 2[7] as ECO crystal Output */ *(uint32*) CYREG_GPIO_PRT2_PC = 0xDB6DB6; *(uint32*) CYREG_HSIOM_PORT_SEL2 |= 0xA0000000; /* Step5:Trim Load Capacitance */ *(uint32*) CYREG_BLE_BLERD_BB_XO_CAPTRIM = <Load Cap value >; } Details for these registers are available in PSoC 4/PRoC BLE Registers Technical Reference Manuals (TRMs): PSoC 4 BLE registers TRM and PRoC BLE registers TRM The load capacitance value in step 5 is a 16-bit hex value. Each bit adds 0.1011 pF capacitance. Bits 15-8 together control the capacitance at the XI node. Bits 14 – 8 are used for fine control of the capacitance value at the XI node. Decimal Value of Bits 14-8 Capacitance Value C1 0 3.6900 pF 1 3.7911 pF 2 3.8922 pF ……. …….. 127 16.428 pF Bit 15 is used for coarse control of the capacitance value at the XI node. Bit 15 = 0 means that no additional capacitance is turned ON at the XI node. Bit 15 = 1 means that an additional capacitance of 8.1 pF is turned ON at the XI node. Bits 7-0 together control the capacitance at the XO node. Bits 6-0 are used for fine control of the capacitance value at the XO node. www.cypress.com Document No. 001-95089 Rev. *A 7 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques Decimal Value of Bits 6-0 Capacitance Value C2 0 3.6900 pF 1 3.7911 pF 2 3.8922 pF ……. …….. 127 16.428 pF Bit 7 is used for coarse control of the capacitance value at the XO node. Bit 7 = 0 means that no additional capacitance is turned ON at the XO node. Bit 7 = 1 means that an additional capacitance of 8.1 pF is turned ON at the XO node. CL and Clock Accuracy Changes in C1 and C2 result in a change in CL. Therefore, both values should be changed to tune the crystal properly. Even though there is no one-to-one look-up table to relate a change in capacitance value to a change in the ppm accuracy, a general practice is mentioned below: If the ppm is negative (i.e., the measured frequency is less than 24 MHz), then decrease the capacitance trim value on XI and XO because a smaller CL value results in an increase in fp according to Equation 2 If the ppm is positive (i.e., the measured frequency is more than 24 MHz), then increase the trim capacitance value because a larger CL value results in a decrease in fp according to Equation 2: For optimal phase noise, the total capacitance on the XI pin should be 0.8 times the total capacitance on the XO pin. 5 Is Tuning Required for Each Board? Table 1 and Figure 6 show the ppm variation measured for the same load cap value on 14 boards with the same PCB layout after tuning the CL for one board. Table 1. ppm Variation Across Boards for the Same CL Board www.cypress.com Measured Frequency ppm 1 23999998 -0.08 2 23999912 -3.66 3 24000051 2.12 4 23999859 -5.87 5 23999965 -1.45 6 23999912 -3.66 7 23999840 -6.66 8 24000064 2.66 9 23999951 -2.04 10 23999968 -1.33 11 24000000 0 12 24000061 2.54 13 23999800 -8.33 14 23999867 -5.54 Document No. 001-95089 Rev. *A 8 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques Figure 6. ppm Variation Across Boards for the Same CL ppm variation across boards 4 2 0 ppm 1 2 3 4 5 6 7 8 9 10 11 12 13 14 -2 -4 -6 -8 -10 Board# From this data, it is evident that the variation in crystal accuracy across boards is in the range of ± 7-8 ppm. This range of variation is permissible for optimum RF performance. Therefore, you don’t need to tune each board. You can tune a board once and use the same capacitance trim value for boards with the same PCB layout. After the trim value is determined for a device, the trim value should be written to the ECO trim register, CYREG_BLE_BLERD_BB_XO_CAPTRIM, using the register write command in Step 5. The register must be written at the device initialization stage. It is important to note that the ECO trim register is written with a default value as part of the BLE stack initialization. Therefore, the trim value should be written to the ECO trim register after the BLE stack initialization in the application, so that the register holds the updated trim value. This sequence is shown below. int main() { /* Stack Initialization */ CyBle_Start(EventCallback); /* Write trim value */ *(uint32*) CYREG_BLE_BLERD_BB_XO_CAPTRIM = <CAP TRIM VALUE >; for(;;) { CyBle_ProcessEvents(); } } www.cypress.com Document No. 001-95089 Rev. *A 9 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques 6 Crystal Analysis for ECO 6.1 Frequency Variation with Temperature Figure 7 shows the frequency variation that was measured for different crystals with temperature. Figure 7. ppm Variation with Temperature ppm vs temperature 10 5 KDS ppm 0 -50 -30 -10 10 30 50 70 90 NDK -5 Epson ECS Inc -10 -15 -20 temperature(◦C) This graph shows that the ppm variation for the four crystals across the temperature range of the device meets BLE specification of ± 50 ppm. However, other factors like aging, pullability, and stray capacitances can also change the crystal ppm. Therefore, the cumulative effect of all these factors on ppm should be within ± 50 ppm. 6.2 Frequency Variation with Load Cap Value Figure 8 shows the frequency variation for crystals that were measured with the load capacitance value. Figure 8. ppm Variation with Load Cap Value ppm vs load cap value 150 ppm 100 50 ECS Inc KDS Epson 0 0 2 4 6 8 10 12 NDK -50 -100 load cap value(pf) This graph shows that the frequency can be changed exponentially from positive offset (positive ppm) to negative offset (negative ppm) by changing the load capacitance value. This load capacitor is internal to the PSoC 4 / PRoC BLE device. However, it is important to note that the ppm variation with load capacitance value depends heavily on the PCB layout of the device. A PCB layout with a lot of stray capacitances may leave the frequency insensitive to changes in internal trim capacitances and therefore tuning may become difficult. Some general guidelines to reduce parasitic capacitance on the board are discussed in Layout Considerations for PCB section. www.cypress.com Document No. 001-95089 Rev. *A 10 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques 7 Recommendation for ECO Cypress recommends a crystal based on the following five parameters: 1. Equivalent series resistance (ESR): The ESR requirement for PSoC 4/PRoC BLE devices is maximum 60 Ω at 24 MHz. Therefore, the crystal ESR should be ≤ 60 Ω. 2. Drive level: The drive-level specification for PSoC 4/PRoC BLE devices is maximum 100 µW, so the chosen crystal should be able to support a drive level of up to 100 µW. Therefore, a crystal whose maximum drive-level specification is ≥ 100 µW (meaning that it can sustain at least 100 µW) would suffice. 3. Load Capacitance: The load capacitance of the chosen crystal should be 8 pF. 4. Pullability: Pullability should be low. If not, parasitic capacitances will cause a large variation in the crystal frequency. 5. ppm variation across temperature range of the device: Temperature range for PSoC 4/PRoC BLE devices is -40 to 85 ºC. The chosen crystal ppm should meet the BLE requirement (within ± 50ppm) across the chipsupported temperature range. Table 2 summarizes the crystals that were used for the characterization. Table 2. Drive Level and ESR Values for Different Crystals Crystal Part Number Crystal Vendor Drive Level (Max in µW) ESR (Max in Ω) ECS-240-8-36CKM ECS Inc 100 60 TSX 3225 Epson 200 40 NX2520SA NDK 200 60 DSX321SH KDS 200 60 In a nutshell, it is recommended to use those crystals that have their ppm specification meeting the BLE requirements across the chip-supported temperature range. The crystal must also meet the ESR and drive-level requirements for PSoC 4/PRoC BLE devices. After the crystal is chosen, the crystal tuning method suggested earlier must be used to tune the crystal to be accurate within ± 10 ppm to achieve the best RF performance. 8 Crystal Analysis for WCO 8.1 Frequency Variation with Temperature The BLE specification for low-frequency crystal is ± 500 ppm. Figure 9 illustrates the accuracy in ppm over temperature for a typical external WCO crystal. Figure 9. ppm Variation with Temperature ppm vs temperature 40 20 ppm -50 -30 0 -10 10 30 50 70 90 CM315 -20 ECS-.327-12.5-34B -40 -60 -80 www.cypress.com temperarure(◦C) Document No. 001-95089 Rev. *A 11 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques The less the variation, the better it is for low-power operations. This is because a larger drift in the low-frequency clock requires the device in the Peripheral role to listen for a master anchor point over a larger listening time window at the link layer, thus consuming extra power. 8.2 Start-Up Time and ESR The startup time indicates how long it takes for the WCO to provide a stable 32.768-kHz clock from the time the block is enabled. There are three distinct operating power modes for the WCO: 1. Power-down mode (PDM) 2. High-power mode (HPM) 3. Low-power mode (LPM) The WCO is started in HPM. After it is stable, it is switched to LPM to conserve power. The startup time with HPM is 500 ms. After the WCO has switched to LPM, no additional switching of modes is required for the block while the chip is in active mode or when the chip is switching between active and deep-sleep modes. However, if the chip switches to the hibernate or stop mode, then the entire WCO startup sequence is initiated again because the chip is reset. Crystal amplitude in HPM is limited to approximately 1-V pp while in LPM it is limited to approximately 0.12 V pp. The explained WCO start up sequence is taken care as a part of Creator initialization code and the user does not have to do this in the application code. Figure 10. PAD Voltages in Power Modes for WCO High Power Mode LPM PAD_xout 1V Low Power Mode High Power Mode 0.12V 1V PAD_xin The start-up time is directly related to the ESR of the external crystal. The larger the ESR of the crystal, the longer the time it takes to start up because the amplification of oscillations during startup takes longer with a larger resistance in series with the external load capacitors. Because the ESR of the crystal represents this series resistance, longer start-up times are evident. The crystal ESR characterization shows that the WCO design covers all crystal manufacturers’ ESR ranges from 35 to 70 kΩ. 8.3 Load Capacitance Figure 11 shows the external application view of a PSoC 4/PRoC BLE device. Note that no parallel or series resistors are required externally (they are present on chip). The only external requirements are a 32.768-kHz watch crystal and two load capacitors, C1 and C2, such that the total effective load capacitance CL is 6 pF or 12.5 pF depending on the crystal chosen. www.cypress.com Document No. 001-95089 Rev. *A 12 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques Figure 11. External Application View of PSoC 4/PRoC BLE Devices P6[1] P6[0] (C1 xC2 ) CL = (C1 +C2 ) + Cstray CL = 6 pF or12.5pF Y1=32. 768kHz C1 C2 CL = 6pF, C1 =18pF C2 =9pF CL = 12.5pF, C1 =37.5 pF C2 =18.75pF A higher C1/C2 ratio results in a higher current consumption but improved duty cycle. Based on extensive characterization, a ratio of 2:1 (C1= 2×C2) for the external capacitors is found to be optimal with respect to the performance and power consumption. The tradeoff for using a 2:1 ratio is slightly higher ICC (Integrated Chip Current) of up to 100 nA. For a 2:1 ratio, the recommended external capacitor values are C1 = 37.5 pF, C2 = 18.75 pF (for CL = 12.5 pF) C1 = 18 pF, C2 = 9 pF (for CL = 6 pF) 8.4 CL and Clock Accuracy The parasitic capacitance due to trace lines and pads can vary depending on the board layout. You should take into account the parasitic capacitance of each leg while calculating the load capacitance. The load capacitance may be further tuned to achieve a better clock accuracy. This can be done as follows: 8.5 If the average ppm is negative (i.e., the measured frequency is less than 32.768 kHz), then decrease both C1 and C2 capacitance values, while keeping the ratio of C1 to C2 to within 10 percent of the recommended 2:1 ratio (a ratio of 1.8 to 2.2 is acceptable if exact capacitance values are not available). However, if the negative ppm change is very small, then only C2 can be changed. If the average ppm is positive (i.e., the measured frequency is more than 32.768 kHz), then increase both C1 and C2 capacitance values while keeping the ratio of C1 to C2 to within 10 percent of the recommended 2:1 ratio (a ratio of 1.8 to 2.2 is acceptable if exact capacitance values are not available). However, if the positive ppm change is very small, then only C2 can be changed. Frequency Variation Across Boards Table 3 and Figure 12 show the frequency deviation (ppm) for a WCO measured across different boards having the same load capacitance values (in the ratio of 2:1). The table also shows how tuning the load capacitance within the recommended 10 percent variation range further reduces the ppm. Tuning is done only for one board; the same tuned capacitor values are used for all the boards. Table 3. ppm Across Boards for 2:1 Cap Ratio www.cypress.com Board ppm Before Tuning ppm After Tuning 1 2 3 4 5 6 7 8 9 10 76.29 39.36 52.49 63.47 44.55 64.69 68.35 70.19 62.56 42.72 56.45 33.56 45.77 54.93 37.23 43.94 50.65 51.87 40.58 34.17 Document No. 001-95089 Rev. *A 13 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques Figure 12. ppm Variation Across Boards for Same Load Capacitances ppm ppm variation across boards 80 75 70 65 60 55 50 45 40 35 30 ppm before tuning ppm after tuning 0 2 4 6 8 10 Board# The ppm variation across boards with the same load capacitor value is approximately 20 ppm. This is acceptable for BLE, and therefore, you do not need to tune every board. You can use this approach for mass production, where you tune 4-5 boards to find out the optimum load capacitance values and then use the same capacitance value for all theboards during production. 9 Recommendations for WCO The following factors should be considered while choosing the WCO crystal: 1. ESR: It should be a maximum of 70 kΩ for the correct operation of the crystal circuitry. A higher ESR means a longer start-up time. 2. Drive Level: The maximum drive level of the crystal should be ≥ 1 µW. 3. ppm variation across the device temperature range: The less the ppm variation, the better it is for power consumption. Choose a crystal that doesn’t have more than ± 50 ppm variation in frequency at room temperature after meeting the 2:1 ratio recommendation for load capacitance values. 4. Size: The size of the crystal should be chosen such that it is as small as possible, while meeting three requirements listed earlier. The ESR of the crystal varies inversely with the crystal size. Table 4. ESR and Size for WCO Crystals Part Number 10 Mfr Drive Level Max ESR Size (mm) L×W×H ECS-.327-12.5-34B ECS 1 µW 70 kΩ 3.2 × 1.5 × 0.9 CM315 Citizen 1 µW 70 kΩ 3.2 ×1.5 × 0.55 ECS-.327-12.5-32-TR ECS 1 µW 50 kΩ 3.2 × 1.2 × 1 Layout Considerations for PCB The crystal frequency is sensitive to parasitic capacitances, board noise, and electromagnetic interference. Keep the following points in mind while designing a PCB layout: 1 Position the crystal close to the chip to minimize the parasitic capacitance due to longer trace length and wider trace width, which would consequently alter the load cap value resulting in clock inaccuracy. 2 Minimize the pin-to-pin stray capacitance by having a ground shield trace between pin-connected traces. 3 Place the crystal on the same side of the PCB as the PSoC 4/PRoC BLE chip so that it provides a common ground plane without unnecessary vias on the crystal input/output traces. 4 Avoid floating pads of conductor near the crystal because this may introduce a stray capacitance. 5 Surround crystal components by a ground fill to avoid electromagnetic interference. 6 Keep fast-switching and high-current traces and pins such as LEDs away from the crystal circuitry. www.cypress.com Document No. 001-95089 Rev. *A 14 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques 7 Route PCB traces symmetrically to have the same parasitic capacitance on both crystal pins. Figure 13 illustrates the above points more clearly. Some of the layout considerations are highlighted in this figure. Figure 13. PCB layout with Crystals 11 12 Summary The BLE protocol requires that the ECO crystal clock accuracy is within ± 50 ppm. An inaccurate ECO crystal frequency results in poor RF performance. An inaccurate WCO crystal frequency results in high current consumption. The ECO crystal frequency inaccuracy can be corrected by following the 5-step process. Tuning is not required for every board and need to be done only once during development. A 2:1 ratio for the two external capacitors for the WCO crystal is required for optimal power consumption and performance. Temperature, aging, and parasitic capacitance cause variations in the crystal clock accuracy. The crystal should be positioned close to the chip to minimize parasitic capacitances. References The following references provide further detailed information Oscillator Concepts http://www.abracon.com/Support/facn_abracon_jul2011.pdf http://www.electronics-tutorials.ws/oscillator/crystal.html http://kunz-pc.sce.carleton.ca/thesis/CrystalOscillators.pdf http://services.eng.uts.edu.au/pmcl/de/Downloads/Lecture04.pdf http://www.am1.us/Local_Papers/U11625%20VIG-TUTORIAL.pdf www.cypress.com Document No. 001-95089 Rev. *A 15 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques ECO Crystal Datasheets ECS-240-8-36CKM from ECS Inc TSX-3225 from Epson NX2520SA from NDK DSX321SH from KDS WCO Crystal Datasheets ECS-.327-12.5-34B from ECS CM315 from Citizen ECS-.327-12.5-32-TR from ECS About the Author Name: Prakhar Agarwal Title: Systems Engineer Background: Prakhar Agarwal received his B.E. (Hons) degree in Electronics and Instrumentation from Birla Institute of Technology and Science (BITS, PILANI). www.cypress.com Document No. 001-95089 Rev. *A 16 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques 13 Appendix: Frequency Error (Transmit Center Frequency Tolerance) In BLE, the deviation of the RF center frequency during the packet transmission should not exceed ±150 kHz for the whole packet. For example, when a radio transmits at the center frequency of 2480 MHz, it could be 2479.850 MHz, or 2480.150 MHz. This is the tolerance in the center frequency when transmitting a packet. The center frequency is derived from the 24-MHz ECO and therefore any inaccuracies in the crystal frequency would be multiplied up to the center frequency. The clock accuracy requirement after taking into account all the factors that affect clock accuracy is www.cypress.com Document No. 001-95089 Rev. *A 17 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques Document History Document Title: AN95089 – PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques Document Number: 001-95089 Revision ECN Orig. of Change Submission Date Description of Change ** 4643683 PKAG 01/29/2015 New Application Note. *A 4764564 PKAG 05/15/2015 Updated template Updated associated part families www.cypress.com Document No. 001-95089 Rev. *A 18 PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques Worldwide Sales and Design Support Cypress maintains a worldwide network of offices, solution centers, manufacturer’s representatives, and distributors. To find the office closest to you, visit us at Cypress Locations. PSoC® Solutions Products Automotive cypress.com/go/automotive psoc.cypress.com/solutions Clocks & Buffers cypress.com/go/clocks PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP Interface cypress.com/go/interface Lighting & Power Control cypress.com/go/powerpsoc Memory cypress.com/go/memory PSoC cypress.com/go/psoc Touch Sensing cypress.com/go/touch USB Controllers cypress.com/go/usb Wireless/RF cypress.com/go/wireless Cypress Developer Community Community | Forums | Blogs | Video | Training Technical Support cypress.com/go/support PSoC is a registered trademark and PRoC is a trademark of Cypress Semiconductor Corp. All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone Fax Website : 408-943-2600 : 408-943-4730 : www.cypress.com © Cypress Semiconductor Corporation, 2015. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. This Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source Code except as specified above is prohibited without the express written permission of Cypress. Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. Use may be limited by and subject to the applicable Cypress software license agreement. www.cypress.com Document No. 001-95089 Rev. *A 19