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

on nRF5340, how to generate clock to an output pin, 5/10/20 MHz or 8/16/32 MHz nRF5340 clock ou

On nRF5340, I need to generate a 5MHz &10 MHz & 20MHz, or 8MHz&16MHz & 32MHz  to output for external use,  how to do it?

A external sensor needs a continuous 5/10/20 MHz clock  or 8/16/32 MHz  clock output to a output pin.  .please tell me ,how to do it ?  thanks.

Parents
  • Hi,

    There are no straight-forward ways to do this on the nRF5340. The normal peripheral clock is 16 MHz, so the maximum frequency you could get by connecting a timer to a gpiote via DPPI is 8 MHz. You can get a higher master clock from the I2S, but not more than slightly above 12 MHz.

    The only alternative which should work is to generate the 32 MHz clock by using SPIM4 and a dummy transaction, and using another SPIM instance to generate the 16 MHz clock. You would not get a continuous clock though, just the duration of the dummy transaction before you have to start again. The 8 MHz clock can easily be generated continuously using a timer and GPIOTE, connected via DPPI.

Reply
  • Hi,

    There are no straight-forward ways to do this on the nRF5340. The normal peripheral clock is 16 MHz, so the maximum frequency you could get by connecting a timer to a gpiote via DPPI is 8 MHz. You can get a higher master clock from the I2S, but not more than slightly above 12 MHz.

    The only alternative which should work is to generate the 32 MHz clock by using SPIM4 and a dummy transaction, and using another SPIM instance to generate the 16 MHz clock. You would not get a continuous clock though, just the duration of the dummy transaction before you have to start again. The 8 MHz clock can easily be generated continuously using a timer and GPIOTE, connected via DPPI.

Children
Related