cancel
Showing results for 
Search instead for 
Did you mean: 

Break error interrupt in USART

Kaduru
Associate

Hello Team,

Now I am working on stm32mp133f MCU. 

I need to implement break error interrupt in USART.

My requirement is when we got 'NULL' data on  RX FIFO . it should generate break interrupt.

shall I get this  interrupt with frame error.

 

4 REPLIES 4
Billy OWEN
ST Employee

Hi @Kaduru 

 

The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.

 

Regards,

Billy

Andrew Neil
Evangelist III

@Kaduru wrote:

My requirement is when we got 'NULL' data on  RX FIFO . it should generate break interrupt.


Not quite sure what you mean by that - "receiving Null data" is quite distinct from detecting (or generating) a BREAK condition on the line

As per my understand break character is

A Break character is interpreted on receiving “0”s for a frame period. At the end of the
break frame, the transmitter inserts 2 stop bits.

Kaduru_0-1706595872882.png

Break character
When a break character is received, the USART handles it as a framing error.

FE: Framing error
This bit is set by hardware when a de-synchronization, excessive noise or a break character
is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register.
When transmitting data in Smartcard mode, this bit is set when the maximum number of
transmit attempts is reached without success (the card NACKs the data frame).
An interrupt is generated if EIE = 1 in the USART_CR3 register.
0: No Framing error is detected
1: Framing error or break character is detected.

How I can manage frame error or break error?


@Kaduru wrote:

A Break character (sic) is interpreted on receiving “0”s for a frame period. 


A Break condition isn't a character:

A Break condition violates the normal framing - as shown in the diagram, there is no Stop bit.

This is different from receiving a NUL character - which is a valid frame in which all the data bits are zero.