Question
why led blink when any clock source not selected?
Posted on October 19, 2017 at 10:42
hi,
on this code:
&sharpinclude 'stm32f10x.h'
&sharpinclude 'delay.h'int main(){ SystemInit (); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA , ENABLE); GPIO_InitTypeDef gpio; gpio.GPIO_Pin = GPIO_Pin_0; gpio.GPIO_Speed = GPIO_Speed_2MHz; gpio.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(GPIOA , &gpio); while(1) { GPIOA->BSRR = GPIO_Pin_0; delay_ms(300);GPIOA->BSRR = (GPIO_Pin_0<<16); delay_ms(300); }}
when there is SystemInit (); , it work corrctly.
and when i delete the SystemInit (); when the system clock not set , but the led blink and time is more then 300 ms , i dont know why the clock isnt set , but the led blink ??
i write RCC_LSICmd ( DISABLE) ; to disable internal clock , but this CMD doesnt work , and the led still blink.NOTE:
i want to understand how does the clock or RCC work in stm32 , for this , i try to test these ways.And i want to set the RCC myself.
so thanks.
#blink #clock