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 thanks for your reply. we do not have a spectrum analyzer that can mearsure in Ghz range, So your solution doesn't work for us.

    In my question i mentioned "we have thought about enabling the QSPI to have that 32Mhz clock directed to one of those GPIO pins as a SPI clk."

    in your response you mentioned "You can't output the system clock on a GPIO"

    This is a little confusing as we are NOT trying to output system clock on a GPIO. We are trying to enable QSPI, because the QSPI clock (SCK) is 2~32Mhz, as stated in page 286 of the following document:

    https://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.1.pdf

    And we are trying to measure that 32Mhz QSPI clock in order to indirectly determine if the 32Mhz system clock is working.

    We are hoping based on this logic: if we can measure a 32Mhz QSPI clock on a GPIO pin, that's a strong indicator the 32Mhz system clock is working, right?

    Now here are two questions for you:

    1. Is this logic stated above correct?

    2. If it's correct, what are the steps to enable a 32Mhz QSPI clk on GPIO pins?

    Thanks again!

    PS It seems there is one solution to have 32Mhz system clock routed to debug traces. But we do not have debug trace on our boards so it seems QSPI clk is the only solution to measure 32Mhz system clock indirectly, unless you have some ways around it

     

Reply
  • Hi thanks for your reply. we do not have a spectrum analyzer that can mearsure in Ghz range, So your solution doesn't work for us.

    In my question i mentioned "we have thought about enabling the QSPI to have that 32Mhz clock directed to one of those GPIO pins as a SPI clk."

    in your response you mentioned "You can't output the system clock on a GPIO"

    This is a little confusing as we are NOT trying to output system clock on a GPIO. We are trying to enable QSPI, because the QSPI clock (SCK) is 2~32Mhz, as stated in page 286 of the following document:

    https://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.1.pdf

    And we are trying to measure that 32Mhz QSPI clock in order to indirectly determine if the 32Mhz system clock is working.

    We are hoping based on this logic: if we can measure a 32Mhz QSPI clock on a GPIO pin, that's a strong indicator the 32Mhz system clock is working, right?

    Now here are two questions for you:

    1. Is this logic stated above correct?

    2. If it's correct, what are the steps to enable a 32Mhz QSPI clk on GPIO pins?

    Thanks again!

    PS It seems there is one solution to have 32Mhz system clock routed to debug traces. But we do not have debug trace on our boards so it seems QSPI clk is the only solution to measure 32Mhz system clock indirectly, unless you have some ways around it

     

Children
No Data
Related