fixed a problem with m8515 UART.
UBRRH and UCSRC share the same io register location, bit URSEL needs to be set in order to access UCSRC!!
This commit is contained in:
@@ -37,8 +37,13 @@ ioRawInit:
|
||||
M_IO_WRITE UART_REG_UBRRL, r16
|
||||
|
||||
; set character format (asynchronous USART, 8-bit, one stop bit, no parity)
|
||||
ldi r16, (1<<UART_BIT_UCSZ0) | (1<<UART_BIT_UCSZ1)
|
||||
sts UART_REG_UCSRC, r16
|
||||
.ifdef URSEL
|
||||
ldi r16, (1<<URSEL) | (1<<UART_BIT_USBS) | (3<<UART_BIT_UCSZ0)
|
||||
.else
|
||||
ldi r16, (1<<UART_BIT_USBS)|(3<<UART_BIT_UCSZ0)
|
||||
.endif
|
||||
; ldi r16, (1<<UART_BIT_UCSZ0) | (1<<UART_BIT_UCSZ1)
|
||||
M_IO_WRITE UART_REG_UCSRC, r16
|
||||
|
||||
cbi COM_ATTN_DDR, COM_ATTN_PIN ; set ATTN port as input
|
||||
|
||||
|
||||
Reference in New Issue
Block a user