代写COMP9032 Lab 4 Microprocessors and Interfacing代写数据结构语言程序

- 首页 >> CS

COMP9032 Lab 4

Oct. 2025

1. Objective

In this lab, you will study how to detect motor speed.

2. Description

The motor on the AVR Microcontroller Board is DC (Direct Current) voltage driven. The motor is attached to a disc, and the disc has four holes, as highlighted in the figure below.

Figure: DC Motor on the Lab Board

The speed of the motor is measured in revolutions per second (rps). To determine the motor speed, we use a shaft encoder. The encoder uses the infrared light emitter and detector that are each placed on different sides of the disc. When a hole in the disc is situated between the emitter and the detector, the light can pass through the hole and turn on the detector; otherwise, the light is blocked, and the detector is off.

The emitter is active high (i.e, it emits light when OpE=1) and the detector is active low (i.e, OpO will go low when the detector can see the light). For further circuit information, refer to the “I/O Connection Diagram” available on the References page of the course website.

Power up the AVR Microcontroller board and connect the pin named POT (output from the potentiometer) to the Mot pin (input to the motor) on the lab board. As you turn the potentiometer, the speed of the motor changes accordingly.

To measure the motor speed, you need to design to count the number of holes detected by the shaft encoder per second and the motor speed is this value divided by 4.

3. Task (80 marks, due in your lab session in Week 8)

Write an AVR assembly program that measures the speed of the motor and displays the speed on the LCD. The motor speed can be adjusted by the POT (potentiometer) on the lab board.

Assemble your program using Micronchip Studio and run it on the AVR Microcontroller Board. Demonstrate your work to the lab tutor.

The task will be assessed based on group work and individual performance, as detailed below.

o Group work (40 marks)

All participating group members will receive the same marks based on the following criteria:

•    Successful building of the project code without errors - 5 marks

Successful loading of the compiled code onto the hardware – 5 marks

Demonstrating that the code runs correctly and validates the intended design – 30 marks

•    Correct implementation of LCD output (10 marks)

•    Effective demonstration of motor speed measurement (20 marks)

o Individual performance (40 marks)

Each student will be individually assessed based on:

Their understanding of the group work – 10 marks

Their clear and accurate explanation of a specific part of the group work, as assigned by the tutor – 30 marks




站长地图