Thanks for the response, @DrDiettrich .I disagree with this part of your response above. Do you have any specific reasons why you believe this is the case?
Per the datasheet (section 17.9), in CTC mode (mode 4 or mode 12), the timer counts until TCNT matches OCR or ICR (depending on if mode 4 or mode 12), then the timer clears and counts from zero again. In CTC mode, the OC3A/OC3B/OC3C can be toggled at compare match (COMA1 = 0, COMA0 = 1). By changing the OCR or ICR register, the duration of both the high pulse and low pulse can be affected (i.e time between last toggle and next toggle), thus affecting the frequency at which the pin is toggled.
Also, as I stated in my original post, this approach works flawlessly in a simple sketch without classes. With a simple sketch, I get only expected speeds with the motor. It also shows the exact changing frequency squarewave that I'm expecting on OC3A, confirmed with an oscilloscope.
I agree with you on the excessive serial outputs, which is why I tested it without the serial lines, but it still has the same problem ![]()