2010-08-11 04:01 AM
STM32F103ZE Timer/ADC/PLL/ISR configuration help
2011-05-17 05:01 AM
you are working on which IDE? generally IDE's have some example codes for different peripherals. try to run those examples.
you can download different helping material, manuals and sample codes from this link
http://www.st.com/mcu/modules.php?name=mcu&file=familiesdocs&FAM=110
http://www.st.com/mcu/modules.php?name=mcu&file=familiesdocs&FAM=110
hope this helps2011-05-17 05:01 AM
2011-05-17 05:01 AM
i got an example of timer for Timer1 that worked well both in polling and interrupt methods. but now i am trying to configure Timer in the same way as bellow, i am using Keil IDE interrupt is not comming can you tell me what is the problem in this code...
main()
{ RCC->APB1ENR=0x00000001; //Timer2 peripheral clock enable TIM2->PSC=0x0001; TIM2->ARR=0xffff; //Autoreload value TIM2->CNT=0x0000; TIM2->EGR=0x0000; //0x0001;TIM2->CR1=0X0280; //0x0281;//Prescalar is 10 ie. tDTS=4*tCK_INT, autoreload enabled
TIM2->DIER = 0x0001; // enable interrupt
NVIC->ISER[0]|= (1 << (TIM2_IRQChannel & 0x1F)); //NVIC->ISER[0]=0x10000000; TIM2->CR1|=0X0001; while(1) {; } }void TIM2_IRQhandler(void)
{ if ((TIM2->SR & 0x0001) != 0) { i=~i; GPIOA->ODR=i; TIM2->SR=0x0000; //TIM2->CR1|=0X0001; } }
2011-05-17 05:01 AM
Perhaps you should be initializing GPIO(A), the clocks for it and the port direction, etc.
2011-05-17 05:01 AM
ya i configured GPIOA as output push-pull and checked the o/p on logic analyzer window....its working fine now