Dear Forum mates!
I would like to ask for your help. I want to create a 58KHz square-wave signal between 2 pins with arduino ( ATMEL328 ). When the first is on HIGH state, the other will be LOW and vice versa. The duty cycle is not important, the best if it's 50-50%.
I tried to set the Timer2 to do the job, I can see the 57980KHz on Pin 11 with a frequency counter, but nothing on Pin 3.
Can anyone help me to configure TCCR2A and TCCR2B?
Thank you!
pinMode( 11, OUTPUT );
//TCCR2A = [COM2A1, COM2A0, COM2B1, COM2B0, reserved, reserved, WGM21, WGM20]
TCCR2A = B01000011;
//TCCR2B = [FOC2A, FOC2B, reserved, reserved, WGM22, CS22, CS21, CS20]
TCCR2B = B00001001; // 137 / 57.990Khz
OCR2A = B10001001;