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);
Comments and Additional Information
Have some code to share? Or additional information? Respond here:
You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.