I'd like to tag a question on to this question. I just realised that the PEmicro BDM Multilink must be setting the non volatile trim value during debugging but the production programmer requires this to be an explicit step in programming. I don't really like this as a second step.
The project runs on a crystal so my assumption is that the internal ref. oscillator doesnt have to be very accurate. It just has to be running to get the PLL/FLL going ?
I'm going to try to set the non volatile trim setting from code before i try to get DCO lock for a crystal. But i probably dont have to do anythin with the trim value in that case right?
i was playing around with code that initialised the trim value from a the NVICGTRM (0xFFBE) but the code so far does not set the NVICGTRM itself.
I programmed using the production programmer and did not set the trim value into NVICGTRM. The result was that the FLL wouldn't lock. When i redo it and set the trim value into the high flash register with the production programmer it's ok. Maybe this means a value of $FF was being loaded into the trim register? is there anything wrong with that value? In any case, would the FLL care what speed the internal ref clock is running at?
Like i said i'm pretty sure when using a crystal as reference i should have to do anything with the trim but i was experimenting with it. thoughts?