element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Freedom development platform
  • Products
  • Dev Tools
  • Freedom development platform
  • More
  • Cancel
Freedom development platform
Blog Kinetis Design Studio 3.0 + Kinetis SDK 1.2 Processor-Expert Using FRDM-KL43Z:  Toggle Green LED using PIT (Periodic Timer Interrupt)
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Freedom development platform to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: bheemarao
  • Date Created: 29 Jul 2015 1:49 PM Date Created
  • Views 579 views
  • Likes 0 likes
  • Comments 1 comment
  • kds3.0
  • kds+ksdk
  • ksdk1.2.0
  • pit
  • frdm-kl43z
Related
Recommended

Kinetis Design Studio 3.0 + Kinetis SDK 1.2 Processor-Expert Using FRDM-KL43Z:  Toggle Green LED using PIT (Periodic Timer Interrupt)

bheemarao
bheemarao
29 Jul 2015

Here is a Project created using new KDS version 3.0 and Kinetis software development kit 1.2 on processor expert platform. This is a project for Toggle a Green LED using PIT module of PE implemented using freedom board FRDM-KL43Z.


Requirements

To run successfully this exercise, you need first to download following packages (link enclosed):

- IDE toolchain Kinetis Design Studio (KDS) min v3.0
- microcontroller Library
Kinetis Software Development Kit (KSDK) min 1.2
-
FRDM-KL43Z materials (schematics, Quick Start Package and Sample Code Package)
- latest
P&E Micro windows drivers and SDA Applications


Before connecting your FRDM-KL43Z for the first time to the USB port of your computer, install the P&E Micro windows driver to ensure a correct detection of the board.


Install first the IDE toolchain KDS and when the installation ended successfully, install the MCU Library KSDK keeping the proposed installation path c:\freescale\kds or ksdk unchanged.

Launch KDS and define your workspace path, then select Help, Install New Software, Add, Archive, C:\Freescale\KSDK_1.2.0\tools\eclipse_update, select KSDK_1.2.0_Eclipse_Update.zip and press Open, OK, select KSDK Eclipse Update, press Next, Accept the Licence Agreement and press Finish. The KSDK libraries are now directly available in the IDE toolchain.

The automated code generator Processor Expert is already included in the IDE Toolchain (available separately as Processor Expert Driver Suite for other IDE toolchains).

 

 

Tutorial instructions

The tutorial shows how to toggle LED with KSDK 1.2.0 in KDS 3.0 and Processor Expert using a PIT (Periodic Interrupt Timer) module Output for FRDM-KL43Z.

Guide is prepared to toggle Green LED which is connected to PTD5 (according to FRDM-KL43Z schematics shown below).

 

image

Green led connected to : PTD5 - D13/SCK/LED/int

RED LED connected to : PTE31/TPM0_CH4

 

Create new project

Create new project in KDS 3.0 with KSDK 1.2.0


image

Type the project name” K43Z- example for PIT”, choose the board FRDM-KL43Z, mark off options Kinetis SDK and Processor Expert

image

image

image

image

Now, your project structure looks like this in the project explorer and Processor Expert windows:

image

Set Processor Expert Settings


Now, go to Components Library, find fsl_pit component using filters KSDK 1.2.0 and Applicable to Project and by double click add the component to the Processor Expert Component View of your project.

image

Similarly search for gpio and double click on fsl_gpio component which is required for toggling LED as shown below:

image

Double click on fsl_pit module from components windows and Component Inspector view should open automatically and uncheck the option for Tabs view which switches to classical view.

image

Configure the PIT module and click on “Period” option under configuration section as shown below:

image

Change the value to 1 sec by clicking on image button ...

image


Now all the red markings will vanish which indicates it is error free

image

Now double click on the fsl_gpio module it looks like below:

image

Make the settings as shown below:


image

output pin 0 is configured to LED1_GREEN port pin PTD-5 which is connected to Green LED

and i.e disable the input pins as shown in below picture

image

Now all our modules are ready assigned, we need to generate code by pressing the generate icon as shown below:

image

You can see all the required files will get generated under Generated_Code folder inside project folder.

 

Now it’s time to include our task inside the PIT IRQ. The ISR can be found in Events.c file as shown below:

image

Now we are inserting the toggling function inside PIT0_IRQHandler()

The toggling function can be found from components window inside fsl_gpio module as shown below:

image

The function GPIO_DRV_TogglePinOutput(uint32_t pinName); accepts the parameter uint32_t pinName this can be found from the assigned name for blue led gpio we assigned in component inspector of fsl_gpio:

Now Build your project by choosing the right toolbar shortcut 

image


You have two options to execute the project


One is by Debugging the code using the SDA Debug MSD application driver and another is by generating the binaries in SREC format and drag-n-drop to the MSD folder of the KL43Z detected after plugging the board to your computer.


I will proceed with the second option (as i have done the first option for almost of my other blogs)

Note: you can download the PE micro driver from below link:

http://www.pemicro.com/downloads/main_downloads_temp/201507291203137773819/Pemicro_OpenSDA_Debug_MSD_Update_Apps_2015_03_12.zip

 

Right click on project folder and select the properties as shown below:

image

Select “Toolchains” and select the check box “Create flash Image” and “Apply” and click “ok” as shown below:

image

Then go to “Tool Settings” and select “general” and select “Motorola S-record” from the pop down menu of output file format option as shown below:

image

Click on “Apply” and select “ok”

Now proceed further for building the project as did earlier (i.e clicking the hammer button)

 

  Now you can see the exe file “K43Z- example for PIT.srec” inside the “Debug” folder of your project folder as shown below:

image

Now copy this file

image

And paste this into the KL43Z MSD folder detected as shown below:

image

Your board now will get reset and the program will start to run

You should now able to see the Green LED blink with a 1Hz frequency i.e for every 1 sec of interrupt the LED toggles.

 

I have enclosed the project folder and binaries for quick reference and evaluation.


image image image

Attachments:
K43Z- example for PIT.rar
K43Z- example for PIT-srec.rar
  • Sign in to reply
  • DAB
    DAB over 10 years ago

    Very nice detailed post.

     

    Well done.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube