|
AN95089 Datasheet, PDF (7/19 Pages) Ramtron International Corporation – BLE Crystal Oscillator Selection and Tuning Techniques | |||
|
◁ |
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
0
1
2
Capacitance Value C1
3.6900 pF
3.7911 pF
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
|
▷ |