Komunikacja

USART1 0x40013800

12 rejestrów/klastrów w tym peryferium.

Rejestr: CR1  0x40013800
rw

Control register 1

Bit 31: RXFFIE31Bit 30: TXFEIEBit 29: FIFOENBit 28: M128Bit 27: EOBIEBit 26: RTOIEBit 25: DEATBit 24: DEAT24Bit 23: DEATBit 22: DEATBit 21: DEATBit 20: DEDT20Bit 19: DEDTBit 18: DEDTBit 17: DEDTBit 16: DEDT16Bit 15: OVER8Bit 14: CMIEBit 13: MMEBit 12: M012Bit 11: WAKEBit 10: PCEBit 9: PSBit 8: PEIE8Bit 7: TXEIEBit 6: TCIEBit 5: RXNEIEBit 4: IDLEIE4Bit 3: TEBit 2: REBit 1: UESMBit 0: UE0
BitSzer.PoleDostępOpis
01UE`rw`USART enable When this bit is cleared, the USART prescalers and outputs are stopped immediately, and all current operations are discarded. The USART configuration is kept, but all the USART_ISR status flags are reset. This bit is set and cleared by software. Note: To enter low-power mode without generating errors on the line, the TE bit must be previously reset and the software must wait for the TC bit in the USART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. In Smartcard mode, (SCEN = 1), the SCLK is always available when CLKEN = 1, regardless of the UE bit value.
11UESM`rw`USART enable in low-power mode When this bit is cleared, the USART cannot wake up the MCU from low-power mode. When this bit is set, the USART can wake up the MCU from low-power mode. This bit is set and cleared by software. Note: It is recommended to set the UESM bit just before entering low-power mode and clear it when exit from low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to .
21RE`rw`Receiver enable This bit enables the receiver. It is set and cleared by software.
31TE`rw`Transmitter enable This bit enables the transmitter. It is set and cleared by software. Note: During transmission, a low pulse on the TE bit ('0' followed by '1') sends a preamble (idle line) after the current word, except in Smartcard mode. In order to generate an idle character, the TE must not be immediately written to '1'. To ensure the required duration, the software can poll the TEACK bit in the USART_ISR register. In Smartcard mode, when TE is set, there is a 1 bit-time delay before the transmission starts.
41IDLEIE`rw`IDLE interrupt enable This bit is set and cleared by software.
51RXNEIE`rw`RXFIFO not empty interrupt enable This bit is set and cleared by software.
61TCIE`rw`Transmission complete interrupt enable This bit is set and cleared by software.
71TXEIE`rw`TXFIFO not full interrupt enable This bit is set and cleared by software.
81PEIE`rw`PE interrupt enable This bit is set and cleared by software.
91PS`rw`Parity selection This bit selects the odd or even parity when the parity generation/detection is enabled (PCE bit set). It is set and cleared by software. The parity is selected after the current byte. This bitfield can only be written when the USART is disabled (UE=0).
101PCE`rw`Parity control enable This bit selects the hardware parity control (generation and detection). When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if M=1; 8th bit if M=0) and the parity is checked on the received data. This bit is set and cleared by software. Once it is set, PCE is active after the current byte (in reception and in transmission). This bitfield can only be written when the USART is disabled (UE=0).
111WAKE`rw`Receiver wakeup method This bit determines the USART wakeup method from Mute mode. It is set or cleared by software. This bitfield can only be written when the USART is disabled (UE=0).
121M0`rw`Word length This bit is used in conjunction with bit 28 (M1) to determine the word length. It is set or cleared by software (refer to bit 28 (M1)description). This bit can only be written when the USART is disabled (UE=0).
131MME`rw`Mute mode enable This bit enables the USART Mute mode function. When set, the USART can switch between active and Mute mode, as defined by the WAKE bit. It is set and cleared by software.
141CMIE`rw`Character match interrupt enable This bit is set and cleared by software.
151OVER8`rw`Oversampling mode This bit can only be written when the USART is disabled (UE=0). Note: In LIN, IrDA and Smartcard modes, this bit must be kept cleared.
16–205DEDT`rw`Driver Enable deassertion time This 5-bit value defines the time between the end of the last stop bit, in a transmitted message, and the de-activation of the DE (Driver Enable) signal. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). If the USART_TDR register is written during the DEDT time, the new data is transmitted only when the DEDT and DEAT times have both elapsed. This bitfield can only be written when the USART is disabled (UE=0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to .
21–255DEAT`rw`Driver Enable assertion time This 5-bit value defines the time between the activation of the DE (Driver Enable) signal and the beginning of the start bit. It is expressed in sample time units (1/8 or 1/16 bit time, depending on the oversampling rate). This bitfield can only be written when the USART is disabled (UE=0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to .
261RTOIE`rw`Receiver timeout interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. .
271EOBIE`rw`End of Block interrupt enable This bit is set and cleared by software. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to .
281M1`rw`Word length This bit must be used in conjunction with bit 12 (M0) to determine the word length. It is set or cleared by software. M[1:0] = '00': 1 start bit, 8 Data bits, n Stop bit M[1:0] = '01': 1 start bit, 9 Data bits, n Stop bit M[1:0] = '10': 1 start bit, 7 Data bits, n Stop bit This bit can only be written when the USART is disabled (UE=0). Note: In 7-bits data length mode, the Smartcard mode, LIN master mode and Auto baud rate (0x7F and 0x55 frames detection) are not supported.
291FIFOEN`rw`FIFO mode enable This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UE=0). Note: FIFO mode can be used on standard UART communication, in SPI master/slave mode and in Smartcard modes only. It must not be enabled in IrDA and LIN modes.
301TXFEIE`rw`TXFIFO empty interrupt enable This bit is set and cleared by software.
311RXFFIE`rw`RXFIFO Full interrupt enable This bit is set and cleared by software.
Rejestr: CR2  0x40013804
rw

Control register 2

Bit 31: ADD31Bit 30: ADDBit 29: ADDBit 28: ADD28Bit 27: ADDBit 26: ADDBit 25: ADDBit 24: ADD24Bit 23: RTOENBit 22: ABRMODBit 21: ABRMODBit 20: ABREN20Bit 19: MSBFIRSTBit 18: DATAINVBit 17: TXINVBit 16: RXINV16Bit 15: SWAPBit 14: LINENBit 13: STOPBit 12: STOP12Bit 11: CLKENBit 10: CPOLBit 9: CPHABit 8: LBCL8Bit 7: zarezerwowanyBit 6: LBDIEBit 5: LBDLBit 4: ADDM74Bit 3: DIS_NSSBit 2: zarezerwowanyBit 1: zarezerwowanyBit 0: SLVEN0
BitSzer.PoleDostępOpis
01SLVEN`rw`Synchronous Slave mode enable When the SLVEN bit is set, the synchronous slave mode is enabled. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
31DIS_NSS`rw`When the DIS_NSS bit is set, the NSS pin input is ignored. Note: When SPI slave mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
41ADDM7`rw`7-bit Address Detection/4-bit Address Detection This bit is for selection between 4-bit address detection or 7-bit address detection. This bit can only be written when the USART is disabled (UE=0) Note: In 7-bit and 9-bit data modes, the address detection is done on 6-bit and 8-bit address (ADD[5:0] and ADD[7:0]) respectively.
51LBDL`rw`LIN break detection length This bit is for selection between 11 bit or 10 bit break detection. This bit can only be written when the USART is disabled (UE=0). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
61LBDIE`rw`LIN break detection interrupt enable Break interrupt mask (break detection using break delimiter). Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
81LBCL`rw`Last bit clock pulse This bit is used to select whether the clock pulse associated with the last data bit transmitted (MSB) has to be output on the SCLK pin in synchronous mode. The last bit is the 7th or 8th or 9th data bit transmitted depending on the 7 or 8 or 9 bit format selected by the M bit in the USART_CR1 register. This bit can only be written when the USART is disabled (UE=0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
91CPHA`rw`Clock phase This bit is used to select the phase of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPOL bit to produce the desired clock/data relationship (see and ) This bit can only be written when the USART is disabled (UE=0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
101CPOL`rw`Clock polarity This bit enables the user to select the polarity of the clock output on the SCLK pin in synchronous mode. It works in conjunction with the CPHA bit to produce the desired clock/data relationship This bit can only be written when the USART is disabled (UE=0). Note: If synchronous mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
111CLKEN`rw`Clock enable This bit enables the user to enable the SCLK pin. This bit can only be written when the USART is disabled (UE=0). Note: If neither synchronous mode nor Smartcard mode is supported, this bit is reserved and must be kept at reset value. Refer to . In Smartcard mode, in order to provide correctly the SCLK clock to the smartcard, the steps below must be respected: UE = 0 SCEN = 1 GTPR configuration CLKEN= 1 UE = 1
12–132STOP`rw`stop bits These bits are used for programming the stop bits. This bitfield can only be written when the USART is disabled (UE=0).
141LINEN`rw`LIN mode enable This bit is set and cleared by software. The LIN mode enables the capability to send LIN synchronous breaks (13 low bits) using the SBKRQ bit in the USART_CR1 register, and to detect LIN Sync breaks. This bitfield can only be written when the USART is disabled (UE=0). Note: If the USART does not support LIN mode, this bit is reserved and must be kept at reset value. Refer to .
151SWAP`rw`Swap TX/RX pins This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UE=0).
161RXINV`rw`RX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the RX line. This bitfield can only be written when the USART is disabled (UE=0).
171TXINV`rw`TX pin active level inversion This bit is set and cleared by software. This enables the use of an external inverter on the TX line. This bitfield can only be written when the USART is disabled (UE=0).
181DATAINV`rw`Binary data inversion This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UE=0).
191MSBFIRST`rw`Most significant bit first This bit is set and cleared by software. This bitfield can only be written when the USART is disabled (UE=0).
201ABREN`rw`Auto baud rate enable This bit is set and cleared by software. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to .
21–222ABRMOD`rw`Auto baud rate mode These bits are set and cleared by software. This bitfield can only be written when ABREN = 0 or the USART is disabled (UE=0). Note: If DATAINV=1 and/or MSBFIRST=1 the patterns must be the same on the line, for example 0xAA for MSBFIRST) If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to .
231RTOEN`rw`Receiver timeout enable This bit is set and cleared by software. When this feature is enabled, the RTOF flag in the USART_ISR register is set if the RX line is idle (no reception) for the duration programmed in the RTOR (receiver timeout register). Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. Refer to .
24–318ADD`rw`Address of the USART node ADD[7:4]: These bits give the address of the USART node or a character code to be recognized. They are used to wake up the MCU with 7-bit address mark detection in multiprocessor communication during Mute mode or low-power mode. The MSB of the character sent by the transmitter should be equal to 1. They can also be used for character detection during normal reception, Mute mode inactive (for example, end of block detection in ModBus protocol). In this case, the whole received character (8-bit) is compared to the ADD[7:0] value and CMF flag is set on match. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UE=0). ADD[3:0]: These bits give the address of the USART node or a character code to be recognized. They are used for wakeup with address mark detection, in multiprocessor communication during Mute mode or low-power mode. These bits can only be written when reception is disabled (RE = 0) or the USART is disabled (UE=0).
Rejestr: CR3  0x40013808
rw

