AnsweredAssumed Answered

usart hangs when nothing connected

Question asked by mccarty.michael on Apr 14, 2013
Latest reply on Apr 19, 2013 by mccarty.michael
If I dont have anything on the usart port then it hangs when sending data. I have a "debug" usart output that I only want to use sometimes. But if I dont have anything connected then it will sit and hang here 


PUTCHAR_PROTOTYPE
{
  /* Place your implementation of fputc here */
  /* e.g. write a character to the USART */
  USART_SendData(Debug_USART, (uint8_t) ch);


  /* Loop until the end of transmission */
  while (USART_GetFlagStatus(Debug_USART, USART_FLAG_TC) == RESET)
  {}


  return ch;
}


which makes sense because its trying to send data but is never able to. 


Guess the best way around this is to have a switch to turn debug on or off, but it would be bad if a user hits that switch and then their unit never starts. 

Outcomes