代做EIE373 Microcontroller Systems and Interface Laboratory Exercise 3: AVR Interrupt Programming帮做R程序

- 首页 >> OS编程

Department of Electrical and Electronic Engineering

EIE373 Microcontroller Systems and Interface

Laboratory Exercise 3: AVR Interrupt Programming

Objective: To develop C programs with interrupts under the Arduino platform.

Equipment: Atmel Studio and the Arduino Starter Kit

Procedure:

Section A: Write a single C program to implement two applications in Lab 2.

Implement Sections B and C of Lab 2 in the ArduinoUno so that two applications (traffic light and counting) can be executed at the same time. Note that CTC mode should be used. The clock frequency of the Arduino Start Kit is  16 MHz. Note that you should write a simple application (e.g., flash one LED only) to check whether you can set a timer properly by using an interrupt.

Important information:

You  must  use  interrupts  to  implement  these  two  applications  (i.e.,  timer  and  counter- programming). Polling in timer programming is not accepted.

Section B: Replace the counting application by using an external hardware interrupt.

In Section A, counter programming is used to implement the application. In this section, an external hardware interrupt INT0 is used as a counter to implement the same application.

Section C: Use an external hardware interrupt to enable the simulation of the traffic lights.

Connect a switch to an external hardware interrupt INT1 pin. Write a C program so that the traffic light simulation can be started by pressing the switch once. If the switch is pressed again, the simulation will be stopped (i.e., all LEDs will be OFF).

Demonstrate your applications in Sections A,B, and C to our student helpers.

Instructions:

1.   You are required to demonstrate your programs to our student helpers.

2.   Zip all programs (including the whole project) in Sections A, B, and C into a single file. Submit it to Blackboard.

3.   Deadline: Check the course information.


站长地图