Homework 6 Solution

The sensor measures temperature in range of 50 degree

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: itting, then the received character should be discarded. In other word, your code should check the UDRE flag in UCSR1A before it writes to UDR1. You need to find out the interrupt vector code, which is available in the ATmega128 datasheet. Note: Reading UDRn will clear the RXC interrupt flag and consequently the interrupt signal, so your code does not have to clear that interrupt flag. It is sufficient to have a single ISR on USART0 Receive Complete Interrupt. When a character is received, the ISR may copy the Name: Lab Section: character from UDR0 to UDR1. It shall check if UDRE1 is 1 or not. ISR (USART0_RXC_vect) { char ch = UDR0; } // Read USART0 input // Send to USART1 if it’s ready; otherwise, discard the // received character if (USCAR1A & (1<<UDRE1)) UDR1 = ch; // send to USART1 Question 3: ADC Design Principle (10 pts) Suppose that an ATmega128 i...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online