I want to make frequency generator with this utility so is there any documentation about counting ticks?
=> Timer Counter (TC)!
You can count the clocks of MCK/2 (=42MHz)
ATMELSAM(datasheet) 37.1 Description
The Timer Counter (TC) includes three identical 32-bit Timer Counter channels.
Start the counter, read the counter (Counter Value register) or generate an interrupt (Interrupt Enable Register) and react
to your choosen number of counts.
Sound easy, but its a it lot of register manipulation. Maybe you can find a lib for he TC?