Skip to content

timer1: mode 9 is not working anymore #111

@fjangfaragesh

Description

@fjangfaragesh

In real (tested with Arduino Uno), the LED on pin 10 is blinking fast. In simulation nothing happens.

#ifndef F_CPU
#define F_CPU 16000000UL // 16 MHz clock speed
#endif

int main(void){
  DDRB |=  (1 << PORTB2); //Define OCR1B as Output (pin number arduino: 10)
  TCCR1A |= (1 << COM1A0) | (1 << COM1B1) | (1 << WGM10); // PB2: output, PWM mode 9
  TCCR1B |= (1 << CS10) | (1 << CS11) | (1 << WGM13);// prescaler=64, mode 9
  OCR1A = 4000;
  OCR1B = 1000;
  while(1) {
  }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions