I have my system running fine using the internal rc osc and ckdiv/8 set. Comms works fine at 4800 baud and I understand OSCCAL is automatically set on powerup.(Comms is fine at 38400 as well.)
I thought I'd test the accuracy of OSCCAL as the data sheet says it can be altered to 'fine tune'.(The value of OSCCAL is 0xB2 with this particular chip...)
So I include this in startup:-
LDI ZL,0 ;SET INT RC CAL if NEEDED. LDI ZH,2 LPM ; INC R0 STS OSCCAL,R0
The idea being that inc R0 (or decR0) will make a small adjustment to the frequency. As it is, (no inc) every thing is fine, and I output the value of OSCCAL to Comms and it's 0xB2.I double checked with my comms, outputting OSCCAL, having set it manually in AVRISP ( advanced tab,R/W OSCCAL to 200 hex) .
However, if I include the inc/dec R0 the comms fails, producing just garbage. Am I doing something wrong/missing something, or is it reasonable to expect a 1 bit change in OSCCAL to change the baud rate by so much? It must be at least >5% to screw the comms data.