TIM4 썸네일형 리스트형 STM8 timer interrupt using TIM4 [main.c]#include "stm8s.h" uint32_t t=0; @far @interrupt void TIM4_UPD_OVF_IRQHandler(void){if(++t==1000) t=0;if(t==0) GPIO_WriteReverse(GPIOD,GPIO_PIN_0);TIM4_ClearITPendingBit(TIM4_IT_UPDATE);} void main() {CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1); //16MHz Setting GPIO_DeInit(GPIOD);GPIO_Init(GPIOD, GPIO_PIN_0, GPIO_MODE_OUT_PP_HIGH_FAST); CLK_PeripheralClockConfig (CLK_PERIPHERAL_TIMER4 .. 더보기 이전 1 다음