PIC OSCCAL tuning

You might find it easiest to just test it. IIRC, there are a couple of the (6?) bits that just offset the (4-bit?) trim range up or down. Nothing is guaranteed, of course. The general function of the bits should be covered in the midrange reference manual.

Yes, you can change it on the fly- that's what you do when you first set it.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany
Loading thread data ...

Does anyone know roughly what percentage incrementing the OSCCAL register (by one) will change the internal frequency of the 4 MHz clock of a PIC? Can you change this register and tune the frequency on the fly?

Thomas

Reply to
Thomas Magma

"Thomas Magma" wrote

register

PIC? Can

I don't believe this data is characterized, but I seem to recall someone experimenting with this on the piclist a couple of years ago. I'm thinking that your best bet is to search the piclist archives.

Reply to
Anthony Fremont

The tweak amount varies with different models. Most of the newer chips have a 'fine tune', as well as the normal control. Yes, it can be tweaked, the actual register is writable at any time. On PICs with ICD abilities, you can force the write instruction to execute, without even changing the program memory. The Mach-X programmer can do this automatically, by comparing the resulting frequency with it's internal crystal. However remember that tweaking the value, won't improve the basic accuracy,which will still vary by up to 2%, across the temperature and voltage range of the chip. The data sheet for chips like the 18F1320, includes recommendations for how to work out which way to tweak the register.

Best Wishes

Reply to
Roger Hamlett

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.