This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to enable the 32Mhz oscillator to show up as a spi clock on one GPIO pin?

Hi my company is trying to find a way to read the frequency of that 32 Mhz external oscilator on nRF52840.

As we cannot directly probe the oscilator due to the capacitor of the probe tampering the readings, we have thought about enabling the QSPI to have that 32Mhz clock directed to one of those GPIO pins as a SPI clk.


Could you guys give some guidance as how to enable 32Mhz oscillator to show up as a spi clock on one GPIO pin?
Thanks.

Parents
  • You can't output the system clock on a GPIO so the best is to use the radio and measure the center frequency of an un-modulated carrier. Either use the "radio test example" from the SDK, or flash it with this hex-file: nrf52 carrier ch40.hex This will setup a constant carrier at 2440 MHz. You need a spectrum analyzer and make sure you use a low span and low resolution bandwith.

  • Hi I was able to run the QSPI example project and measure the clock on P0.19. I wonder if the QSPI clk is strickly equal to system clk. Let's say the external 32Mhz oscillator is 32.00001 Mhz, would QSPI clock be 32.00001 Mhz too?

    Thanks.

  • Hi,

     

    You could do that, but it would be beneficial to measure this "earlier in the chain" - as the GPIO output capacitance may influence your measurements when running on such a high frequency.

    The QSPI CLK will inherit the tolerance of the HFCLK, but if you want to measure as accurate as possible, it is recommended that you use a spectrum analyzer and outputting a unmodulated RF carrier.

    If you do not have access to a spectrum analyzer, the next best thing would be to probe the XC1 pin. This will then load the crystal, so you have to adjust for that, by checking the capacitance on your probe, and adjusting the load capacitor. Let's say the probe is 4 pF, and the caps are 12, you need to adjust the one on XC1 down to 8 pF.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    You could do that, but it would be beneficial to measure this "earlier in the chain" - as the GPIO output capacitance may influence your measurements when running on such a high frequency.

    The QSPI CLK will inherit the tolerance of the HFCLK, but if you want to measure as accurate as possible, it is recommended that you use a spectrum analyzer and outputting a unmodulated RF carrier.

    If you do not have access to a spectrum analyzer, the next best thing would be to probe the XC1 pin. This will then load the crystal, so you have to adjust for that, by checking the capacitance on your probe, and adjusting the load capacitor. Let's say the probe is 4 pF, and the caps are 12, you need to adjust the one on XC1 down to 8 pF.

     

    Kind regards,

    Håkon

Children
No Data
Related