GPIO Waveform edge accuracy?

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm looking at the 120MHZ ATSAME51J20A for a potentially new design.

I need to create custom waveform outputs on the GPIO and I'm wondering what sort of repeatable accuracy can I hope to get.   For example, if I was producing a 1us square wave, how accurate and consistent would edges be?   So every 500ns, the code would toggle the GPIO pin, how accurate would the pulse width be?  +-25ns, 50ns, 100ns.... etc.  Its just an example, Its a more complicated wave shape.

Since the GPIO are on the other side of the various bridges, and there are other peripherals there,  I'm not sure what to expect.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using code and flipping gpio ports will most likely give you jitter. This is due to the processor being faster than the flash memory on chip. Depending on the actual device, there are various caching schemes that will introduce some non-determinism - instructions might take 1 clock, or maybe two or three .If you use the timer hardware, this will generate signals with precision of the source clock. Also worth mentioning is that these devices generate their clocks by using a phase locked loop (pll) and this has a degree of jitter but normally in the sub-nanosecond range.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I expect and anticipate jitter.....I just don't know to what degree.    I'm hoping that there are others out there that have experience with this on this MCU and know the answer.

For the same application I have used an 8-bit AVR running at 8MHZ and it was sufficient, but there was no bridge involved.  @ 100 or 120Mhz it should be 10x more accurate...unless there are unforeseen interaction with the bridge or the peripherals on the other side.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

split63 wrote:
@ 100 or 120Mhz it should be 10x more accurate..

10x more resolution, not 10x more accurate. Accuracy still depends on the clock source - the average crystal will give from 10-100ppm usually.

 

The jitter due to the operation of the cache etc depends on the workload - only you can determine this. The AVR is cycle accurate as there is no caching involved