Hi All,
I use the Arduino Due and my next project is big so I am converting everything to work in the Atmel Studio 6.2 software.
To be honest I am a bit of a noob but I am trying.
I have everything working and can get both the PMC and PWM to output a square wave. I have the PMC working at 40kHz.
I have been looking around the internet and I just can't seem to find anything about how to set all the values for the prescaler, pwm clock generator and period.
I want to have a period of 255 so my range is like that or the arduino. I have played around with the figures but can't get that 40kHz output.
Anyone have any good reading or some sort of calculation for get the desired output frequency?
It is a Due so the MCK is 84MHz and that is what I have it set as with "sysclk_get_cpu_hz()"
Only using clock a for the PWM as all channels will need to be at 40kHz.