The program uses six USART registers: UCSR0A, UCSR0B, UCSR0C, UBRR0H, UBRR0L. UCSR0A is used to check for the transmit buffer's status: busy or empty. UCSR0B is used to enable or disable the receiver and transmitter; in this case, it was enabled. UCSR0C is used to configure the 8 bit data format. UBRR0H and UBRR0L are used to set the baud rate for the high and low bits of UBRR0 - the USART baud rate register. In addition to registers, variables are also utilized in the code. The variable ‘userString[]’ is an array that is used to store the string that will be transmitted. The variable following it,’strSize’ stores the number of characters in the array ‘userString[]’. Other variables such as F_CPU, BAUD, and BAUDRATE are also used in the program. While F_CPU defines the CPU clock frequency, BAUD specifies the baud rate for the USART communications. Lastly, BAUDRATE stores the calculated value that is stored in UBRR0.
The FT232R Breakout board and the Atmel Xplained Mini board were utilized for this assignment. Pin PD1 on the Atmel board was connected to the TXD pin on the FT232R board using a wire to set up the transmission. The grounds of both boards were also connected.