I have this code that I am trying to understand , say -i- is looping from 0-100, then you have this (we already setup the timer stuff):
TCNT1 = 0;
ICR1 = i;
OCR1A = i/2;
Say we also using a pre sacle of 1, with 16MHz clock , on timer 1.
According to the OCR1A , the values will be- 0,0,1,1,2,2,3,3,4,4,5,5... etc. Is that right ?
Is this means that the frequency is 16MHz,16MHz,8MHz, 8MHz ,4MHz, 4MHz, 2Mhz, 2Mhz... ?
What the ICR1 do, I could not really understand, and I also guess I dont get what frequencies will this code produce ?
Thank you.