In fact, even with the internal RC osc, the accuracy was acceptable
for my app. (2 sec error in 20 mins). So I could do away with the
crystal(which I had added to solve this problem).
Only inconvenience now is getting divisions to get 1ms,10ms. This was
possible with the prescaler at CK/8 (4000000/8 = 500000 i.e 0.5 ms, so
getting 10ms, 20ms was easy). Now I have prescaler at CK/256 giving
15625 Hz, a non factor of 10 :(.
It really sounds like you are doing this the hard way. Is there
something preventing you from using Timer 1 or 2. These timers allow
you to specify the value of TOP using an output compare register(CTC
mode). This makes it possible to get pretty much any interrupt rate.
In your case, with the output of the prescaler at 500 KHz, you could set
OCR2 to 249 and get an OCF2 interrupt every 500 us.