The main purpose of this lab is to get familiar with Interrupt Service Routine. We will see how interrupts works based on example with PWM LED dimmer.

 

1. Create the Interrupt application project

We need to create a new empty application project similar to previous laboratories. Then we need to import a source file provided with support documents.

1

It is simple application which allow to change the brightness of LED D8 from terminal input. It handles the invalid value of brightness in interrupt.

4

Here is example output from console for different values of input:

7

 

There is following flow of application:

- application reads characters from input. Assumes that it will be ASCII characters from 0-9,

- based on this value it writes period to PL PWM peripheral,

- there is defined interrupt which fires a handler when PL PWM controller detects invalid value.

 

There is description for BSP hardware driver scugic API: