2012-04-21 06:14 AM
Hi,
According to the example code provide with the STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\USART\Interrupt, the clock provided to both the USARTs i.e.USARTy = USART1 and USARTz = USART2 is through RCC_APB1PeriphClockCmd using the command as in the code below.. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RCC_APB2PeriphClockCmd(USARTy_GPIO_CLK | USARTz_GPIO_CLK | RCC_APB2Periph_AFIO, ENABLE); /* Enable USARTy Clock */ RCC_NVIC_IRQChannelSubPriority(USARTy_CLK, ENABLE); /* Enable USARTz Clock */ RCC_APB1PeriphClockCmd(USARTz_CLK, ENABLE); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Why is APB2PeriphClock not provided to USART1 e.g. RCC_APB2PeriphClockCmd(USARTy_CLK, ENABLE);? I am running this example on my STM3210E-EVAL at 72MHz. bye, Nick2012-04-21 06:49 AM
void RCC_Configuration(void)
{ /* Enable GPIO clock */ RCC_APB2PeriphClockCmd(USARTy_GPIO_CLK | USARTz_GPIO_CLK | RCC_APB2Periph_AFIO, ENABLE);#ifndef USE_STM3210C_EVAL/* Enable USARTy Clock */
RCC_APB2PeriphClockCmd(USARTy_CLK, ENABLE);
#else /* Enable USARTy Clock */ RCC_APB1PeriphClockCmd(USARTy_CLK, ENABLE); #endif /* Enable USARTz Clock */ RCC_APB1PeriphClockCmd(USARTz_CLK, ENABLE); }
2012-04-26 01:54 AM