74 ATMEL AVR MICROCONTROLLER PRIMER: PROGRAMMING AND INTERFACING
while(input_delay <= number_of_6_55ms_interrupts)
{
; //wait for specified
//number of
} //interrupts
}
//***************************************************************
4.5 SUMMARY
In this chapter, we provided an introduction to the interrupt features available aboard the
ATmega16. We also discussed how to program an interrupt f or proper operation and provided two
representative samples: an external and an internal interrupt.
4.6 REFERENCES AND FURTHER READING
1. S Barrett and D Pack, Microcontrollers Fundamentals for Engineers and Scientists,Morgan&
Claypool, San Rafael, CA, 2006. doi:10.2200/S00025ED1V01Y200605DCS001
2. Atmel 8-bit AVR Microcontroller with 16K Bytes In-System Programmable Flash, ATmega16,
ATmega16L, data s heet: 2466L-AVR-06/05, Atmel, San Jose, CA.
4.7 CHAPTER PROBLEMS
1. Question: What is the purpose of an interrupt?
2. Question
: Describe the flow of events when an interrupt occurs.
3. Question
: Describe the interrupt features available with the ATmega16.
4. Question
: What is interrupt priority? How is it determined?
5. Question
: What steps are required by the system designer to properly configure an interrupt?
6. Question
: How is the interrupt system turned ‘‘on’’ and ‘‘off ’’?
7. Question
: A 10-MHz ceramic resonator is not available. Redo the example of the
Timer/Counter0 Overflow interrupt provided with a time base of 1 and 8 MHz.
8. Question
: What is the maximum delay that may be generated with the delay function
provided in the text without modification? How could the function be modified for longer
delays?
9. Question
: Develop a 24-hour timer (hh:mm:ss) using the Timer/Counter0 Overflow
interrupt. What is the accura cy of your timer? How can it be improved?

Get Atmel AVR Microcontroller Primer now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.