Control register 3

Bit 31: TXFTCFG31Bit 30: TXFTCFGBit 29: TXFTCFGBit 28: RXFTIE28Bit 27: RXFTCFGBit 26: RXFTCFGBit 25: RXFTCFGBit 24: TCBGTIE24Bit 23: TXFTIEBit 22: WUFIEBit 21: WUSBit 20: WUS20Bit 19: SCARCNTBit 18: SCARCNTBit 17: SCARCNTBit 16: zarezerwowany16Bit 15: DEPBit 14: DEMBit 13: DDREBit 12: OVRDIS12Bit 11: ONEBITBit 10: CTSIEBit 9: CTSEBit 8: RTSE8Bit 7: DMATBit 6: DMARBit 5: SCENBit 4: NACK4Bit 3: HDSELBit 2: IRLPBit 1: IRENBit 0: EIE0
BitSzer.PoleDostępOpis
01EIE`rw`Error interrupt enable Error Interrupt Enable Bit is required to enable interrupt generation in case of a framing error, overrun error noise flag or SPI slave underrun error (FE=1 or ORE=1 or NE=1 or UDR = 1 in the USART_ISR register).
11IREN`rw`IrDA mode enable This bit is set and cleared by software. This bit can only be written when the USART is disabled (UE=0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
21IRLP`rw`IrDA low-power This bit is used for selecting between normal and low-power IrDA modes This bit can only be written when the USART is disabled (UE=0). Note: If IrDA mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
31HDSEL`rw`Half-duplex selection Selection of Single-wire Half-duplex mode This bit can only be written when the USART is disabled (UE=0).
41NACK`rw`Smartcard NACK enable This bitfield can only be written when the USART is disabled (UE=0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to .
51SCEN`rw`Smartcard mode enable This bit is used for enabling Smartcard mode. This bitfield can only be written when the USART is disabled (UE=0). Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to .
61DMAR`rw`DMA enable receiver This bit is set/reset by software
71DMAT`rw`DMA enable transmitter This bit is set/reset by software
81RTSE`rw`RTS enable This bit can only be written when the USART is disabled (UE=0). Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to .
91CTSE`rw`CTS enable This bit can only be written when the USART is disabled (UE=0) Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to .
101CTSIE`rw`CTS interrupt enable Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to .
111ONEBIT`rw`One sample bit method enable This bit enables the user to select the sample method. When the one sample bit method is selected the noise detection flag (NE) is disabled. This bit can only be written when the USART is disabled (UE=0).
121OVRDIS`rw`Overrun Disable This bit is used to disable the receive overrun detection. the ORE flag is not set and the new received data overwrites the previous content of the USART_RDR register. When FIFO mode is enabled, the RXFIFO is bypassed and data is written directly in USART_RDR register. Even when FIFO management is enabled, the RXNE flag is to be used. This bit can only be written when the USART is disabled (UE=0). Note: This control bit enables checking the communication flow w/o reading the data
131DDRE`rw`DMA Disable on Reception Error This bit can only be written when the USART is disabled (UE=0). Note: The reception errors are: parity error, framing error or noise error.
141DEM`rw`Driver enable mode This bit enables the user to activate the external transceiver control, through the DE signal. This bit can only be written when the USART is disabled (UE=0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. .
151DEP`rw`Driver enable polarity selection This bit can only be written when the USART is disabled (UE=0). Note: If the Driver Enable feature is not supported, this bit is reserved and must be kept at reset value. Refer to .
17–193SCARCNT`rw`Smartcard auto-retry count This bitfield specifies the number of retries for transmission and reception in Smartcard mode. In transmission mode, it specifies the number of automatic retransmission retries, before generating a transmission error (FE bit set). In reception mode, it specifies the number or erroneous reception trials, before generating a reception error (RXNE/RXFNE and PE bits set). This bitfield must be programmed only when the USART is disabled (UE=0). When the USART is enabled (UE=1), this bitfield may only be written to 0x0, in order to stop retransmission. Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
20–212WUS`rw`Wakeup from low-power mode interrupt flag selection This bitfield specifies the event which activates the WUF (Wakeup from low-power mode flag). This bitfield can only be written when the USART is disabled (UE=0). If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page835.
221WUFIE`rw`Wakeup from low-power mode interrupt enable This bit is set and cleared by software. Note: WUFIE must be set before entering in low-power mode. If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page835.
231TXFTIE`rw`TXFIFO threshold interrupt enable This bit is set and cleared by software.
241TCBGTIE`rw`Transmission Complete before guard time, interrupt enable This bit is set and cleared by software. Note: If the USART does not support the Smartcard mode, this bit is reserved and must be kept at reset value. Refer to .
25–273RXFTCFG`rw`Receive FIFO threshold configuration Remaining combinations: Reserved
281RXFTIE`rw`RXFIFO threshold interrupt enable This bit is set and cleared by software.
29–313TXFTCFG`rw`TXFIFO threshold configuration Remaining combinations: Reserved
Rejestr: BRR  0x4001380C
rw

Baud rate register

Bit 31: zarezerwowany31Bit 30: zarezerwowanyBit 29: zarezerwowanyBit 28: zarezerwowany28Bit 27: zarezerwowanyBit 26: zarezerwowanyBit 25: zarezerwowanyBit 24: zarezerwowany24Bit 23: zarezerwowanyBit 22: zarezerwowanyBit 21: zarezerwowanyBit 20: zarezerwowany20Bit 19: zarezerwowanyBit 18: zarezerwowanyBit 17: zarezerwowanyBit 16: zarezerwowany16Bit 15: BRRBit 14: BRRBit 13: BRRBit 12: BRR12Bit 11: BRRBit 10: BRRBit 9: BRRBit 8: BRR8Bit 7: BRRBit 6: BRRBit 5: BRRBit 4: BRR4Bit 3: BRRBit 2: BRRBit 1: BRRBit 0: BRR0
BitSzer.PoleDostępOpis
0–1516BRR`rw`USART baud rate
Rejestr: GTPR  0x40013810
rw

Guard time and prescaler register

Bit 31: zarezerwowany31Bit 30: zarezerwowanyBit 29: zarezerwowanyBit 28: zarezerwowany28Bit 27: zarezerwowanyBit 26: zarezerwowanyBit 25: zarezerwowanyBit 24: zarezerwowany24Bit 23: zarezerwowanyBit 22: zarezerwowanyBit 21: zarezerwowanyBit 20: zarezerwowany20Bit 19: zarezerwowanyBit 18: zarezerwowanyBit 17: zarezerwowanyBit 16: zarezerwowany16Bit 15: GTBit 14: GTBit 13: GTBit 12: GT12Bit 11: GTBit 10: GTBit 9: GTBit 8: GT8Bit 7: PSCBit 6: PSCBit 5: PSCBit 4: PSC4Bit 3: PSCBit 2: PSCBit 1: PSCBit 0: PSC0
BitSzer.PoleDostępOpis
0–78PSC`rw`Prescaler value In IrDA low-power and normal IrDA mode: PSC[7:0] = IrDA Normal and Low-Power baud rate PSC[7:0] is used to program the prescaler for dividing the USART source clock to achieve the low-power frequency: the source clock is divided by the value given in the register (8 significant bits): In Smartcard mode: PSC[4:0]=Prescaler value PSC[4:0] is used to program the prescaler for dividing the USART source clock to provide the Smartcard clock. The value given in the register (5 significant bits) is multiplied by 2 to give the division factor of the source clock frequency: ... 00100000: Divides the source clock by 32 (IrDA mode) ... 11111111: Divides the source clock by 255 (IrDA mode) This bitfield can only be written when the USART is disabled (UE=0). Note: Bits [7:5] must be kept cleared if Smartcard mode is used. This bitfield is reserved and forced by hardware to '0' when the Smartcard and IrDA modes are not supported. Refer to .
8–158GT`rw`Guard time value This bitfield is used to program the Guard time value in terms of number of baud clock periods. This is used in Smartcard mode. The Transmission Complete flag is set after this guard time value. This bitfield can only be written when the USART is disabled (UE=0). Note: If Smartcard mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
Rejestr: RTOR  0x40013814
rw

Receiver timeout register

Bit 31: BLEN:31Bit 30: BLEN:Bit 29: BLEN:Bit 28: BLEN:28Bit 27: BLEN:Bit 26: BLEN:Bit 25: BLEN:Bit 24: BLEN:24Bit 23: RTO:Bit 22: RTO:Bit 21: RTO:Bit 20: RTO:20Bit 19: RTO:Bit 18: RTO:Bit 17: RTO:Bit 16: RTO:16Bit 15: RTO:Bit 14: RTO:Bit 13: RTO:Bit 12: RTO:12Bit 11: RTO:Bit 10: RTO:Bit 9: RTO:Bit 8: RTO:8Bit 7: RTO:Bit 6: RTO:Bit 5: RTO:Bit 4: RTO:4Bit 3: RTO:Bit 2: RTO:Bit 1: RTO:Bit 0: RTO:0
BitSzer.PoleDostępOpis
0–2324RTO:Receiver timeout value
24–318BLEN:Block Length
Rejestr: RQR  0x40013818
wo

Request register

Bit 31: zarezerwowany31Bit 30: zarezerwowanyBit 29: zarezerwowanyBit 28: zarezerwowany28Bit 27: zarezerwowanyBit 26: zarezerwowanyBit 25: zarezerwowanyBit 24: zarezerwowany24Bit 23: zarezerwowanyBit 22: zarezerwowanyBit 21: zarezerwowanyBit 20: zarezerwowany20Bit 19: zarezerwowanyBit 18: zarezerwowanyBit 17: zarezerwowanyBit 16: zarezerwowany16Bit 15: zarezerwowanyBit 14: zarezerwowanyBit 13: zarezerwowanyBit 12: zarezerwowany12Bit 11: zarezerwowanyBit 10: zarezerwowanyBit 9: zarezerwowanyBit 8: zarezerwowany8Bit 7: zarezerwowanyBit 6: zarezerwowanyBit 5: zarezerwowanyBit 4: TXFRQ4Bit 3: RXFRQBit 2: MMRQBit 1: SBKRQBit 0: ABRRQ0
BitSzer.PoleDostępOpis
01ABRRQ`wo`Auto baud rate request Writing 1 to this bit resets the ABRF flag in the USART_ISR and requests an automatic baud rate measurement on the next received data frame. Note: If the USART does not support the auto baud rate feature, this bit is reserved and must be kept at reset value. Refer to .
11SBKRQ`wo`Send break request Writing 1 to this bit sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available. Note: When the application needs to send the break character following all previously inserted data, including the ones not yet transmitted, the software should wait for the TXE flag assertion before setting the SBKRQ bit.
21MMRQ`wo`Mute mode request Writing 1 to this bit puts the USART in Mute mode and resets the RWU flag.
31RXFRQ`wo`Receive data flush request Writing 1 to this bit empties the entire receive FIFO i.e. clears the bit RXFNE. This enables to discard the received data without reading them, and avoid an overrun condition.
41TXFRQ`wo`Transmit data flush request When FIFO mode is disabled, writing '1' to this bit sets the TXE flag. This enables to discard the transmit data. This bit must be used only in Smartcard mode, when data have not been sent due to errors (NACK) and the FE flag is active in the USART_ISR register. If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. When FIFO is enabled, TXFRQ bit is set to flush the whole FIFO. This sets the TXFE flag (Transmit FIFO empty, bit 23 in the USART_ISR register). Flushing the Transmit FIFO is supported in both UART and Smartcard modes. Note: In FIFO mode, the TXFNF flag is reset during the flush request until TxFIFO is empty in order to ensure that no data are written in the data register.
Rejestr: ISR  0x4001381C
ro

Interrupt & status register

Bit 31: zarezerwowany31Bit 30: zarezerwowanyBit 29: zarezerwowanyBit 28: zarezerwowany28Bit 27: TXFTBit 26: RXFTBit 25: TCBGTBit 24: RXFF24Bit 23: TXFEBit 22: REACKBit 21: TEACKBit 20: WUF20Bit 19: RWUBit 18: SBKFBit 17: CMFBit 16: BUSY16Bit 15: ABRFBit 14: ABREBit 13: UDRBit 12: EOBF12Bit 11: RTOFBit 10: CTSBit 9: CTSIFBit 8: LBDF8Bit 7: TXFNFBit 6: TCBit 5: RXFNEBit 4: IDLE4Bit 3: OREBit 2: NEBit 1: FEBit 0: PE0
BitSzer.PoleDostępOpis
01PE`ro`Parity error This bit is set by hardware when a parity error occurs in receiver mode. It is cleared by software, writing 1 to the PECF in the USART_ICR register. An interrupt is generated if PEIE = 1 in the USART_CR1 register. Note: This error is associated with the character in the USART_RDR.
11FE`ro`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_CR1 register. Note: This error is associated with the character in the USART_RDR.
21NE`ro`Noise detection flag This bit is set by hardware when noise is detected on a received frame. It is cleared by software, writing 1 to the NECF bit in the USART_ICR register. Note: This bit does not generate an interrupt as it appears at the same time as the RXFNE bit which itself generates an interrupt. An interrupt is generated when the NE flag is set during multi buffer communication if the EIE bit is set. When the line is noise-free, the NE flag can be disabled by programming the ONEBIT bit to 1 to increase the USART tolerance to deviations (Refer to Tolerance of the USART receiver to clock deviation on page861). This error is associated with the character in the USART_RDR.
31ORE`ro`Overrun error This bit is set by hardware when the data currently being received in the shift register is ready to be transferred into the USART_RDR register while RXFF = 1. It is cleared by a software, writing 1 to the ORECF, in the USART_ICR register. An interrupt is generated if RXFNEIE=1 or EIE = 1 in the USART_CR1 register. Note: When this bit is set, the USART_RDR register content is not lost but the shift register is overwritten. An interrupt is generated if the ORE flag is set during multi buffer communication if the EIE bit is set. This bit is permanently forced to 0 (no overrun detection) when the bit OVRDIS is set in the USART_CR3 register.
41IDLE`ro`Idle line detected This bit is set by hardware when an Idle Line is detected. An interrupt is generated if IDLEIE=1 in the USART_CR1 register. It is cleared by software, writing 1 to the IDLECF in the USART_ICR register. Note: The IDLE bit is not set again until the RXFNE bit has been set (i.e. a new idle line occurs). If Mute mode is enabled (MME=1), IDLE is set if the USART is not mute (RWU=0), whatever the Mute mode selected by the WAKE bit. If RWU=1, IDLE is not set.
51RXFNE`ro`RXFIFO not empty RXFNE bit is set by hardware when the RXFIFO is not empty, meaning that data can be read from the USART_RDR register. Every read operation from the USART_RDR frees a location in the RXFIFO. RXFNE is cleared when the RXFIFO is empty. The RXFNE flag can also be cleared by writing 1 to the RXFRQ in the USART_RQR register. An interrupt is generated if RXFNEIE=1 in the USART_CR1 register.
61TC`ro`Transmission complete This bit indicates that the last data written in the USART_TDR has been transmitted out of the shift register. It is set by hardware when the transmission of a frame containing data is complete and when TXFE is set. An interrupt is generated if TCIE=1 in the USART_CR1 register. TC bit is is cleared by software, by writing 1 to the TCCF in the USART_ICR register or by a write to the USART_TDR register. Note: If TE bit is reset and no transmission is on going, the TC bit is immediately set.
71TXFNF`ro`TXFIFO not full TXFNF is set by hardware when TXFIFO is not full meaning that data can be written in the USART_TDR. Every write operation to the USART_TDR places the data in the TXFIFO. This flag remains set until the TXFIFO is full. When the TXFIFO is full, this flag is cleared indicating that data can not be written into the USART_TDR. An interrupt is generated if the TXFNFIE bit =1 in the USART_CR1 register. Note: The TXFNF is kept reset during the flush request until TXFIFO is empty. After sending the flush request (by setting TXFRQ bit), the flag TXFNF should be checked prior to writing in TXFIFO (TXFNF and TXFE are set at the same time). This bit is used during single buffer transmission.
81LBDF`ro`LIN break detection flag This bit is set by hardware when the LIN break is detected. It is cleared by software, by writing 1 to the LBDCF in the USART_ICR. An interrupt is generated if LBDIE = 1 in the USART_CR2 register. Note: If the USART does not support LIN mode, this bit is reserved and kept at reset value. Refer to .
91CTSIF`ro`CTS interrupt flag This bit is set by hardware when the nCTS input toggles, if the CTSE bit is set. It is cleared by software, by writing 1 to the CTSCF bit in the USART_ICR register. An interrupt is generated if CTSIE=1 in the USART_CR3 register. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value.
101CTS`ro`CTS flag This bit is set/reset by hardware. It is an inverted copy of the status of the nCTS input pin. Note: If the hardware flow control feature is not supported, this bit is reserved and kept at reset value.
111RTOF`ro`Receiver timeout This bit is set by hardware when the timeout value, programmed in the RTOR register has lapsed, without any communication. It is cleared by software, writing 1 to the RTOCF bit in the USART_ICR register. An interrupt is generated if RTOIE=1 in the USART_CR2 register. In Smartcard mode, the timeout corresponds to the CWT or BWT timings. Note: If a time equal to the value programmed in RTOR register separates 2 characters, RTOF is not set. If this time exceeds this value + 2 sample times (2/16 or 2/8, depending on the oversampling method), RTOF flag is set. The counter counts even if RE = 0 but RTOF is set only when RE = 1. If the timeout has already elapsed when RE is set, then RTOF is set. If the USART does not support the Receiver timeout feature, this bit is reserved and kept at reset value.
121EOBF`ro`End of block flag This bit is set by hardware when a complete block has been received (for example T=1 Smartcard mode). The detection is done when the number of received bytes (from the start of the block, including the prologue) is equal or greater than BLEN + 4. An interrupt is generated if the EOBIE=1 in the USART_CR2 register. It is cleared by software, writing 1 to the EOBCF in the USART_ICR register. Note: If Smartcard mode is not supported, this bit is reserved and kept at reset value. Refer to .
131UDR`ro`SPI slave underrun error flag In slave transmission mode, this flag is set when the first clock pulse for data transmission appears while the software has not yet loaded any value into USART_TDR. This flag is reset by setting UDRCF bit in the USART_ICR register. Note: If the USART does not support the SPI slave mode, this bit is reserved and kept at reset value. Refer to .
141ABRE`ro`Auto baud rate error This bit is set by hardware if the baud rate measurement failed (baud rate out of range or character comparison failed) It is cleared by software, by writing 1 to the ABRRQ bit in the USART_CR3 register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value.
151ABRF`ro`Auto baud rate flag This bit is set by hardware when the automatic baud rate has been set (RXFNE is also set, generating an interrupt if RXFNEIE = 1) or when the auto baud rate operation was completed without success (ABRE=1) (ABRE, RXFNE and FE are also set in this case) It is cleared by software, in order to request a new auto baud rate detection, by writing 1 to the ABRRQ in the USART_RQR register. Note: If the USART does not support the auto baud rate feature, this bit is reserved and kept at reset value.
161BUSY`ro`Busy flag This bit is set and reset by hardware. It is active when a communication is ongoing on the RX line (successful start bit detected). It is reset at the end of the reception (successful or not).
171CMF`ro`Character match flag This bit is set by hardware, when a the character defined by ADD[7:0] is received. It is cleared by software, writing 1 to the CMCF in the USART_ICR register. An interrupt is generated if CMIE=1in the USART_CR1 register.
181SBKF`ro`Send break flag This bit indicates that a send break character was requested. It is set by software, by writing 1 to the SBKRQ bit in the USART_CR3 register. It is automatically reset by hardware during the stop bit of break transmission.
191RWU`ro`Receiver wakeup from Mute mode This bit indicates if the USART is in Mute mode. It is cleared/set by hardware when a wakeup/mute sequence is recognized. The Mute mode control sequence (address or IDLE) is selected by the WAKE bit in the USART_CR1 register. When wakeup on IDLE mode is selected, this bit can only be set by software, writing 1 to the MMRQ bit in the USART_RQR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to .
201WUF`ro`Wakeup from low-power mode flag This bit is set by hardware, when a wakeup event is detected. The event is defined by the WUS bitfield. It is cleared by software, writing a 1 to the WUCF in the USART_ICR register. An interrupt is generated if WUFIE=1 in the USART_CR3 register. Note: When UESM is cleared, WUF flag is also cleared. If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to .
211TEACK`ro`Transmit enable acknowledge flag This bit is set/reset by hardware, when the Transmit Enable value is taken into account by the USART. It can be used when an idle frame request is generated by writing TE=0, followed by TE=1 in the USART_CR1 register, in order to respect the TE=0 minimum period.
221REACK`ro`Receive enable acknowledge flag This bit is set/reset by hardware, when the Receive Enable value is taken into account by the USART. It can be used to verify that the USART is ready for reception before entering low-power mode. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and kept at reset value. Refer to .
231TXFE`ro`TXFIFO empty This bit is set by hardware when TXFIFO is empty. When the TXFIFO contains at least one data, this flag is cleared. The TXFE flag can also be set by writing 1 to the bit TXFRQ (bit 4) in the USART_RQR register. An interrupt is generated if the TXFEIE bit =1 (bit 30) in the USART_CR1 register.
241RXFF`ro`RXFIFO full This bit is set by hardware when the number of received data corresponds to RXFIFOsize+1 (RXFIFO full + 1 data in the USART_RDR register. An interrupt is generated if the RXFFIE bit =1 in the USART_CR1 register.
251TCBGT`ro`Transmission complete before guard time flag This bit is set when the last data written in the USART_TDR has been transmitted correctly out of the shift register. It is set by hardware in Smartcard mode, if the transmission of a frame containing data is complete and if the smartcard did not send back any NACK. An interrupt is generated if TCBGTIE=1 in the USART_CR3 register. This bit is cleared by software, by writing 1 to the TCBGTCF in the USART_ICR register or by a write to the USART_TDR register. Note: If the USART does not support the Smartcard mode, this bit is reserved and kept at reset value. If the USART supports the Smartcard mode and the Smartcard mode is enabled, the TCBGT reset value is '1'. Refer to on page835.
261RXFT`ro`RXFIFO threshold flag This bit is set by hardware when the threshold programmed in RXFTCFG in USART_CR3 register is reached. This means that there are (RXFTCFG - 1) data in the Receive FIFO and one data in the USART_RDR register. An interrupt is generated if the RXFTIE bit =1 (bit 27) in the USART_CR3 register. Note: When the RXFTCFG threshold is configured to '101', RXFT flag is set if 16 data are available i.e. 15 data in the RXFIFO and 1 data in the USART_RDR. Consequently, the 17th received data does not cause an overrun error. The overrun error occurs after receiving the 18th data.
271TXFT`ro`TXFIFO threshold flag This bit is set by hardware when the TXFIFO reaches the threshold programmed in TXFTCFG of USART_CR3 register i.e. the TXFIFO contains TXFTCFG empty locations. An interrupt is generated if the TXFTIE bit =1 (bit 31) in the USART_CR3 register.
Rejestr: ICR  0x40013820
wo

Interrupt flag clear register

Bit 31: zarezerwowany31Bit 30: zarezerwowanyBit 29: zarezerwowanyBit 28: zarezerwowany28Bit 27: zarezerwowanyBit 26: zarezerwowanyBit 25: zarezerwowanyBit 24: zarezerwowany24Bit 23: zarezerwowanyBit 22: zarezerwowanyBit 21: zarezerwowanyBit 20: WUCF20Bit 19: zarezerwowanyBit 18: zarezerwowanyBit 17: CMCFBit 16: zarezerwowany16Bit 15: zarezerwowanyBit 14: zarezerwowanyBit 13: UDRCFBit 12: EOBCF12Bit 11: RTOCFBit 10: zarezerwowanyBit 9: CTSCFBit 8: LBDCF8Bit 7: TCBGTCFBit 6: TCCFBit 5: TXFECFBit 4: IDLECF4Bit 3: ORECFBit 2: NECFBit 1: FECFBit 0: PECF0
BitSzer.PoleDostępOpis
01PECF`wo`Parity error clear flag Writing 1 to this bit clears the PE flag in the USART_ISR register.
11FECF`wo`Framing error clear flag Writing 1 to this bit clears the FE flag in the USART_ISR register.
21NECF`wo`Noise detected clear flag Writing 1 to this bit clears the NE flag in the USART_ISR register.
31ORECF`wo`Overrun error clear flag Writing 1 to this bit clears the ORE flag in the USART_ISR register.
41IDLECF`wo`Idle line detected clear flag Writing 1 to this bit clears the IDLE flag in the USART_ISR register.
51TXFECF`wo`TXFIFO empty clear flag Writing 1 to this bit clears the TXFE flag in the USART_ISR register.
61TCCF`wo`Transmission complete clear flag Writing 1 to this bit clears the TC flag in the USART_ISR register.
71TCBGTCF`wo`Transmission complete before Guard time clear flag Writing 1 to this bit clears the TCBGT flag in the USART_ISR register.
81LBDCF`wo`LIN break detection clear flag Writing 1 to this bit clears the LBDF flag in the USART_ISR register. Note: If LIN mode is not supported, this bit is reserved and must be kept at reset value. Refer to .
91CTSCF`wo`CTS clear flag Writing 1 to this bit clears the CTSIF flag in the USART_ISR register. Note: If the hardware flow control feature is not supported, this bit is reserved and must be kept at reset value. Refer to .
111RTOCF`wo`Receiver timeout clear flag Writing 1 to this bit clears the RTOF flag in the USART_ISR register. Note: If the USART does not support the Receiver timeout feature, this bit is reserved and must be kept at reset value. Refer to page835.
121EOBCF`wo`End of block clear flag Writing 1 to this bit clears the EOBF flag in the USART_ISR register. Note: If the USART does not support Smartcard mode, this bit is reserved and must be kept at reset value. Refer to .
131UDRCF`wo`SPI slave underrun clear flag Writing 1 to this bit clears the UDRF flag in the USART_ISR register. Note: If the USART does not support SPI slave mode, this bit is reserved and must be kept at reset value. Refer to
171CMCF`wo`Character match clear flag Writing 1 to this bit clears the CMF flag in the USART_ISR register.
201WUCF`wo`Wakeup from low-power mode clear flag Writing 1 to this bit clears the WUF flag in the USART_ISR register. Note: If the USART does not support the wakeup from Stop feature, this bit is reserved and must be kept at reset value. Refer to page835.
Rejestr: RDR  0x40013824
ro

Receive data register

Bit 31: zarezerwowany31Bit 30: zarezerwowanyBit 29: zarezerwowanyBit 28: zarezerwowany28Bit 27: zarezerwowanyBit 26: zarezerwowanyBit 25: zarezerwowanyBit 24: zarezerwowany24Bit 23: zarezerwowanyBit 22: zarezerwowanyBit 21: zarezerwowanyBit 20: zarezerwowany20Bit 19: zarezerwowanyBit 18: zarezerwowanyBit 17: zarezerwowanyBit 16: zarezerwowany16Bit 15: zarezerwowanyBit 14: zarezerwowanyBit 13: zarezerwowanyBit 12: zarezerwowany12Bit 11: zarezerwowanyBit 10: zarezerwowanyBit 9: zarezerwowanyBit 8: RDR:8Bit 7: RDR:Bit 6: RDR:Bit 5: RDR:Bit 4: RDR:4Bit 3: RDR:Bit 2: RDR:Bit 1: RDR:Bit 0: RDR:0
BitSzer.PoleDostępOpis
0–89RDR:Receive data value
Rejestr: TDR  0x40013828
rw

Transmit data register

Bit 31: zarezerwowany31Bit 30: zarezerwowanyBit 29: zarezerwowanyBit 28: zarezerwowany28Bit 27: zarezerwowanyBit 26: zarezerwowanyBit 25: zarezerwowanyBit 24: zarezerwowany24Bit 23: zarezerwowanyBit 22: zarezerwowanyBit 21: zarezerwowanyBit 20: zarezerwowany20Bit 19: zarezerwowanyBit 18: zarezerwowanyBit 17: zarezerwowanyBit 16: zarezerwowany16Bit 15: zarezerwowanyBit 14: zarezerwowanyBit 13: zarezerwowanyBit 12: zarezerwowany12Bit 11: zarezerwowanyBit 10: zarezerwowanyBit 9: zarezerwowanyBit 8: TDR:8Bit 7: TDR:Bit 6: TDR:Bit 5: TDR:Bit 4: TDR:4Bit 3: TDR:Bit 2: TDR:Bit 1: TDR:Bit 0: TDR:0
BitSzer.PoleDostępOpis
0–89TDR:Transmit data value
Rejestr: PRESC  0x4001382C
rw

Prescaler register

Bit 31: zarezerwowany31Bit 30: zarezerwowanyBit 29: zarezerwowanyBit 28: zarezerwowany28Bit 27: zarezerwowanyBit 26: zarezerwowanyBit 25: zarezerwowanyBit 24: zarezerwowany24Bit 23: zarezerwowanyBit 22: zarezerwowanyBit 21: zarezerwowanyBit 20: zarezerwowany20Bit 19: zarezerwowanyBit 18: zarezerwowanyBit 17: zarezerwowanyBit 16: zarezerwowany16Bit 15: zarezerwowanyBit 14: zarezerwowanyBit 13: zarezerwowanyBit 12: zarezerwowany12Bit 11: zarezerwowanyBit 10: zarezerwowanyBit 9: zarezerwowanyBit 8: zarezerwowany8Bit 7: zarezerwowanyBit 6: zarezerwowanyBit 5: zarezerwowanyBit 4: zarezerwowany4Bit 3: PRESCALERBit 2: PRESCALERBit 1: PRESCALERBit 0: PRESCALER0
BitSzer.PoleDostępOpis
0–34PRESCALER`rw`Clock prescaler The USART input clock can be divided by a prescaler factor: Remaining combinations: Reserved Note: When PRESCALER is programmed with a value different of the allowed ones, programmed prescaler value is 1011 i.e. input clock divided by 256.