Java Python Department of Electrical and Electronic Engineering
EIE373 Microcontroller Systems and Interface
Laboratory Exercise 2: AVR Timer/Counter Programming
(Deadline: Check the course information)
Objective:
1. To develop C programs with timers under the Arduino platform.
2. To develop a C program with a counter under the Arduino platform.
Introduction:
This experiment introduces the use of timers and a counter inside the AVR microcontroller. Students MUST use the AVR timers in the delay function to finish this lab. Using simple loops only without timers to count the delay or built-in functions is not acceptable.
Equipment:
Atmel Studio
The Arduino Starter Kit
Procedure:
Section A: Write a C Program to toggle an LED by using a timer
1. Write a C program to toggle an LED connected to PB0 (you should connect the LED to PB0 with a resistor) every second. Use the timer with Normal mode to generate a one- second time delay. Note that the clock frequency of the Arduino Start Kit is 16 MHz.
2. Repeat Step 1, but the timer is in