{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Homework 6 Solution

Explain then write the interrupt handlers you code

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: SART UBRRnH = _______; UBRRnL = _______; UCSRnA = _______; UCSRnC = _______; UCSRnB = _______; Name: Lab Section: void USART_init() { const unsigned baud_setting = (16000000L/(16*115200)-1); //8 or 16 if you use double speed // Set baud rate for USART1 UBRR1H = baud_setting >> 8; //2 for double speed UBRR1L = (unsigned char) baud_setting; // Set UCSR1A UCSR1C UCSR1B USART1 control bits = 0; = (3<<UCSZ0);//0b00000110=0x06 = (1<<TXEN);//0b00001000=0x08 // Set baud rate for USART0 UBRR0H = baud_setting >> 8; UBRR0L = (unsigned char) baud_setting; // Set UCSR0A UCSR0C UCSR0B USART0 control bits = 0; = (3<<UCSZ0);//0b00000110=0x06 = (1<<RXEN) | (1<<RXCIE);//0b10010000=0x90 } b. [10] What interrupt handler(s) do you have to write to implement the reply functionality? Explain. Then, write the interrupt handler(s). You code should check for communication overflow: if USART0 receives a character but USART1 is not ready for transm...
View Full Document

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern