avr - atmega8 UART- doesn't show character in realterm [Solved] -
Hi I'm new to this and should help me It seems that instead of just showing 's' in reality What is the 'empty' problem? Can this be a registration? Or code itself?
#include & lt; Avr / io.h & gt; # Include & lt; Use / delay.h & gt; Zero UART_Init (unsigned int ubrr) {UBRRH = (unsigned integer) (ubrr & gt; & gt; 8); UBRRL = (unsigned int) ubrr; UCSRA = 0x00; UCSRB = (1 & lt; TXEN) | (1 The speed is 9600 baud on the host running with 14745600 Hz on System xtal. All settings should be 8 N1.
You need to set ursel while typing in the UCSRC register.
Change
UCSRC = (0 to
UCSRC = (1 The UBRRH register shares the same I / O location as the UCRC register. Therefore, there should be some special consideration when accessing this I / O location. When a written access to this I / O location, then the high bit of written value, the USART Register Register (URSELL) bit, one of the two registers which will be written in control. If url is zero during writing, then the UBRRH value will be updated. If URSEL is one, then UCSRC settings will be updated.
The rest of the code seems fine to me.
Comments
Post a Comment