<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Freedom development platform</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/</link><description>KL25Z Freedom Board is our low-cost evaluation and development board featuring theCortex-M0+ based Kinetis L Series MCU exclusively available to pre order today.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Wiki Page: [FRDM-KL46Z - PE - CW] Tutorial: Make it blink in just 5min</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/w/documents/16986/frdm-kl46z---pe---cw-tutorial-make-it-blink-in-just-5min</link><pubDate>Wed, 09 Aug 2023 12:14:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b672d299-50da-4bf1-b17a-900088549271</guid><dc:creator>cstanton</dc:creator><description>This Project brings you with a quick step in blinking an LED on FRDM-KL46Z FRDM-KL46Z board using Processor Expert. The Freescale Freedom development platform is a set of software and hardware tools for evaluation and development. It is ideal for rapid prototyping of microcontroller-based applications. The Freescale Freedom KL46Z hardware, FRDM-KL46Z FRDM-KL46Z , is a simple, yet sophisticated design featuring a Kinetis L series microcontroller, built on the ARM &amp;#174; Cortex ™ -M0+ core. FRDM-KL46Z can be used to evaluate the KL46, KL36, KL26 and KL16 Kinetis L series devices. It features a MKL46Z256VLL4 MKL46Z256VLL4 , this device boasting a max operating frequency of 48MHz, 256KB of flash, 32KB RAM, a full-speed USB controller, segment LCD controller, and loads of analog and digital peripherals. The FRDM-KL46Z hardware is form-factor compatible with the Arduino ™ R3 pin layout, providing a broad range of expansion board options. The on-board interfaces includes a 4 digit segment LCD, a 3-axis digital accelerometer, magnetometer, capacitive touch slider, and ambient light sensor. The FRDM-KL46Z features the Freescale open standard embedded serial and debug adapter known as OpenSDA. This circuit offers several options for serial communications, flash programming and run-control debugging. Refer to the link for more details on Freedom board. The features of the FRDM-KL46Z FRDM-KL46Z include: MKL46Z256VLLZ4 MKL46Z256VLLZ4 MCU (48 MHz, 256 KB Flash, 32 KB RAM, Low power, 100 LQFP package) Dual role USB interface with mini-B USB connector Open SDA 4 digit segment LCD module Capacitive touch slider Ambient light sensor MMA8451Q MMA8451Q accelerometer MAG3110 MAG3110 Magnetometer 2 user LEDs 2 user push buttons Flexible power supply options – USB, coin cell battery, external source Battery-ready, power-measurement access points Easy access to MCU I/O via Arduino ™ R3 compatible I/O connectors Programmable OpenSDA debug interface with multiple applications available including: Mass storage device flash programming interface P&amp;amp;E Debug interface provides run-control debugging and compatibility with IDE tools CMSIS-DAP interface: new ARM standard for embedded debug interface Data logging application Arduino R3 compatibility Before we start on our project make sure the board is in Debug mode (refer to the blog how to load in Debug mode using OpenSDA) Now that our board is loaded in Debug Let’s start on creating a CodeWarrior project to quickly demonstrate blinking LED on KL46 board. A free version of Codewarrior can be downloaded following the link below in the Downloads section: www.freescale.com/cwmcu10 The Evaluation version is a 30 days Limited version and the Special Edition is Code Size Limited version (64KB for Kinetis MCUs with an ARM Cortex-M0+ core and 128KB for the Kinetis MCUs with an ARM Cortex-M4 core). Follow the below steps for creating the CW project: Select File-&amp;gt;New-&amp;gt;Bareboard Project Provide Project Name “ Blink it using PE-KL46 ” then click Next Now select the MCU exist on our KL46 board it is “MKL46Z256” Kinetis L Series-&amp;gt; KL4x Family-&amp;gt;KL46Z(48 MHz) Family-&amp;gt;MKL46Z256 then Click Next Select OpenSDA option to connect for this board for debugging and programming, then click Next Then click Next to proceed further Select ‘ Processor Expert’ option as we are creating the project using Processor Expert then click ‘ Finish’ I have created the project by name “ Blink it using PE-KL46 ” as shown below are the component inspector showing CPU with default settings: First we need to configure CPU parameter settings as shown below: Under clock Settings-&amp;gt; System Oscillator: Enabled Clock Source: External Oscillator Clock Frequency: 8 MHz (as this board is connected to external crystal oscillator ) Under clock source settings-&amp;gt; clock source settings 0-&amp;gt; MCG settings-&amp;gt; MCG mode: FEI (FLL engaged internal) FLL settings-&amp;gt;FLL output[MHz] : 47.972352 Then automatically MCG output[MHz] gets selected to 47.972352 Then under Clock configurations-&amp;gt;Clock configuration 0-&amp;gt;System clocks-&amp;gt; Set Core clock: 47.972352 MHz Bus clock: 23.986176 MHz Then all other parameters which were highlighted in RED gets cleared which means the settings are correct. These settings are as shown in above figure. Since now our project skeleton is ready (i.e no component module peripherals has been added to our project) we need to add the required peripheral component module as per our requirement. Our requirement here is to blink the LED present in KL46 board; refer to below schematic there are two LED’s exist on board Red and Green connected to Port-E 29 th bit (PTE29) and Port-D 5 th bit (PTD5). LED KL46 Green (LED1) PTD5 Red (LED2) PTE29 We now need to add two component modules for these two led’s those are as shown below Now select under Component Library-&amp;gt; categories sub window Click on Logical Device Drivers-&amp;gt;Port I/O-&amp;gt; BitIO_LDD Right click and select ‘ Add to Project’ twice since we need two LED component in our project. Now we are adding software generated ‘wait’ component in order to add delay routine to our project. Under Component Library-&amp;gt; categories sub window Click on SW-&amp;gt;User Components-&amp;gt;Wait component, Right click and select ‘ Add to Project’ Rename the components (LED_RED, LED_Green, WAIT1)as shown below: Make the ‘LED_RED’ BitIO settings as shown below: assigned to output pin ‘PTE29’ Make the ‘LED_Green’ BitIO settings as shown below: assigned to output pin ‘PTD5’ And default settings for ‘Wait1’ component as shown below: Now click on ‘Generate Processor Expert code’ radio button as shown below : You can see the tool generates required code as shown below: All the required header files will get generated under ‘Generated_Code’ folder as shown below : Now select ‘ProcessorExpert.c’ from project window Add below lines of code in ‘ProcessorExpert.c’ file int main ( void ) /*lint -restore Enable MISRA rule (6.3) checking. */ { /* Write your local variable definition here */ /*** Processor Expert internal initialization . DON&amp;#39;T REMOVE THIS CODE!!! ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization . ***/ LDD_TDeviceData *Led_RPtr, *Led_GPtr; Led_RPtr = LED_RED_Init(( LDD_TUserData *)NULL); Led_GPtr = LED_Green_Init(( LDD_TUserData *)NULL); /* Write your code here */ /* For example: for(;;) { } */ while (1) { LED_RED_ClrVal(Led_RPtr); LED_Green_ClrVal(Led_GPtr); WAIT1_Waitms(1000); LED_RED_SetVal(Led_RPtr); LED_Green_SetVal(Led_GPtr); WAIT1_Waitms(500); } /*** Don&amp;#39;t write any code pass this line, or it will be deleted during code generation. ***/ /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON&amp;#39;T MODIFY THIS CODE!!! ***/ #ifdef PEX_RTOS_START PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */ #endif /*** End of RTOS startup code. ***/ /*** Processor Expert end of main routine. DON&amp;#39;T MODIFY THIS CODE!!! ***/ for (;;){} /*** Processor Expert end of main routine. DON&amp;#39;T WRITE CODE BELOW!!! ***/ } /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/ /* END ProcessorExpert */ The functions related to LED_RED, LED_Green can be explored from the Generated code folder in “LED_RED.c”, “LED_Green.c” and defined in LED_RED.h, LED_Green.h files as shown below: Its functions can also be seen from components window as shown: As per the code instruction we are turning on LED for 1000 ms and turning off the LED’s for 500 ms and looping forever. Now it’s time to clean and Build the project as shown: You can then see project starts building as shown : Now Run the project as shown: Now you can see the blinking of Red and Green LED on KL46 board Created Project folder and output video file is attached in this tutorial for quick reference. Happy Blinking LED on PE..... Attachments: community.element14.com/.../Blink-it_2D00_kl46-using-PE.rar players.brightcove.net/.../index.html</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/freedom_2D00_board">freedom-board</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/kl46">kl46</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/kinetis_2D00_l">kinetis-l</category></item><item><title>Wiki: Documents</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/w/documents</link><pubDate>Wed, 09 Aug 2023 12:14:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:030be4eb-281a-467d-b5ce-5f7e36849be7</guid><dc:creator /><description /></item><item><title>Wiki Page: [FRDM-KL46Z - FRDM-KL25Z - PE] Tutorial: Migrate your code easily</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/w/documents/16987/frdm-kl46z---frdm-kl25z---pe-tutorial-migrate-your-code-easily</link><pubDate>Wed, 09 Aug 2023 12:10:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:fd266c99-3057-45f8-ab3b-595ec9feca42</guid><dc:creator>cstanton</dc:creator><description>What if i have a processor expert project of my older freedom board and want to migrate or work on the same existing project on newer version of any freedom board? Do need to create from scratch till end: let’s see in this tutorial how to migrate between FRDM-KL25 FRDM-KL25 to FRDM-KL46Z FRDM-KL46Z freedom board using Processor Expert tool. Processor Expert provides an efficient development environment for rapid application development of the embedded applications. You can develop embedded applications for a wide range of microcontrollers and microprocessor systems using Processor Expert. Processor Expert is integrated as a plug-in into the CodeWarrior IDE. You can access Processor Expert from the CodeWarrior IDE using the Processor Expert menu in the CodeWarrior IDE menu bar. The Processor Expert plug-in generates code from the embedded components and the CodeWarrior IDE manages the project files and compilation and debug processes. Processor Expert generates all drivers during the code generation process. The generated files are automatically inserted into the active (default) target in the CodeWarrior project. As a pre-requisite to work on this one should have sample code of KL25Z you can download this from HERE (alternately I have attached the project for quick reference) And your new Freedom board, as in my case I am having FRDM-KL46Z FRDM-KL46Z and latest version of Code Warrior tool. A free version of Codewarrior can be downloaded following the link below in the Downloads section: www.freescale.com/cwmcu10 The Evaluation version is a 30 days Limited version and the Special Edition is Code Size Limited version (64KB for Kinetis MCUs with an ARM Cortex-M0+ core and 128KB for the Kinetis MCUs with an ARM Cortex-M4 core) Before we start here are the features of our New FRDM-KL46Z FRDM-KL46Z board stating which all the peripherals available are on board to work on: Refer to the link for more details: MKL46Z256VLLZ4 MKL46Z256VLLZ4 MCU (48 MHz, 256KB Flash, 32 KB RAM, Low power, 100LQFP package) Dual role USB interface with mini-B USB connector Open SDA 4 digit segment LCD module Capacitive touch slider Ambient light sensor MMA8451Q MMA8451Q accelerometer MAG3110 MAG3110 Magnetometer 2 user LEDs 2 user push buttons Flexible power supply options – USB, coin cell battery, external source Battery-ready, power-measurement access points Easy access to MCU I/O via Arduino ™ R3 compatible I/O connectors Programmable OpenSDA debug interface with multiple applications available including: Mass storage device flash programming interface P&amp;amp;E Debug interface provides run-control debugging and compatibility with IDE tools CMSIS-DAP interface: new ARM standard for embedded debug interface Data logging application Arduino R3 compatibility Before we start on our project make sure the board is in Debug mode (refer to the blog how to load in Debug mode using OpenSDA) Now let’s start on migrating the available sample code of KL25Z, I have selected the “pwm_led” project which is located in folder “~\ Downloads\KL25 Sample Code\kl25_sc_rev10\klxx-sc-pex\projects\pwm_led\cw” Open this project in code warrior in current workspace (you can drag and drop the “.project” present in pwm_led project folder). I have rename the project as “pwm_led-KL25” and saved a copy in my current workspace to differentiate the original one. You can see from above snap shot i have opened the project it has kinetis family MCU ‘MKL25Z128VLK4’ running at 8 MHz connected to external crystal, PEE(PLL engaged external) as MCG mode and core clock is 48 MHz, Bus clock is 24 MHz. The components present in this project are module &amp;quot;PeriodicInterrupt&amp;quot; (component TimerUnit_LDD), Module &amp;quot;PWMTimerRG&amp;quot; (component name ‘PWMTimerRG’ of type TimerUnit_LDD ), and Module &amp;quot;PWMTimerB&amp;quot; (component name PWMTimerB of type TimerUnit_LDD). Now create a new project for KL46Z board following below procedure (refer to the blog link for “how to create project using processor expert” ) In the CodeWarrior, click File menu and select New &amp;gt; Bareboard Project in order to create a new project. The Project Wizard appears. Enter the name of the project “ pwm-led migrate-kl46 ” and click Next . Now select the MCU exist on our KL46 board it is “MKL46Z256” Kinetis L Series-&amp;gt; KL4x Family-&amp;gt;KL46Z(48 MHz) Family-&amp;gt;MKL46Z256 then Click Next. Select OpenSDA option to connect for this board for debugging and programming, then click Next . Select ‘ Processor Expert’ option as we are creating the project using Processor Expert then click ‘ Finish’ I have created the project by name “ pwm-led migrate-kl46 ” as shown below is the component inspector showing CPU with default settings: First we need to configure CPU parameter settings as shown below: Under clock Settings-&amp;gt; System Oscillator: Enabled Clock Source: External Oscillator Clock Frequency: 8 MHz (as this board is connected to external crystal oscillator ) Under clock source settings-&amp;gt; clock source settings 0-&amp;gt; MCG settings-&amp;gt; MCG mode: FEI (FLL engaged internal) FLL settings-&amp;gt;FLL output[MHz] : 47.972352 Then automatically MCG output[MHz] gets selected to 47.972352 Then under Clock configurations-&amp;gt;Clock configuration 0-&amp;gt;System clocks-&amp;gt; Set Core clock: 47.972352 MHz Bus clock: 23.986176 MHz Then all other parameters which were highlighted in RED gets cleared which means the settings are correct. These settings are as shown in above figure. Since now our project skeleton is ready (i.e no component module peripherals has been added to our project) we need to add the required peripheral component module as per our requirement. Copy all the three components present in KL25Z project as shown: Paste the copied 3 components to our created project folder “ pwm-led migrate-kl46 ” under ‘Components’ window as shown below: Now select the first component ‘PeriodicInterrupt’ and change the settings as shown: This is a Periodic interrupt timer module with counter direction as Down count, it uses internal clock source of 24 MHz as counter frequency. Make sure the interrupt is enabled and the period of the counter is set to 50 us (i.e this PIT will generate an interrupt on every 50us) Note: there is an RGB LED connected to port pins in KL25Z board but in KL46Z board only 2 LED’s are connected no RGB is present in this. RED connected to PTE29 and Green is connected to PTD5, in order to connect the third LED i.e blue we need to connect it manually. The second component is “PWMTimerRG” of type “TimerUnit_LDD” which is connected to RED and GREEN LED of KL25Z board its setting are as shown below: This module is connected to TPM0 Flex Timer Module which runs in ‘UP” counter direction with period of 2.7306 ms with its interrupt disabled. Further to this timer module we are taking 2 outputs by connecting them to two channels, one is connected to channel-2 (TPM0_C2) of timer module which leads to o/p port pin PTE29 and another connected to channel-5 (TPM0_C5) of timer module which in turn connects to PTD5 port pin. We have selected these channel output port pins because the physical LED’s are connected in the board to particular GPIO pins i.e Refer to below schematic there are two LED’s exist on board Red and Green connected to Port-E 29 th bit (PTE29) and Port-D 5 th bit (PTD5). LED KL46 Green (LED1) PTD5 Red (LED2) PTE29 We should run this timer as PWM to do so it has to run in ‘compare’ mode. As this module is 16 bit timer running counts from 0000 to FFFF (0 to 65535 timer-ticks) and initial offset is given as ‘0’ timer-ticks so that the PWM starts from 0% of dutycycle. We access this ‘offset’ variable during programming and continuously change its value varying the duty cycle to 100%. Next coming to third module “PWMTimerB” it is connected to ‘Blue’ LED in KL25Z board we need to connect this manually in case of KL46Z board and we are connecting it to PTE23 port pin which internal connected to TPM2- channel-1, its period is 2.7306 ms and ‘offset’ is set to ‘0’. The PWM waveform will look like the below picture: Now all our module settings have been done and we can now ‘generate’ the project to generate Processor Expert code, which creates all supporting header files and API’s required. Now it’s time for us to write our application code, since RGB LED is not present in KL46Z board i am going to write my own application where i will be varying the brightness of LED present in KL46Z (i.e Red and Green) through varying the PWM duty cycle. The place where i need to write my code is file “ProcessorExpert.c” located in ‘sources’ folder in my project folder which is shown in below picture. Since we are writing fresh lines of code i delete all its content by pressing Ctrl-A and Delete then paste below line of code. /* ################################################################### ** Filename : ProcessorExpert.c ** Project : ProcessorExpert ** Processor : MKL46Z256VMC4 ** Version : Driver 01.01 ** Compiler : GNU C Compiler ** Date/Time : 2014-06-06, 08:06, # CodeGen: 0 ** Abstract : ** Main module. ** This module contains user&amp;#39;s application code. ** Settings : ** Contents : ** No public methods ** ** ###################################################################*/ /*! ** @file ProcessorExpert.c ** @version 01.01 ** @brief ** Main module. ** This module contains user&amp;#39;s application code. */ /*! ** @addtogroup ProcessorExpert_module ProcessorExpert module documentation ** @{ */ /* MODULE ProcessorExpert */ /* Including needed modules to compile this module/procedure */ #include &amp;quot;Cpu.h&amp;quot; #include &amp;quot;Events.h&amp;quot; #include &amp;quot;PeriodicInterrupt.h&amp;quot; #include &amp;quot;PWMTimerRG.h&amp;quot; #include &amp;quot;PWMTimerB.h&amp;quot; /* Including shared modules, which are used for whole project */ #include &amp;quot;PE_Types.h&amp;quot; #include &amp;quot;PE_Error.h&amp;quot; #include &amp;quot;PE_Const.h&amp;quot; #include &amp;quot;IO_Map.h&amp;quot; volatile bool PeriodicEvent = FALSE; // interrupt for every 50us to write each inc timer value (0 to 65535 timer value) LDD_TDeviceData *PWMTimerRG_DeviceData, *PWMTimerB_DeviceData; LDD_TDeviceData *PeriodicInterrupt_DeviceData; const int RedChannel = 0; const int GreenChannel = 1; const int BlueChannel = 0; /******************************************************************************/ int main(void) { LDD_TError Error; int PulseOffset = 0; int dir = 0; /*** Processor Expert internal initialization. DON&amp;#39;T REMOVE THIS CODE!!! ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization. ***/ /* Intialize the timers */ PWMTimerRG_DeviceData = PWMTimerRG_Init(NULL); PWMTimerB_DeviceData = PWMTimerB_Init(NULL); PeriodicInterrupt_DeviceData = PeriodicInterrupt_Init(NULL); /* Set initial compare value */ PWMTimerRG_SetOffsetTicks(PWMTimerRG_DeviceData, RedChannel, PulseOffset); PWMTimerRG_SetOffsetTicks(PWMTimerRG_DeviceData, GreenChannel, PulseOffset); PWMTimerB_SetOffsetTicks(PWMTimerB_DeviceData, BlueChannel, PulseOffset); /* Turn on the timers */ Error = PWMTimerRG_Enable(PWMTimerRG_DeviceData); if (Error != ERR_OK) PE_DEBUGHALT(); Error = PWMTimerB_Enable(PWMTimerB_DeviceData); if (Error != ERR_OK) PE_DEBUGHALT(); Error = PeriodicInterrupt_Enable(PeriodicInterrupt_DeviceData); if (Error != ERR_OK) PE_DEBUGHALT(); PulseOffset = 0; while (1) { if (PeriodicEvent) { if(dir == 0) //incremental intensity { PulseOffset = PulseOffset + 1; if(PulseOffset &amp;gt;= 65535) { dir = 1; } } else // dir == 1 decrementing intensity { PulseOffset = PulseOffset - 1; if(PulseOffset == 0) dir = 0; } PWMTimerRG_SetOffsetTicks(PWMTimerRG_DeviceData, RedChannel,PulseOffset); PWMTimerRG_SetOffsetTicks(PWMTimerRG_DeviceData, GreenChannel, PulseOffset); PeriodicEvent = FALSE; } } /*** Don&amp;#39;t write any code pass this line, or it will be deleted during code generation. ***/ /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON&amp;#39;T MODIFY THIS CODE!!! ***/ #ifdef PEX_RTOS_START PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */ #endif /*** End of RTOS startup code. ***/ /*** Processor Expert end of main routine. DON&amp;#39;T MODIFY THIS CODE!!! ***/ for(;;){} /*** Processor Expert end of main routine. DON&amp;#39;T WRITE CODE BELOW!!! ***/ return 0; } /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/ /* END ProcessorExpert */ /* ** ################################################################### ** ** This file was created by Processor Expert 10.0 [05.03] ** for the Freescale Kinetis series of microcontrollers. ** ** ################################################################### */ Code explanation: First initialise the timer as shown below line of code: PWMTimerRG_DeviceData = PWMTimerRG_Init(NULL); // initialise timer concern to Red and Green LED PWMTimerB_DeviceData = PWMTimerB_Init(NULL); // initialise timer concern to Blue LED PeriodicInterrupt_DeviceData = PeriodicInterrupt_Init(NULL);// initialise the Periodic interrupt timer Next we are giving initial value to the PWM output channels (Red channel, Green channel, Blue channel) Function &amp;quot;PWMTimerRG_SetOffsetTicks()&amp;quot; does this job &amp;#39;PulseOffset&amp;#39; = 0 initially so PWM starts from 0 value PWMTimerRG_SetOffsetTicks(PWMTimerRG_DeviceData, RedChannel, PulseOffset); PWMTimerRG_SetOffsetTicks(PWMTimerRG_DeviceData, GreenChannel, PulseOffset); PWMTimerB_SetOffsetTicks(PWMTimerB_DeviceData, BlueChannel, PulseOffset); Next we need to turn on the timers this is done using the function &amp;quot;PWMTimerRG_Enable()&amp;quot; In while(1) loop we are writing PWM value from 0 to 65535 and again from 65535 to 0 using the function &amp;quot;PWMTimerRG_SetOffsetTicks()&amp;quot;. this is done every periodically 50 us. &amp;#39;PulseOffset&amp;#39; is variable which will take care of writing the PWM cycle value As mentioned earlier the Periodic interrupt timer module will be generating an interrupt for every 50 us we need to create a variable “ PeriodicEvent ” as shown below in the file “Events.c” extern volatile bool PeriodicEvent; Add below lines of code inside a function as shown “void PeriodicInterrupt_OnCounterRestart(LDD_TUserData *UserDataPtr)” void PeriodicInterrupt_OnCounterRestart ( LDD_TUserData *UserDataPtr) { /* Write your code here ... */ PeriodicEvent = TRUE; } Save all the files then clean and Build the project as shown below: The build progress is shown below: Now connect the board to USB through OpenSDA port of the board and Run the project as shown below: You can see Run progress bar as shown below: Below is the console window which shows the status of execution process You can see the output which shows 2 LED’s Red and Green intensity is increased from 0% to 100% and again coming back from 100% to 0%. You can see the output waveform on CRO by connecting at led terminal as shown: The output waveform seen through oscilloscope is as shown below along with setup: Watch the video output which is attached in this blog. Created supporting project files have been enclosed too for quick reference. So it is concluded that by using the processor expert migration of the project from different Freedom platform boards made easy. Happy Migrating ..... Attachments: community.element14.com/.../pwm_5F00_led_2D00_kl25.rar community.element14.com/.../pwm_2D00_led-migrate_2D00_kl46.rar players.brightcove.net/.../index.html</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/freedom_2D00_board">freedom-board</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/freescale">freescale</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/kl46">kl46</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_kl25z">frdm-kl25z</category></item><item><title>Wiki Page: [FRDM-KL46Z - CW] Tutorial: Make it blink in 15min</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/w/documents/16980/frdm-kl46z---cw-tutorial-make-it-blink-in-15min</link><pubDate>Wed, 09 Aug 2023 12:07:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:0b2fc339-7f8d-47b5-9dd4-6e2b742c7932</guid><dc:creator>cstanton</dc:creator><description>This Project brings you with a quick step in blinking an LED on FRDM-KL46Z FRDM-KL46Z board using CodeWarrior. The Freescale Freedom development platform is a set of software and hardware tools for evaluation and development. It is ideal for rapid prototyping of microcontroller-based applications. The Freescale Freedom KL46Z hardware, FRDM-KL46Z FRDM-KL46Z , is a simple, yet sophisticated design featuring a Kinetis L series microcontroller, built on the ARM &amp;#174; Cortex ™ -M0+ core. FRDM-KL46Z can be used to evaluate the KL46, KL36, KL26 and KL16 Kinetis L series devices. It features a MKL46Z256VLL4 MKL46Z256VLL4 , this device boasting a max operating frequency of 48MHz, 256KB of flash, 32KB RAM, a full-speed USB controller, segment LCD controller, and loads of analog and digital peripherals. The FRDM-KL46Z hardware is form-factor compatible with the Arduino ™ R3 pin layout, providing a broad range of expansion board options. The on-board interfaces includes a 4 digit segment LCD, a 3-axis digital accelerometer, magnetometer, capacitive touch slider, and ambient light sensor. The FRDM-KL46Z features the Freescale open standard embedded serial and debug adapter known as OpenSDA. This circuit offers several options for serial communications, flash programming and run-control debugging. Refer to the link for more details on Freedom board. The features of the FRDM-KL46Z FRDM-KL46Z include: MKL46Z256VLLZ4 MKL46Z256VLLZ4 MCU (48 MHz, 256 KB Flash, 32 KB RAM, Low power, 100 LQFP package) Dual role USB interface with mini-B USB connector Open SDA 4 digit segment LCD module Capacitive touch slider Ambient light sensor MMA8451Q MMA8451Q accelerometer MAG3110 MAG3110 Magnetometer 2 user LEDs 2 user push buttons Flexible power supply options – USB, coin cell battery, external source Battery-ready, power-measurement access points Easy access to MCU I/O via Arduino ™ R3 compatible I/O connectors Programmable OpenSDA debug interface with multiple applications available including: Mass storage device flash programming interface P&amp;amp;E Debug interface provides run-control debugging and compatibility with IDE tools CMSIS-DAP interface: new ARM standard for embedded debug interface Data logging application Arduino R3 compatibility Before we start on our project make sure the board is in Debug mode (refer to the blog how to load in Debug mode using OpenSDA) Now that our board is loaded in Debug Let’s start on creating a CodeWarrior project to quickly demonstrate blinking LED on KL46 board. A free version of Codewarrior can be downloaded following the link below in the Downloads section: www.freescale.com/cwmcu10 The Evaluation version is a 30 days Limited version and the Special Edition is Code Size Limited version (64KB for Kinetis MCUs with an ARM Cortex-M0+ core and 128KB for the Kinetis MCUs with an ARM Cortex-M4 core) Follow the below steps for creating the CW project: Select File-&amp;gt;New-&amp;gt;Bareboard Project Provide Project Name “ Blink-it using CW ” then click Next Now select the MCU exist on our KL46 board it is “MKL46Z256” Kinetis L Series-&amp;gt; KL4x Family-&amp;gt;KL46Z(48 MHz) Family-&amp;gt;MKL46Z256 then Click Next. Select OpenSDA option to connect for this board for debugging and programming, then click Next Then click Next to proceed further proceed further by clicking Next in Rapid application development do not select Processor Expert then click on finish. I have created the project by name “Blink-it using CW” as shown below: Now open “main.c” and add the below code to it. #include &amp;quot;derivative.h&amp;quot; /* include peripheral declarations */ void delay ( int itime); int main ( void ) { SIM_SCGC5 |= SIM_SCGC5_PORTE_MASK; PORTE_PCR29 = PORT_PCR_MUX(1); GPIOE_PDDR |= (1 &amp;lt;&amp;lt; 29); for (;;) { GPIOE_PTOR |= (1 &amp;lt;&amp;lt; 29); delay(1000); } return 0; } void delay ( int itime){ int icompTime = 0; for (icompTime=itime*1000;icompTime!=0;icompTime--){ } } The line of code shown below is System Clock Gating Control Register 5 (SIM_SCGC5)and Enable clock for PORT E setting bit field PORTE SIM_SCGC5 |= SIM_SCGC5_PORTE_MASK Next below line is Pin Control Register n (PORTx_PCRn) setting for PORTE, and Select GPIO as pin functionality on multiplexer setting field MUX=001 PORTE_PCR29 = PORT_PCR_MUX(1); The below line of code is Port Data Direction Register (GPIOx_PDDR) and Set GPIO direction set bit corresponding bit on the direction register for each port, set the bit means OUTPUT GPIOE_PDDR |= (1 &amp;lt;&amp;lt; 29); In for() loop we are toggling the output LED connected to PortE29 This can be found from Schematic of KL46Z board ( http://www.element14.com/community/docs/DOC-54780/l/element14-presents-the-frdm-kl46z--a-freescale-kinetis-l-based-freedom-development-platform ) LED KL46 Green (LED1) PTD5 Red (LED2) PTE29 Now it’s time to clean and Build the project as shown: You can then see project starts building as shown Now Run the project as shown: Now you can see the blinking of Red LED on KL46 board Project created folder and Video output of this project execution is attached for reference. Now we will modify our code to blink Green LED too (both Red and Green) By referring to schematic we know Green LED is connected to port PTD5 #include &amp;quot;derivative.h&amp;quot; /* include peripheral declarations */ void delay ( int itime); int main ( void ) { SIM_SCGC5 |= SIM_SCGC5_PORTE_MASK; // PORT E mask Red LED SIM_SCGC5 |= SIM_SCGC5_PORTD_MASK; // PORT D mask connected to Green LED PORTE_PCR29 = PORT_PCR_MUX(1); // PORT E MUX PORTD_PCR5 = PORT_PCR_MUX(1); // PORT D MUX GPIOE_PDDR |= (1 &amp;lt;&amp;lt; 29); // switching on RED LED GPIOD_PDDR |= (1 &amp;lt;&amp;lt; 5); // switching on Green LED for (;;) { GPIOE_PTOR |= (1 &amp;lt;&amp;lt; 29); // Toggling RED LED after some delay GPIOD_PTOR |= (1 &amp;lt;&amp;lt; 5); // Toggling Green LED after some delay delay(1000); } return 0; } void delay ( int itime){ int icompTime = 0; for (icompTime=itime*1000;icompTime!=0;icompTime--){ } } we can now see both LED&amp;#39;s are blinking Happy Blinking LED on KL46 board... players.brightcove.net/.../index.html Attachments: community.element14.com/.../Blink-it-CW_2D00_KL46.rar</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/freescale">freescale</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/kl46">kl46</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/kinetis">kinetis</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/freedom">freedom</category></item><item><title>Forum Post: RE: Prototype shield for the Freedom Board?</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/f/forum/21684/prototype-shield-for-the-freedom-board/199285</link><pubDate>Fri, 22 Jul 2022 03:38:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:75ac1bc1-fd47-4e80-abf1-05be2d2d346a</guid><dc:creator>yangkuki</dc:creator><description>I look forward to the experience, it&amp;#39;s great word unscrambler</description></item><item><title>File: Nerfinator</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/146101</link><pubDate>Sun, 19 Jun 2022 09:11:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2c8d2a63-3b72-431a-8399-2e3b1538fb77</guid><dc:creator>bheemarao</dc:creator><description>This is just too fun of a project. We are using two FRDM-K64F boards, Nordic WiFi module, some servos, and mbed for my latest invention, the Nerfinator.</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/nerf">nerf</category></item><item><title>File: Nerfinator</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/145994</link><pubDate>Sun, 12 Jun 2022 18:25:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:0dd2efd8-01c3-45bf-8232-b44e813e10c1</guid><dc:creator>bheemarao</dc:creator><description>This is just too fun of a project. We are using two FRDM-K64F boards, Nordic WiFi module, some servos, and mbed for my latest invention, the Nerfinator.</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/nerf">nerf</category></item><item><title>Forum Post: RE: Prototype shield for the Freedom Board?</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/f/forum/21684/prototype-shield-for-the-freedom-board/194494</link><pubDate>Sat, 11 Dec 2021 19:06:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:82f29136-b896-44a4-8ab9-a823cac3ea44</guid><dc:creator>Jeandavis</dc:creator><description>The Proto Shield makes it simple to create unique circuits. You can solder parts to the prototyping service area to build your project, or you can use it with a small solderless breadboard (not supplied) to quickly test circuit ideas without soldering. It has additional connections for all of the Arduino I/O pins, as well as space for through-hole and surface mount integrated circuits. It&amp;#39;s an easy method to combine your custom circuit and an Arduino into a single module.</description></item><item><title>File: Displaying 12-bit ADC value on hyperterminal by connecting a potentiometer and indicating through LED</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/144533</link><pubDate>Sat, 20 Nov 2021 13:46:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:846751cb-70ab-4976-861e-d4d5f3018c0a</guid><dc:creator>bheemarao</dc:creator><description>Video output for the blog implementing 12-bit ADC by polling method and displaying the digital values over hyperterminal. Corresponding to the digital values the Red Green and Blue LED’s are indicated.</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/12_2D00_bit%2badc">12-bit adc</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_kl28z">frdm-kl28z</category></item><item><title>File: Out-of-Box demo of SMAC application on FRDM-KW40Z</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/144532</link><pubDate>Sat, 20 Nov 2021 13:45:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:cc5f3f65-fb3e-43fd-8d33-3ba1abca0035</guid><dc:creator>bheemarao</dc:creator><description>This is an out-of-box demo fro blog on &amp;quot;</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/smac%2bexample">smac example</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_kw40z">frdm-kw40z</category></item><item><title>File: Video output for the Freescale sensor board FRDM-STBC-AGM01 interface with FRDM-KL46Z</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/144530</link><pubDate>Sat, 20 Nov 2021 13:45:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d7363dad-effe-4f28-847b-07df759390dd</guid><dc:creator>bheemarao</dc:creator><description>Here is an video output for the blog &amp;quot;Interfacing Freescale’s FRDM-STBC-AGM01 sensor module to FRDM-KL46Z using Kinetis Design Studio 3.0 Kinetis SDK 1.2 Processor-Expert&amp;quot; &amp;lt;</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_stbc_2D00_agm01">frdm-stbc-agm01</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_kl46z">frdm-kl46z</category></item><item><title>File: Demo: “Musical” Electrocardiogram (ECG) Project using Freescale FRDM-KL05Z Development Kit</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/144529</link><pubDate>Sat, 20 Nov 2021 13:45:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:0fe3b6ca-f1ad-4e1a-8311-a79c9be04c8d</guid><dc:creator>ciorga</dc:creator><description>demo</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/musical">musical</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/ecg">ecg</category></item><item><title>File: Bluetooth + xtrinsic sensor on android app</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/144521</link><pubDate>Sat, 20 Nov 2021 13:45:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:af3b5eb5-56b8-4e2d-9ea7-62e3e1fd073c</guid><dc:creator>bheemarao</dc:creator><description>Here is a video output of Bluetooth module interface HC-05 to xtrinsic sensor module to KL46Z freedom board and display the sensor data on android app “Blue Term”</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_kl46z">frdm-kl46z</category></item><item><title>File: RGB Led Toggle using KDS+SDK using K64F Freedom board</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/144517</link><pubDate>Sat, 20 Nov 2021 13:45:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:1aefb788-c060-4b71-bcdb-258111043908</guid><dc:creator>bheemarao</dc:creator><description>This is an output for a tutorial on toggling RGB Led’s on FRDM-K64F board using Kinetis Design Studio IDE and using Kinetis Software development kit (KSDK).</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/toggle">toggle</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/kds">kds</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/rgb">rgb</category></item><item><title>File: Nerfinator</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/144512</link><pubDate>Sat, 20 Nov 2021 13:45:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:afdbfabc-4961-416a-bcd6-1b982faf4e94</guid><dc:creator>bheemarao</dc:creator><description>This is just too fun of a project. We are using two FRDM-K64F boards, Nordic WiFi module, some servos, and mbed for my latest invention, the Nerfinator.</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/nerf">nerf</category></item><item><title>File: Freedom Ultrasonic</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/144100</link><pubDate>Wed, 10 Nov 2021 21:40:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8ccca5dd-d97e-4ef6-884d-34cda16bb1fa</guid><dc:creator>FreescaleTools_and_Software</dc:creator><description>Demonstration using the Freescale FRDM-KL25Z board with the HC-SR04 ultrasonic module and CodeWarrior.More details and the tutorial about this is available on http://mcuoneclipse.com/2013/01/01/tutorial-ultrasonic-ranging-with-the-freedom-boar</description></item><item><title>File: NXP Test Tool Video execution demo using FRDM-KW41Z</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/141403</link><pubDate>Wed, 10 Nov 2021 20:17:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4d870f6b-f376-40cd-9487-9ce32e37087c</guid><dc:creator>bheemarao</dc:creator><description>This is the video execution of MAC FSCI (Packet error rate) Radio test using FRDM-KW41Z board.</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/test_5F00_tool">test_tool</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_kw41z">frdm-kw41z</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/radio_5F00_test">radio_test</category></item><item><title>File: Wireless UART demo using KW41Z Kinetis BLE smart phone android app</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/141398</link><pubDate>Wed, 10 Nov 2021 20:17:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:fb4a4dd0-c33d-48e2-a491-b367c54d184b</guid><dc:creator>bheemarao</dc:creator><description>This is a Wireless UART demo using BLE method execution using one FRDM-KW41Z board and another from smart phone enabled Kinetis BLE Toolbox android app</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/kinetis%2bble%2btoolbox">kinetis ble toolbox</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/ble_2F00_802-15-4">ble/802.15.4</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/ble_2F00_802-15-4%2bintegrated%2btransceiver">ble/802.15.4 integrated transceiver</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_kw41z">frdm-kw41z</category></item><item><title>File: Video output execution of Wireless UART demo on FRDM-KW41Z</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/141397</link><pubDate>Wed, 10 Nov 2021 20:17:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:87c277f2-8587-4440-8ef0-c4d4112b7856</guid><dc:creator>bheemarao</dc:creator><description>This is a Wireless UART demo using BLE method execution on FRDM-KW41Z NXP Freedom board</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/ble_2F00_802-15-4%2bintegrated%2btransceiver">ble/802.15.4 integrated transceiver</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_kw41z">frdm-kw41z</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/wireless%2buart%2busing%2bble">wireless uart using ble</category></item><item><title>File: Video output execution of SMAC connectivity example</title><link>https://community.element14.com/products/devtools/kinetiskl2freedomboard/m/managed-videos/141388</link><pubDate>Wed, 10 Nov 2021 20:17:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:989e2e83-e9fe-45b4-ac7a-4f2aa470300c</guid><dc:creator>bheemarao</dc:creator><description>This is an SMAC connectivity demo application execution on FRDM-KW41Z NXP Freedom board.</description><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/ble_2F00_802-15-4%2bintegrated%2btransceiver">ble/802.15.4 integrated transceiver</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/frdm_2D00_kw41z">frdm-kw41z</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/connectivity%2btest%2bapplication">connectivity test application</category><category domain="https://community.element14.com/products/devtools/kinetiskl2freedomboard/tags/wireless%2bmcu%2b_2800_arm%2bcortex_2D00_m0_2B00_%2bbased_2900_">wireless mcu (arm cortex-m0+ based)</category></item></channel></rss>