This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32f103 Clock configuration problem

Hello,

Here is my code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <string.h>
#include "stm32f10x_gpio.h"
#include "stm32f10x_rcc.h"
void GPIOSYS(void){
GPIO_InitTypeDef GPIOStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);
//GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE);
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
/* Output clock on MCO pin ---------------------------------------------*/
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I have tried to set my MCU frequency to 36Mhz. However, on PA8 I see 72Mhz which is more than I wanted. I need to know what is my problem that the MCU frequency is not 36Mhz. In addition,when I use "RCC_DeInit(); " at the beginning of my clock configuration, I don't see anything at PA8.

 

it is necessary to change clock and make it safe (connected to HSI )when the external clock fails to 36Mhz (both mode should have the same frequency)

0