I'm using STM32F103RE for implementing a time-consuming operation. This device is connected to the PC via a USB port. I'm not expert in configuring these MCUs, but it seems when it configures to communicate via USB, it can't use maximum possible processing speed which is 72 MHZ.
Is there a way to configure my STM32F103 with two different frequencies (one for USB communication & the other for internal proccessing at 72MHZ)?
This is part of the USB configuration code:
RCC->APB1ENR |= (1 << 23); /* Enable clock for USB */ /* Enable USB interrupts */ NVIC->IPR  |= 0x00000010; /* Set priority lower than SVC */ NVIC->ISER |= (1 << (USB_LP_CAN_RX0_IRQChannel & 0x1F)); /* Control USB connecting via SW */ RCC->APB2ENR |= (1 << 5); /* Enable clock for GPIOD */ GPIOD->CRL &= ~0x00000F00; /* Clear port PD2 */ GPIOD->CRL |= 0x00000700; /* PD2 General purpose output open-drain, max speed 50 MHz */ GPIOD->BRR = 0x0004; /* Reset PD2 (set to low) */
And this is my smt32_init clock configuration:
#define __CLOCK_SETUP 1 #define __RCC_CR_VAL 0x01010082 #define __RCC_CFGR_VAL 0x001D8402 #define __HSE 8000000
I guess some change in RCC_CR or RCC_CFGR should solve the problem, but I think there are also some other configurations for flash to work with high frequency.
How can I do that?