hawxgamer

asm 32mhz

Dec 19th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void switchto32mhz() {
  2.     CCP = CCP_IOREG_gc;              // security register deaktivieren
  3.     OSC.CTRL = OSC_RC32MEN_bm;       // 32mhz oszi aktivieren
  4.     while(!(OSC.STATUS & OSC_RC32MRDY_bm)); // warten bis oszi stabil wird
  5.     CCP = CCP_IOREG_gc;              // disable register security für clock update deaktiveren
  6.     CLK.CTRL = CLK_SCLKSEL_RC32M_gc; // auf 23mhz umschalten
  7. }
  8.  
  9. vom application notes zip
  10. #include "HAL/adc_driver.h"
  11. inkludieren und nach dem adc init
  12.     ADC_Wait_32MHz(&ADCA); schreiben, damit bei dieser clockzahl die richtige zeit gewartet wird
Advertisement
Add Comment
Please, Sign In to add comment