xmega - timer0
C언어,ARM / 2020. 6. 27. 22:57
//오차가 있음 byte T_100msec_cnt; void Timer0_Callback(void) { T_100msec_cnt++; } void Timer0_init(void) { tc_enable(&TCE0); tc_set_overflow_interrupt_callback(&TCE0, Timer0_Callback); tc_set_wgm(&TCE0, TC_WG_NORMAL); tc_write_period(&TCE0, 32768/10);//32768=1sec tc_set_overflow_interrupt_level(&TCE0, TC_INT_LVL_MED); tc_write_clock_source(&TCE0, TC_CLKSEL_DIV1024_gc); }
'C언어,ARM' 카테고리의 다른 글
MFC 파일 드래그 드롭 (0) | 2020.07.18 |
---|---|
ST-LINK 펌웨어 쓰기 설정 (0) | 2020.07.11 |
ATmega,Xmega,AVR Studio - 문자열 프로그램메모리에서 읽어오기 (0) | 2020.06.27 |
xmega - WDT reset 와치독 타이머 (0) | 2020.06.27 |
error C2143: syntax error : missing ';' before 'type' (0) | 2020.06.20 |