16 lines
432 B
NASM
16 lines
432 B
NASM
; set baud rate
|
|
ldi i, 0x0C ;
|
|
; 16MHZ 20MHZ 24MHz
|
|
ldi j, 0x00 ; 115200 xxxx 000A 000C
|
|
sts UBRR0H, j ; 19200 0033 0040 004D
|
|
sts UBRR0L, i ; 9600 0067 0081 009B
|
|
; 4800 00CF 0103 0137
|
|
; 2400 019F 0208 0270
|
|
|
|
; Enable receiver and transmitter
|
|
ldi i, (1<<RXEN0)|(1<<TXEN0)
|
|
sts UCSR0B, i
|
|
|
|
; Set frame format: 8data, 1stop bit
|
|
ldi i, (3<<UCSZ00)
|
|
sts UCSR0C, i |