Go Down

Topic: Best microcontroller for frequency counter up to 30MHz (Read 3358 times) previous topic - next topic


Hi John,

I understand that you intend to use a single synchronous clock to drive the SAMD51, and no doubt the flexibility of the SAMD51's oscillator controller module will allow this.

The point I was making is that the SAMD51's architecture is pulling somewhat in the opposite direction, allowing for multiple internally generated clocks and a system in which the CPU core and peripherals are clocked and operate independently.

It's possible to route the same synchronous clock to both CPU and peripherals, and while the peripheral is running, there isn't an issue. However, there is an issue to bear in mind when accessing the peripheral's registers, in that some of them require write and read clock synchronisation between the CPU and the peripheral itself. This occurs even if the CPU and peripheral are using the same synchronised clock. Although the write or read itself may only take one instruction cycle, the synchronisation process can take up to 7 to 9 clock cycles to complete.

As I mentioned, normally this isn't problem, (apart from having wait for certain registers to synchronise each time in your code), but it can become an issue when dealing with either very fast clocks and signals, where accurate timing is paramount, or conversely, (because the entire peripheral and it's registers are being driven by a generic clock), very slow clocks as well. This occurs for example when accessing the Real Time Counter, when waiting for X number of 1.024kHz clock cycles to synchronise becomes noticable.

Go Up