Skip to content

The code for the Advanced Microcontroller Topics Workshop #2: Timers and Interrupts

Notifications You must be signed in to change notification settings

UCLA-IEEE/AMTW2-Timers-Interrupts

Repository files navigation

AMTW2-Timers-Interrupts

The code for the Advanced Microcontroller Topics Workshop #2: Timers and Interrupts

This project contains a simple program for the TM4C123GH6PM microcontroller that will control a single hobby RC servo motor. No 3rd party libraries are used to control the GPIO or set up the timers; instead, to illustrate the operation of the memory-mapped peripheral registers, direct access on these registers is employed to control the registers.

The program first sets up the GPIO and a single 32-bit hardware timer in count-up mode. A single ISR firing on the timer timeout handles a state machine for the output PWM signal generation. Each time the ISR fires, it reloads the timeout value with either the next PWM high period, or the PWM period remainder. It also toggles the state of the output pin.

The extra credit assignment for this project is to extend the code to control more than one servo motor. Hint: you still only need one timer! Consider how long each PWM period is vs. how long the signal will be high for at the absolute maximum.

The presentation slides that accompany this code can be viewed here.

About

The code for the Advanced Microcontroller Topics Workshop #2: Timers and Interrupts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages