|
Readme
This is a C language project that implements periodic
interrupts using either TimerA0 or TimerG0.
The first main program uses TimerG0, and the second main program uses TimerA0.
Let f be the frequency of the selected clock.
In this example, f is 48 MHz.
Let prescale be the prescale, set to 239 in this example.
Let load be the value stored into the LOAD register,
set to 49999 in this example.
The frequency of the periodic interrupt will be
frequency = f / (prescale+1) / (load+1)
= 48MHz / (239+1) / (49999+1) = 4 Hz
The period of the periodic interrupt will therefore be the inverse
period = (prescale+1) * (load+1) / f
= (239+1) * (49999+1) / 48MHz = 250ms
PB27 is toggled within the Timer ISR and PA0 is toggled in the main program.
The following figure shows the interrupt period is 250ms.
At this scale, PA0 toggles faster than can be captured by the logic analyzer.

Next figure shows the same two signals zoomed in.
The overall activity is
- PA0 toggling,
- ISR is invoked,
- PB27 is toggled in the ISR,
- the main program is resumed, and
- the toggling on PA0 continues.
The recording shows the entire ISR consumed about 1.5us.

Derived from Texas Instrument code
- timx_timer_mode_periodic_sleep_LP_MSPM0G3507_nortos_ticlang
- gpio_toggle_output_LP_MSPM0G3507_nortos_ticlang
|