Skip to main content
madhu13
Associate III
August 11, 2010
Question

STM32F103ZE Timer/ADC/PLL/ISR configuration help

  • August 11, 2010
  • 5 replies
  • 1032 views
Posted on August 11, 2010 at 13:01

STM32F103ZE Timer/ADC/PLL/ISR configuration help

    This topic has been closed for replies.

    5 replies

    madhu13
    madhu13Author
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    thanks kashif87 for ur reply

    i am using Keil uVision4 IDE...i saw the link but i didn't get any sample code there.. and m using STM32F103R8T6 controller.

    kashif
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    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 helps

    madhu13
    madhu13Author
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    ya i configured GPIOA as output push-pull and checked the o/p on logic analyzer window....its working fine now

    Tesla DeLorean
    Guru
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    Perhaps you should be initializing GPIO(A), the clocks for it and the port direction, etc.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    madhu13
    madhu13Author
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:01

    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;

     }

    }