This tutorial explain the implementation of simple stopwatch timer using FRDM-KL43Z board. FRDM-KL43Z comes with segment LCD display. we going to use this SLCD to display the time (4 digits, 0-99 sec). Project is based on the MCUXpresso IDE with SDK 2.3.0 version (SDK_2.3.0_FRDM-KL43Z.zip)
I have configured PIT module to generate system ticks for every 10ms.
/* Set timer period for channel 0 */
PIT_SetTimerPeriod(PIT, kPIT_Chnl_0, USEC_TO_COUNT(10000U, PIT_SOURCE_CLOCK));
The value of the system ticks will be displayed on the slcd screen
SW1 button is used for Start/Stop the timer
SW3 button is used for Reset the timer
Download the source attached in this post