This is all you need to know to set up Arduino’s high-speed PWM


Image 2 - Arduino UNO family (pinouts and PINOUT) - NOB's Arduino Diary! - Yahoo! Blog

Arduino Uno, Mega, Micro, etc. are listed in an easy-to-understand manner.
It's the easiest to see that I've ever looked into.

Setting for high-speed PWM

How to use Timer and PWM in AVR | Ushiko log

The book contains detailed and easy-to-understand instructions on how to set a fast PWM setting and how to set clock division.


void setup() {
  //TCCR1A = 0b10000010;  //10:コンペアマッチAでLOW,10:高速PWM動作
  TCCR1A = 0b10100010;  //10:コンペアマッチAでLOW,10:高速PWM動作
  TCCR1B = 0b00011001;  //11:高速PWM動作, 001:分周なし

  ICR1 = 649;       //0から数える. 全体時間 65ms
          //0.000001 * 65000 : 65ms

  OCR1A = 324;      //0から数える. High時間 32.5ms
          //0.000001 * 32500 : 32.5ms
  OCR1B = 324;

void loop(){