Question
1. Determine the appropriate bit settings for UCSROA, UCSROB, UCSROC,and UBRRO to manage a serial interface using the following specific details: - use normal transmission speed (i.e., disable the x2 speed), - disable the multi-processor communication mode, - turn on the RX complete interrupt, turn off the TX complete interrupt, turn on the data register empty interrupt, - turn on the receiver, turn off the transmitter, - set the character size to 8 bits, - use the asynchronous USART mode, - use no parity, - use 1 stop bit, - set the baud rate to 9600 bits per second. 2. Create a function that initializes the USART based on the values determined in problem 1. 3. Create a program that utilizes the USART to send and receive bytes via the USB converter chip to and from the host computer terminal program. Use a switch statement to send a different message in response to different bytes received (like a chat app). For example, consider the following code piece. switch ( GetNextReceivedByte ()) { case '1': TransmitString("One\n", 4); break ; case '2': TransmitString("Two\n", 4); break ; default : TransmitString("Default\n", 8); break ; } Download your program and open a terminal program operating at 9600 baud rate. Verify that you receive appropriate messages in response to bytes that you send to the embedded device via the terminal program.
Question image 1