Convert Atmega8 Timer Settings to Arduino Nano

Hello

I am trying to control a FV-1 chip with my arduino nano.
There are 3 Pot pins on the FV-1 and I want to use PWN and a voltage divider to control
the parameters.

I have found an article where someone uses an Atmega8 chip to do that.
They use these timer-settings

InitPWM:
    ldi     R16, 1<<COM1A1 | 1<<COM1B1 |1<<WGM10
    out     TCCR1A, R16
    ldi     R16, 1<<WGM12 | 1<<CS10
    out     TCCR1B, R16
    ldi     R16, 1<<WGM20 |1<<COM21 | 1<<WGM21 | 1<<CS20
    out     TCCR2, R16

I translated COM21 to COM2A1. But when I write the same value to all OCR1A, OCR1B and OC2A,
and look at the result on my osciloscope 1A and 1B look the same, but 2A looks complely different.

Any ideas how to set up Timer 2 to match the output of Timer 1 ?

here is the C Code

void setup() {
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  TCCR1A = _BV(COM1A1) | _BV(COM1B1) | _BV(WGM10);
  TCCR1B = _BV(WGM12) | _BV(CS10);
  TCCR2A = _BV(WGM20) | _BV(COM2A1) | _BV(WGM21) | _BV(CS20);
  OCR1A = 50;
  OCR1B = 50;
  OCR2A = 50;
}

Regards
Carsten

Why you don't want to use a analogWrite(). It does what you are looking for.

https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/

alesam: Why you don't want to use a analogWrite(). It does what you are looking for.

https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/

Well the waveform looks different when using these values and I don't want to screw it up. But nevermind, I just messured the output voltage, and it matches perfectly... so all good :-D