2013-07-24 12:24 AM
Hi All,
Basically i want to configure the USART1 in the STM32f100R8 uC. The following code i have written for configureing USART1.//UART1 initialization
RCC->APB2ENR |= RCC_APB2ENR_AFIOEN + RCC_APB2ENR_IOPAEN +RCC_APB2ENR_USART1EN; RCC-> AHBENR |= RCC_AHBENR_SRAMEN;GPIOA->CRH |= GPIO_CRH_CNF9_1 + GPIO_CRH_MODE9_0 ; GPIOA->CRH |= GPIO_CRH_CNF10_0 + GPIO_CRH_MODE10_0 ; USART1->BRR = 0x0052;USART1->CR1 |= USART_CR1_UE + USART_CR1_TE + USART_CR1_RE + USART_CR1_RXNEIE; USART1->DR ='@';But, when i try to run this code it's not transmitting any data. And i am not seeing any data in USART1 DR register. #stm32f100r8-usart12013-07-24 01:42 AM
Why dont you just take something from examples? This style of writing code is ''2 die 4''.
2013-07-24 09:59 AM
What clocks and baud rate are you working with here?
If you send a continuous stream of characters can you see them on a scope, does the bit timing appear correct?2013-07-25 11:10 PM
System clock is 8MHZ,
And USART baud rate is 9600kbps.I am trying to send only one byte. When i am writing data to the DR (data register). it's not getting updated on DR register in debugging mode.2013-07-25 11:17 PM
sorry, its 9600bps not 9600kbps
2013-07-25 11:34 PM
The debugger can't look behind the curtains to see what is in the register, don't assume it can display a useful value.