Hi Steve,
Bigmac said "PE ia assuming" the bus frequency. I don't believe it would be, more than likely it is setting the bus frequency to what you told it or its own default, which happens to be the same as the QG default. So it is not assuming, but knowing.
Now to check it all out we only need to check the two clock setup registers.
IREFS = 1 so we use the internal clock of roughly 32k
RDIV = 000 so we divide this by 1
The FLL multiplies this by 512
CLKS = 00 so we use this output of the FLL
BDIV = 01 so we divide this by 2
now we have ICSOUT
this is again divided by 2 to produce BUSCLK
So the above gives approx 4.2MHz
But the thing that we know for sure is it is 128 times the internal clock
Now if MTIMCLK's CLKS is 00 then we use the BUSCLK above
and if PS is 0000 we divide this by zero
Now if MTIMMOD MOD is $105C, this divides the BUSCLK by 4188.
Thats it there are NO other variables or oportunities to alter it.
The value for the modulo seems a little off, I don't know why. The problem is it is off in the opposite direction than the error we are looking at.
The thing is if you truly believe what you are seeing at the output then the problem has to be the trim of the internal reference. If it s wrong, trim it till it is right!
This brings us to why the trim is wrong. Are you calculating the trim value (when you connect and programme the device) at the same voltage as when you run it? The internal reference is affected a fair bit by voltage (and temperature).