Programming: Enabling the Receive and Transmit for UART/USART
Share
The the TX and RX pins will be used for communication and not for the general purpose I/O that exists at those pins, then the TX and RX need to be enabled.
To enable the RX, the RXEN bit must be set in the USART Control and Status Register B (UCSRB). To enable the TX, the TXEN bit must be set in the UCSRB register. Example for Microcontrollers with more the one USART (USART 0): UCSR0B = (1 << RXEN0) | (1 << TXEN0); Example for Microcontrollers with only one USART: UCSRB = (1 << RXEN) | (1 << TXEN);