This question is a direct continuation of the question/answer found at the link below. Skip to the last answer/comments given, as this is where my question begins (I don't have enough rep. points to comment).
This question/post helped to fix my 4.1ms dropout as well, thank you all!
When you say "...PR2 and the duty cycle register can be unconditionally modified.", what exactly do you mean? I guess I don't fully understand the situation, or maybe my situation is different. I'm using two global variables for the PRx and OCxR registers, which I calculate the value of in a function. I then have an interrupt set up to set the registers with the pre-calculated values from the function. My question/comment is: what if the interrupt happens after the calculation of PRx but before the calculation of OCxR? The interrupt will set the PRx value to the newly calculated value, but the OCxR value will be the previous, no? Can the interrupt happen DURING the calculation of either/or, thereby writing old values? To prevent this from ever happening, would it be helpful to include the frequency change flag anyways? I've tested both with my code, and I don't see any 4.1ms dropouts either way... I'm just curious.
For my case, I'm using toggle mode (no PWM), so PRx = 0CxR. My frequency is slow enough that I believe that if the two did become out of sync (PRx was assigned the new value but OCxR was assigned the previous value), I don't think it would matter. Regardless, everything is working great now (no 4.1ms dropout)!