12.07.2015 Views

ATmega32A Datasheet - Sunrom Technologies

ATmega32A Datasheet - Sunrom Technologies

ATmega32A Datasheet - Sunrom Technologies

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ATmega32A</strong>The PE bit is set if the next character that can be read from the receive buffer had a parity errorwhen received and the parity checking was enabled at that point (UPM1 = 1). This bit is validuntil the receive buffer (UDR) is read.19.7.6 Disabling the ReceiverIn contrast to the Transmitter, disabling of the Receiver will be immediate. Data from ongoingreceptions will therefore be lost. When disabled (that is, the RXEN is set to zero) the Receiverwill no longer override the normal function of the RxD port pin. The receiver buffer FIFO will beflushed when the receiver is disabled. Remaining data in the buffer will be lost.19.7.7 Flushing the Receive BufferThe receiver buffer FIFO will be flushed when the Receiver is disabled, that is, the buffer will beemptied of its contents. Unread data will be lost. If the buffer has to be flushed during normaloperation, due to for instance an error condition, read the UDR I/O location until the RXC Flag iscleared. The following code example shows how to flush the receive buffer.Assembly Code Example (1)USART_Flush:sbis UCSRA, RXCretin r16, UDRrjmp USART_FlushC Code Example (1)void USART_Flush( void ){unsigned char dummy;while ( UCSRA & (1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!