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-K22F:  Blink Green Led with FTM (Flex Timer Module)
  • 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: 16 Jul 2015 11:06 AM Date Created
  • Views 802 views
  • Likes 1 like
  • Comments 2 comments
  • frdm-k22f
  • kds3
  • ksdk1.2.0
  • ftm
Related
Recommended

Kinetis Design Studio 3.0 + Kinetis SDK 1.2 Processor-Expert using FRDM-K22F:  Blink Green Led with FTM (Flex Timer Module)

bheemarao
bheemarao
16 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 blinking an Green LED using FTM module of PE implemented using freedom board  FRDM-K22FFRDM-K22F


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-K22F materials (schematics, Quick Start Package and Sample Code Package)
- latest
P&E Micro windows drivers and SDA Applications


Before connecting your  FRDM-K22FFRDM-K22F 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 Flex timer module Output for  FRDM-K22FFRDM-K22F

Guide is prepared for Green LED which is connected to PTA2/FTM Module 0(FTM0 channel 7(according to  FRDM-K22FFRDM-K22F schematics


image


Create new project


  Create new project in KDS 3.0 with KSDK 1.2.0


image

 

Type the project name e.g.K22F-FTM example choose the board  FRDM-K22FFRDM-K22F mark off options Kinetis SDK and Processor Expert

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_ftm 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

 

Rename the component flexTimer1:fsl_ftm to GreenLedFTM

image

 

 

Double click on 'GreenLedFTM' in Components View and Component Inspector view should open automatically

First turn the Component Inspector view to Classical view by unselecting the Tab View option.

image

 

Configure the FTM module as shown below:

image

 

We need to set PWM configuration as above, Frequency = 1 Hz and Duty cycle to 50%

We need to configure the pin output for FTM module

As the Green Led is connected to channel-7 / PTA-2

Enable this channel as shown below:


image

 

We can see this pin (PTA-2) is conflicting with other configuration property i.e TDO of the JTAG Debug interface signal.

image

 

To overcome this error we will disable the JTAG configuration from CPU settings as shown below:

image

And disable the Fault pin 2 settings as shown below:

image

Now there will be no error display in channel-7 settings.

Now the FTM module is ready we need to generate code by pressing the generate icon as shown below:

 

image

 

Build your project by choosing the right toolbar shortcut

image

 

Debugging the  FRDM-K22FFRDM-K22F board for the first time you need to define a Debug Configuration by selecting the appropriate option from the toolbar

image

For this example, we are going to select the PEMicro OpenSDA Debug mode.


Select the Debugger tab to choose the Interface OpenSDA Embedded Debug - USB Port
You can now start the Debug session!!

image

 

Launch the configuration

 

image

You should now able to see the Green LED blink with a 1Hz frequency

image

 

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

Attachments:
K22F-FTM example-bin.rar
K22F-FTM example.rar
  • Sign in to reply
  • bheemarao
    bheemarao over 10 years ago in reply to quevedo

    Hi Antonio,

     

    There are two different ways to debug an ARM core: either with JTAG (Joint Test Access Group) or SWD (Single Wire Debug).

     

    SWD replaces the 5-pin JTAG port with a clock + single bi-directional data pin, providing all the normal JTAG debug and test functionality plus real-time access to system memory without halting the processor or requiring any target resident code. SWD uses an ARM standard bi-directional wire protocol
    On SWD, optionally there is SWO (Serial Wire Viewer).

     

    for more details please visit below link:

    http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php


    In JTAG mode, TMS, TCK, TDO and TDI (beside GND and Reset) are needed: hence if you disable the JTAG in processor expert (KDS + PE) still you can use OpenSDA SWD as debug.

    for more info on the debug connector refer below link:

    http://infocenter.arm.com/help/topic/com.arm.doc.faqs/attached/13634/cortex_debug_connectors.pdf

     

    Best Regards

    Bheema Rao

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • quevedo
    quevedo over 10 years ago

    Hello,

     

    I am working on a project with a FRDM-K64, and I found the same conflict between one of PORTA pins and the JTAG. I am worried that disabling JTAG will render the board "blind and deaf" when the program starts running. I mean, I would lose the debugging capacity, or even bricking the board.

    • 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