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

How precise is 4 or 8MHz GPIO output on nRF52 and nRF51

Hi,

I'm building a device with an nRF52 or nRF51 Module (still undecided), but still need a second MCU for USB Host functionality. Unfortunately, USB Host requires a precise 48 MHz ±0.25% clock, so I can't use the internal RC of the second MCU (STM32). However, I'd like to save cost and more importantly space on my PCB, so I'd like to eliminate an external Crystal.

the PLL in the STM can get me 48MHz from pretty much any frequency, typically an 8MHz crystal is used, but 4MHz would work too.

My idea is to output a CLK signal on a GPIO of the nRF5x module and connect that to the OSC_IN pin on the STM32. Oh, and I'm using a softdevice.

The question is: how precise can I expect this signal to be? Lets say we stick to 4MHz, as I read somewhere that 8MHz is pushing the limits on the nRF52. I know it'll depend very much on the Crystal used on the Module, but will it's precision translate 1:1 to the output precision, or must I expect it to get worse?

I've found a couple of questions on how to get the signal and what the fastest frequency would be, but no mention of precision.

devzone.nordicsemi.com/.../

devzone.nordicsemi.com/.../

thanks already.

[update:] Just a quick note: on my PCB, the Nordic-based module and the STM will be back-to-back, and I'll select the closest possible pin for the clock output, so I'm expecting a trace length of about 3mm, at a width of 0.2 or 0.3mm with 1 via through a 0.8mm PCB.[/update]

Parents
  • I am new to Nordic, but the following should make sense for any MCU: A waveform generated by a hardware timer is so precise as the system clock, no matter 4mHz or 8mHz. But the lower frequency is preferred due to a wide spectrum of the squared pulses. The static PCB capacitance does effect on the form of the signal, but not on timings. And the most STM MCUs are not very sensitive to the external clock waveform, it can be "square, sinus or triangle with ~40-60% duty cycle" (from Reference manual).

  • Thanks for that - yes, that makes total sense, if the hardware timer also toggles the GPIO directly... however, if the hardware timer only triggers an interrupt, and in the interrupt service routine, the GPIO is toggled, then the situation looks completely different.

    I don't know the details of the inner workings of the GPIOTE, PPI systems. Does this just configure some stuff for the softdevice that has hardware timer interrupt service routines already implemented? or does it write directly to registers, configuring the hardware directly? maybe that's more the "real question" here... :-)

    great info on the form of the signal and the STMs invariance to that waveform! The form should be fairly constant, so it looks like I have nothing to worry about on that side - very cool!

Reply
  • Thanks for that - yes, that makes total sense, if the hardware timer also toggles the GPIO directly... however, if the hardware timer only triggers an interrupt, and in the interrupt service routine, the GPIO is toggled, then the situation looks completely different.

    I don't know the details of the inner workings of the GPIOTE, PPI systems. Does this just configure some stuff for the softdevice that has hardware timer interrupt service routines already implemented? or does it write directly to registers, configuring the hardware directly? maybe that's more the "real question" here... :-)

    great info on the form of the signal and the STMs invariance to that waveform! The form should be fairly constant, so it looks like I have nothing to worry about on that side - very cool!

Children
No Data
Related