Question
STM32F4 USART PROBLEM
Posted on August 09, 2013 at 20:18
Hello, everyone.
I am currently playing around with the USART without standard peripheral lib provided by ST (using CMSIS only) and my code strangely works in one MDK project and does not work in another MDK project (Same code!) So if you are interested, please have a look at these: int main(void) { USART2->BRR=0x330; RCC->AHB1ENR|=RCC_AHB1ENR_GPIOAEN; RCC->APB1ENR|=RCC_APB1ENR_USART2EN; GPIOA->MODER|=( GPIO_MODER_MODER2_1| GPIO_MODER_MODER4_1); GPIOA->PUPDR|=( GPIO_PUPDR_PUPDR2_0| GPIO_PUPDR_PUPDR4_0); GPIOA->AFR[0]|=0x00077777; USART2->CR1|=USART_CR1_TE; USART2->CR1|=USART_CR1_UE; USART2->SR&=~(USART_SR_TC); USART2->DR=0x0000; } Any comment or idea will be appreciated! #stm32f4 #usart