Technical information

The code window will open ‘main.c’ and show the new position of the program counter.
Support for the LCD display is included in the tutorial code. We do not need to be concerned about the details of the LCD interface – except
that the interface is write-only and so is not affected if the LCD display is attached or not.
Insert a Eventpoint on the ‘TimerADC();’ function call.
Right click on the ‘FlashLEDs();’ function and select ‘Go to cursor’.
The code will run to the selected line and stop.
Press ‘Step Over’ on the Debug Tool Bar.
The code will run and flash the LEDs 200 times. The debugger will not stop running until all 200 flashes have completed or a button is
pressed on the RSK.
If the LEDs are still flashing press the SW1 button on the RSK to exit the FlashLEDs() function.
The code will run to the Eventpoint we previously set on the Timer function.
There are several versions of the timer function depending upon the peripherals available in the device. The default function is TimerADC
which we shall demonstrate here.
The timer function initialises an interrupt on an available internal timer. On a compare match in the timer module an interrupt is generated.
In the TimerADC code version the interrupt reads the last ADC conversion for the external potentiometer and uses the result to set the next
compare match value. The ADC conversion is then re-started.
The interrupt initialisation is performed as part of the hardware setup. This is located in the file ‘interrupts.c’.
Open the file ‘interrupts.c’ by double clicking on the file in the workspace view.
9