[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.1914295 [View]
File: 56 KB, 995x478, ctc.png [View same] [iqdb] [saucenao] [google]
1914295

>>1914291
TIMSK2 |= (1<<OCIE2B)|(1<<OCIE2A)|(1<<TOIE2);
TCCR2A |= (1<<WGM01); //CTC Mode enabled
TCCR2B |= (1 << CS22)|(1<<CS21)|(1<<CS20); //prescale 1024
OCR2A = 38; // 200Hz PWM

perhaps you are right. looking at the register description of TCCR2A there is only WGM21 and WGM20 in the first 2 bits

Navigation
View posts[+24][+48][+96]