...
{$DEFINE UART_UCSRA := 0x86}
{$DEFINE UART_UCSRB := 0x85 }
{$DEFINE UART_UCSRC := 0x84 }
{$DEFINE UART_UBRRL := 0x81 }
{$DEFINE UART_UBRRH := 0x82 }
{$DEFINE UART_UDR := 0x80}
...
Some remarks to this:
1) I'm not sure whether "0x86" etc. works correctly. On my system it's not allowed. I would use "$86" instead.
2) FPC has already a file which contains those constants which you IMHO should use:
...
// USART
var
UDR : byte absolute $00+$2C; // USART I/O Data Register
UCSRA : byte absolute $00+$2B; // USART Control and Status Register A
UCSRB : byte absolute $00+$2A; // USART Control and Status Register B
UCSRC : byte absolute $00+$40; // USART Control and Status Register C
UBRRH : byte absolute $00+$40; // USART Baud Rate Register Hight Byte
UBRRL : byte absolute $00+$29; // USART Baud Rate Register Low Byte
...
On my system this file is located in <installdir>/fpcsrc/rtl/embedded/avr/atmega16.pp and is automaticly included, when you have correctly selected ATMega16A CPU.
3) You see, that your values do not correspond with above file atmega16.pp. A difference of $20 may be correct, depending on how you adress these ports:
When using the I/O specific commands IN and OUT, the I/O addresses $00 - $3F must be used. When addressing I/O Registers as data space using LD and ST instructions, $20 must be added to these addresses => use $20 - $5F.
From page 19 of my Link in reply #13.