The stop bits are at the end of the data frame and signal the end of the that frame for the receiver.
Setting for stop bits, use the USBS (UART Stop Bit Select) in the UCSRC (UART/USART Control and Status Register C)
UCSRC |= (1 << USBS); //Sets 2 stop bits
UCSRC &= ~(1 << USBS); //clears the USBS for 1 stop bit, only needed if the bit was already set
To set the number of data bit to use, the UCSZ0-2 (Character Size Bits) in the UCSRC register.
Example:
//Set data bit length is 8-bit
UCSR0C |= (3 << UCSZ00);
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.