Skip to main content

2026 ECE 4550 — Control System Design LAB #2- CLOCKS, TIMERS AND INTERRUPTS Georgia institute of tec

Page 1

2026 ECE 4550 — Control System Design LAB #2- CLOCKS, TIMERS AND INTERRUPTS Georgia institute of technology GEORGIA INSTITUTE OF TECHNOLOGY

SCHOOL of ELECTRICAL and COMPUTER ENGINEERING

ECE 4550 — Control System Design — Fall 2026 Lab #2: Clocks, Timers and Interrupts

Contents 1 Background Material 1 1.1 Introductory Comments..............................................................................................................1 1.2 Relevant Microcontroller Documentation..................................................................................2 1.3 Target Hardware Schematic Diagrams and Data Sheets........................................................3 2 Timer Interrupts: Step-by-Step Guidelines 3 2.1 Initialize the Clock and Timer Registers...................................................................................3 2.1.1 Select the Oscillator Source...........................................................................................3 2.1.2 Set the System Clock Frequency...................................................................................3 2.1.3 Set the Timer Reset Frequency.....................................................................................5 2.2 Initialize the Interrupt System Registers...................................................................................7 2.2.1 Load the PIE Vector Table..........................................................................................7 2.2.2 Enable Interrupts at the PIE Level..............................................................................8 2.2.3 Enable Interrupts at the CPU Level.............................................................................9 2.3 Utilize the Timer Interrupts......................................................................................................10 3 Lab Assignment 11 3.1 Pre-Lab Preparation..................................................................................................................11 3.2 Tasks..........................................................................................................................................12 3.2.1 Counting at a Specified Constant Frequency.............................................................12 3.2.2 Real-Time Solution of a Differential Equation...........................................................12

1

Background Material

1.1

Introductory Comments

The objective of this lab is to learn how to use an interrupt to execute a time-critical function at a programmable rate, a design feature utilized in digital control systems. Interrupts are hardwaredriven or software-driven events that cause the CPU to suspend its current program sequence and execute a subroutine called an interrupt service routine (ISR). Our microcontroller supports both hardware interrupts and software interrupts. Hardware interrupts are triggered by a microcontroller pin or by a peripheral module, whereas software interrupts are triggered by executing code (e.g. by writing to a register). If two interrupts are triggered simultaneously, they would be serviced in sequence according to priority. At the CPU, an interrupt is either maskable, meaning that it is enabled or disabled through software, or it is non-maskable, meaning that it cannot be blocked.


Turn static files into dynamic content formats.

Create a flipbook