Cannot run the uart on the Atmega128. For a week now trying to solve this issue.
Maybe speed error or configuration bits?
The code of the program and the schematic are below.
.equ XTAL_CPU = 8000000 ; CPU (4MHz)
.equ baudrate = 9600
.equ bauddivider = XTAL_CPU/(16*baudrate)-1
ldi r16,low(ramend) ;RAM
;initialize device USART0
ldi r17,high(bauddivider) ;9600
sts UBRR0L,r17 ; baud rate UBRRL:UBRRH
ldi r16, 0b00011000 ;ON RX/TX
ldi r16, 0b00000110 ; async mode,parity off,1stop bit,8data
sts UDR0,r18 ;out UART