AnsweredAssumed Answered

USART polling vs Interrupt

Question asked by Nikhil Ingale on Aug 8, 2016
Latest reply on Aug 8, 2016 by Clive One

I have implemented simple USART polling and interrupt method.
// main function
          GPIOF->ODR ^= GPIO_Pin_10;


///simple USART polling function
void usartSendString(USART_TypeDef *USARTx,uint8_t *data,int32_t length)
     while(length > 0)
          while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);

When i send data using polling method, gpio high/low period is around 6ms and when i send it using interrupt method it's high/low period 150us.

send_data function sends the same number of bytes as sent in usartSendString() function .

why there is delay in polling method???