본문 바로가기

3D Printer/OctoPrint

Chamber Manager Board 제작 #4 (25KHz PWM Test)

【 3D 프린터 챔버 만들기 】



[ Control Board 제작 #4 : 25KHz PWM Test ]



□ Test


 : Timer1을 사용하여 Pin 9에 Duty 20%로, Pin 10에 Duty 80%로 25KHz PWM 출력


1
2
3
4
5
6
7
8
9
10
11
12
  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1  = 0;
  TCCR1A = _BV(COM1A1)  // non-inverted PWM on ch. A
        | _BV(COM1B1)   // same on ch. B
        | _BV(WGM11);   // mode 10: ph. correct PWM, TOP = ICR1
  TCCR1B = _BV(WGM13)   // ditto
        | _BV(CS11);    // prescaler = 8
  ICR1   = 40;
 
  analogWrite(98);
  analogWrite(1032);
cs


[ Duty 20%]



[ Duty 80%]