Question
USART3 initialization in stm32f103r8
#include "stm32f10x.h"
void usartSetup (void);
int SendChar ();
int main()
{
while(1)
{
usartSetup();
SendChar();
}
}
void usartSetup (void)
{
RCC->APB1ENR = 0x00040000;
RCC->APB2ENR = 0x0000000C;
GPIOB->CRH = 0x00000900;
USART3->BRR = 0x340;
USART3->CR1 = 0x00002008;
}
int SendChar ()
{
while (!(USART3->SR & 0x00000080));
USART3->DR = '2';
}
I tried this simple program for USART3 communication, it doesnot work for me. I initialize the registers as same as USART1, is there any configuration i missed in above code, please point me out.
