I tried to implement UART by using registers on Arduino mega. But i'm not getting any significant output. The same code works on Atmega 128 for some reason.
It's possible that the MEGA bootloader leaves USART0 partially configured.
Be sure to initialize ALL of the control registers; especially U2X0 in UCSR0A
(that also means you should use UCSRC = xxx and UCSR0B = yyy instead of the |= form (and UBRR0L too!))
I did so. The only result is that it is now able to print characters on the serial terminal.
My intention is to send hexadecimals. Is that possible ? I really can't see any error to be frank.