Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

External Oscillator for WCO of PSoC® 4/ PRoC™ BLE - KBA200299

External Oscillator for WCO of PSoC® 4/ PRoC™ BLE - KBA200299

Anonymous
Not applicable

Version: *A

Translation - Japanese: PSoC 4 / PRoC BLE WCO 用外部発振器 - KBA200299 - Community Translated (JA)

Question:

Can I use an external oscillator for the watch crystal oscillator (WCO) of PSoC 4/PRoC BLE?

Answer:

Yes, you can use an external oscillator for the WCO. 

Make the following settings in the hardware:

  1. Connect the external clock source to the XTAL32O pin.
  2. Leave the XTAL32I pad floating. If floating is not desirable, ensure to have an impedance of at least 500 kW between the XTAL32I pad and ground.
  3. Provide an external clock source that toggles from 0 V to a minimum of 1.0 V, or 0 V to a maximum of 1.6 V.
  4. Ensure that the duty cycle of the external clock is between 20 and 80 percent.

To use an external clock in firmware, do the following:

  1. Disable WCO and select ILO for LFCLK in the Low Frequency Clocks tab of the Configure System Clock window in the .cydwr file.
  2. Set the EXT_INPUT_EN (bit 2) bit to ‘1’ in the BLE_BLESS_WCO_CONFIG register in firmware before enabling the WCO.
  3. Start WCO by calling the CySysClkWcoStart(); API.
  4. Select WCO as the LFCLK source by calling the CySysClkSetLfclkSource(CY_SYS_CLK_LFCLK_SRC_WCO); API.
  5. Stop ILO by calling the CySysClkIloStop(); API.

A sample code for using the external clock source for WCO is given below:

int main()
{
/*Enable External Clock*/
CY_SYS_CLK_WCO_CONFIG_REG |= CY_SYS_CLK_WCO_EXT_INPUT_EN;
/*Start WCO */
CySysClkWcoStart();
/*Select WCO as the clock source*/
CySysClkSetLfclkSource(CY_SYS_CLK_LFCLK_SRC_WCO);
/*Stop ILO*/
CySysClkIloStop();
CyGlobalIntEnable;
/* Stack Initialization */
CyBle_Start(EventCallback);
for(;;)
{
CyBle_ProcessEvents();
}
}

0 Likes
1511 Views
Contributors