Programming the UART for 9 bits

Need to program the uart for 9 bits. with the ability to set the bit 9 to a 1 for an address byte to an external device. and then set it to 0 for data bytes.

Need to program the uart for 9 bits. with the ability to set the bit 9 to a 1 for an address byte to an external device. and then set it to 0 for data bytes.

You're not the first. Do some searching.

The latest IDEs support different formats.

Just not 9 bits.
You will have to do some digging for that, see section 20 of the datasheet:

20.6.2 Sending Frames with 9 Data Bit
If 9-bit characters are used (UCSZn = 7), the ninth bit must be written to the TXB8 bit in UCSRnB before the low
byte of the character is written to UDRn. The following code examples show a transmit function that handles 9-bit
characters. For the assembly code, the data to be sent is assumed to be stored in registers R17:R16.
(see C Code example in the datasheet)

20.7.2 Receiving Frames with 9 Data Bits
If 9-bit characters are used (UCSZn=7) the ninth bit must be read from the RXB8n bit in UCSRnB before reading
the low bits from the UDRn. This rule applies to the FEn, DORn and UPEn Status Flags as well. Read status from
UCSRnA, then data from UDRn. Reading the UDRn I/O location will change the state of the receive buffer FIFO
and consequently the TXB8n, FEn, DORn and UPEn bits, which all are stored in the FIFO, will change.
The following code example shows a simple USART receive function that handles both nine bit characters and the
status bits.
(see C Code example in the datasheet)

i guess their are so many things need to be settled before you can use 9 bits. how about using 2 bytes ? the first byte will handle your config/settings and the second one will handle your address/ data.