Finding pulse period for output compare on ATmega128 (10-bit fast PWM)


Ok, so I have ATmega128 board. I have clock of 16MHz with a prescaler of 8 (2MHz). I am using fast 10-bit PWM to generate a waveform with a top value of 1023.

Given a number, the value put in OCR1A = pulse_period *(number/100).
The wave will be high for pulse_period * (number/100) and low until it reaches TOP, where the timer will reset.

However, given the information I have (which I gave in first few lines), how do you find the pulse_period when top is 1023?

Thanks for any help πŸ™‚

Best Answer

\${1024 \over ({16MHz\over 8})} = 512\mu s\$