UART sending BREAK condition on ATmega128

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd like to know if there is a recommended way to send a BREAK condition on UART0 or UART1 in the ATmega128. Some UARTS on other processors implement this as a bit in one of the UART control registers.

My initial thought is to disable the transmitter, pull the TxD pin low for the required time, take it high again and re-enable the transmitter.

There may or may not be other ways; that is why I'm asking.

We never have time to do it right,
but we always have time to do it over

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

My initial thought is to disable the transmitter, pull the TxD pin low for the required time, take it high again and re-enable the transmitter.

I'm pretty sure that IS the way folks do it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can change uart's baudrate to lower value and send 0x00 byte. (e.g. 0x00 byte transmitted with baud=57600 is break condition for baud=115200)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dusza wrote:
You can change uart's baudrate to lower value and send 0x00 byte. (e.g. 0x00 byte transmitted with baud=57600 is break condition for baud=115200)

That is a clever alternative. I will be trying both methods. Thanks to both of you.

We never have time to do it right,
but we always have time to do it over

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought it might be useful to post the code snipet I came up with for sending a BREAK condition on USART1 on an ATmega128L. I chose the method of disabling the transmitter and pulling the TxD line low instead of changing the Baudrate and sending nulls.

Attachment(s): 

We never have time to do it right,
but we always have time to do it over