I just figured out what the problem was, i use a boot loader and there must i do the calbration off de internal 32mhz.
after changing de bootloader the internal 32Mhz is within 1%.
the code below does calibrate the internal 32mhz
[code:1:02b2026c13]
Config Osc = Enabled , 32mhzosc = Enabled , 32khzosc = Enabled
Osc_dfllctrl = &B00000000
'Enable DFLL and autocalibration
Set Dfllrc2m_ctrl.0
Set Dfllrc32m_ctrl.0
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1
Config Portc.7 = Output
Portcfg_clkevout = 01 'output sysclk clock on PortC.7
[/code:1:02b2026c13]
now i have anther qestion why works this only in de bootloader en not in the application?
Tiny
↧