Can someone give me a pertinent explanation why AVR designers choose to clear important flags by writing 1 to them?
I faced recently a situation, trying to port some well good circular buffer serial port implementation to ATMega (from PIC24):
at transmit side, the natural way was to use UDRE vector but it's flag is read-only and default 1 at POR, so if enabled by UDRIE, you'll get stuck in tx interrupt. TXC is useless in this situation, will be 0 and become 1 just AFTER one byte was really serialized.
The only way was to manipulate UDRE by it's mask, enabling in putch() method and disabling in ISR vector, once no more chars to be sent. But disabling interrupts it's not a elegant way...