UART is acting weird
The ! operator in C is a logical operator and it produces a result which is either true (1) or false (0).

You seem to be looking for the bitwise NOT operator which is ~, not !

The result of !(0b0011111) is simply 0 (or 0b0000000 or 0x00 or however you want to represent it), while the result of ~(0b00111111) is 0b11000000.

Even if you correct this, you still have code which appears to 'contradict' itself.
You have LCR |= (0b11); which sets the least-significant 2 bits of your LCR register, and then on the next line you have LCR &amp;= !(0b0011111); (and I'm assuming you meant ~ and not !) which immediately clears those 2 bits.