17 #include <avr/pgmspace.h> 30 OSC.CTRL = OSC_RC32MEN_bm;
33 while ( !(OSC.STATUS & OSC_RC32MRDY_bm) )
39 NVM.CMD = NVM_CMD_READ_CALIB_ROW_gc;
40 tmp = pgm_read_byte( offsetof(NVM_PROD_SIGNATURES_t, USBRCOSC) );
43 NVM_CMD = NVM_CMD_NO_OPERATION_gc;
46 OSC.DFLLCTRL = OSC_RC32MCREF_USBSOF_gc;
48 DFLLRC32M.COMP1 = 0x1B;
49 DFLLRC32M.COMP2 = 0xB7;
50 DFLLRC32M.CTRL = DFLL_ENABLE_bm;
54 OSC.CTRL = OSC_RC32MEN_bm | OSC_RC2MEN_bm;
56 while ( !(OSC.STATUS & OSC_RC32MRDY_bm) )
59 OSC.PLLCTRL = OSC_PLLSRC_RC2M_gc | 16;
62 OSC.CTRL = OSC_RC32MEN_bm | OSC_PLLEN_bm | OSC_RC2MEN_bm;
64 while ( !(OSC.STATUS & OSC_PLLRDY_bm) )
67 DFLLRC2M.CTRL = DFLL_ENABLE_bm;
71 CLK.CTRL = CLK_SCLKSEL_PLL_gc;
void Config32MHzClock(void)
Einstellung der Systemtakte und der USB-Clock.