External clock instead of oscillator
Hi,
currently, I am using an NX2016SA (as recommended by ST) to generate the HSE (32 MHz) for an STM32WB55RGV6 microcontroller.
I did not calibrate it, but so far everything works and I have a BLE range of up to 25 meters.
Now I am planning to getting my device certified for BLE, but I worry, because I did not calibrate the HSE. I don´t think I have equipment available to calibrate a signal to +- 25 ppm. Sounds a bit insane to me.
I did some measurements first: I switch between HSI and HSE and measure a current consumption of 3,36 mA for the HSE crystal at 3 V (1,13 mA / V is specified in the datasheet). I get a startup time of just 120 us from HSI to HSE. In the datasheet, a typical time for the XOREADY signal is specified as 250 us. How can it be that fast?
To switch between HSE and HSI, I use the following code:
void Turn_On_HSI(void)
{
LL_RCC_HSI_Enable();
while(!LL_RCC_HSI_IsReady())
{
}
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI);
while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
{
}
SystemCoreClockUpdate();
LL_RCC_HSE_Disable();
return;
}
void Turn_On_HSE(void)
{
LL_RCC_HSE_Enable( );
__HAL_FLASH_SET_LATENCY(FLASH_LATENCY_1);
while(!LL_RCC_HSE_IsReady( ))
{
}
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE);
while (LL_RCC_GetSysClkSource( ) != LL_RCC_SYS_CLKSOURCE_STATUS_HSE)
{
}
SystemCoreClockUpdate();
LL_RCC_HSI_Disable();
}
Now, in order to avoid the manual calibration, I am thinking about switching to an external clock, with its own oscillation circuit (e.g. SiT1533). There are external clocks available for 32 Mhz with a current consumption of approx. 3 mA. BUT: I have not found a single external clock, that has a startup time of less than 1 ms (max.). Why? Does anybody else use an external clock or does everyone use external oscillators? Especially in regard to BLE advertising, I see it as problematic, that the clock would have a startup time of 1 ms. This would drive up the current consumption by a lot.
Another question: In the reference manual RM0434, it is specified, that an external clock has to have a sinus signal. I haven´t found many external clocks with a sinus. 99 % of them have a rectangle. If I use the MCO (master clock output) to output the clock of the external crystal, I also see a rectangle in the oscilloscope.
So, to sum up my questions:
- Does the MCO show the exact waveform of the input signal? Or to be more precise, does the NX2016SA generate a sinus signal?
- Is it true, that an external clock for the HSE would have to be a sinus signal? That would limit the available products to ~1 %.
- Is it generally recommended to use an external clock instead of the oscillator or are the downsides so bad, that nobody does it?
- I did not order an external clock yet and thus, could not test it. Is the typical specified startup time generally much less than the max. specified startup time? If it really is 1 ms for most external clocks, I see that as a total deal breaker.
Kind regards