Hello friends, I am trying to get UART1 output from STM32F767 using Keil, There is no output showing in the Serial monitor. I am adding my code with this Please help me out
Details
STM32F767Zi
Keil
HSI =16Mhz
PLL=72 Mhz
UART1
PLL source = HSI
APB2 = 72Mhz
Baudrate = 9600;
/*
void _PLL()
{
//RCC->CR|=1<<24;
RCC->PLLCFGR&=0;
RCC->PLLCFGR|=(2<<28)|(6<<24)|(216<<6)|(1<<3)|(1<<17);
FLASH->ACR&=0;
FLASH->ACR|=1<<11|1<<9|1<<8|1<<1|1<<0;
RCC->CFGR|=4<<10|1<<1;//
RCC->CIR|=1<<12;
RCC->CIR|=1<<20;
RCC->CR|=1<<24;
//while(((RCC->CIR)&1<<4)==0);
//RCC->CIR|=1<<20;
// GPIOA->BSRR=(1<<5);
}
void uart1_init()
{
RCC->AHB1ENR|=1<<1;
RCC->APB2ENR|=1<<4 | 1<<14; // UART1 clock enable
//RCC->APB2LPENR|=1<<4 | 1<<14;
RCC->DCKCFGR2|=1<<0;
GPIOB->MODER|=(1<<29)|(1<<31); // PB15 and PB14 are set for ALTERNATE FUNTION
GPIOB->AFR[0]=1<<18; // AZlternate function for Transmission
GPIOB->OSPEEDR|=1<<28|1<<29; // Set High speeed
USART1->BRR&=0;
USART1->BRR|= ((72000000)/9600); // Baud rate for 9600 0X57E4; //
USART1->GTPR&=0;
//RCC->CFGR&=0;
USART1->CR1&=0;
USART1->CR1|=1<<0|1<<7|1<<6;//|1<<1; //UART Enabled (UE)
//USART1->CR1|=1<<3; // Transmission Enabled (TE)
}
void main()
{
_PLL();
uart1_init();
while(!((USART1->ISR)&(1<<7))); // Checking the flag setting TXE
USART1->TDR='A'; // Data to be transmitted
while(!((USART1->ISR)&(1<<6)));
delay(5);
}
*/