Kinetis Microcontrollers Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinetis Microcontrollers Knowledge Base

Discussions

Basic explanation of the ADC module. Explicación básica del modulo de ADC.
View full article
I2C ( Inter-Integrated Circuit ) Module by Alejandro Lozano, Freescale TIC. i2C Protocol Explanation. Connection Diagram. How to configure the registers. Hands-On. Presentación del módulo de I2C ( Inter-Integrated Circuit ) por Alejandro Lozano, Freescale TIC. Explicación del Protocolo I2C. Diagrama de conexión. Explicación de cómo configurar los registros. Hands-On
View full article
UART Presentation ( universal asynchronous receiver/transmitter) by Ali Piña, Freescale TIC. Module Explanation Connection Diagram Hands-On. Polling mode. Interrupt Mode. Presentación de UART  ( universal asynchronous receiver/transmitter) by Ali Piña, Freescale TIC. a.       Explicación del modulo. b.      Diagrama de conexión. c.       Hands-On. Modo de Poleo Modo de Interrupción
View full article
Nested Vectored Interrupt Controller Module by Vicente Gómez Freescale TIC. NVIC Explanation Hands-on IRQ using a pin. Interruption timers. Presentación de la NVIC ( Nested Vectored Interrupt Controller ) por Vicente Gómez, Freescale TIC. Explicación de la NVIC. Hands-On IRQ usando un pin. Timers con interrupción
View full article
This is a presentation used to explain the Low Power Timer adapted by Vicente Gómez, Freescale TIC. LPTMR Module Explanation. Connection Diagram. Operation Modes Hands-On Configure a timer so that it generates an interruption every x time.  Explicación del Low Power Timer presentado por Vicente Gómez, Freescale TIC.- Explicación de los Modulos LPTMR . Diagrama de conexiones. Modos de operación Hands-on Configurar un timer para que genere una interrupción cada X tiempo.
View full article
The Multipurpose Clock Generator module explained by Ali Piña, Freescale TIC. MCG Module Explanation Connection Diagram Operation Modes Hands On Toggle a LED in FEI (FLL engaged Internal) switch to PEE (PLL Engaged External). Watch changes. Switch from different operation modes. El Módulo de MCG (Multipurpose Clock Generator) presentado por Ali Piña, Freescale TIC. Explicación del Modulo MCG. Diagrama de conexiones Modos de operación. Hands-On Togglear un LED en modo FEI (FLL engaged Internal) y cambiar a PEE(PLL Engaged External). Observar cambios. Moverse entre varios modos de operación
View full article
General Purpose Input/Output module presented by Jose Maria Casillas, Freescale TIC. Module explanation and alternative pin´s functions. Short explanation on the Bit Manipulation Engine (BME). Hands-On: LED RGB. Push Button. Módulo GPIO (General Purpose I/O) presentado por Jose María Casillas, Freescale TIC. Explicar el modulo y las funciones alternativas de los pines. Breve descripción del Bit Manipulation Engine (BME). Hands-On: LED RGB. Push Button.
View full article
Intro to Cortex-M0+ main features presented by Alejandro Lozano, Freescale, TIC. Intro to Cortex M0+. Kinetis L series description. Introducción al Cortex-M0+. Principales características presentadas por Alejandro Lozano, Freescale TIC. Introducción al Cortex-M0+ Descripción de la familia Kinetis L.
View full article
update of the FreeMASTER component
View full article
中文版:     想到过使用飞思卡尔的Freedom平台当做昂贵的J-Link调试器吗,好吧,这次给你机会了,呵呵。昨天在去SEGGER官网查资料的时候看到了一个suprise,Segger刚刚为OpenSDA平台release了一个可以兼容Jlink功能的firmware。说白了,就是借用OpenSDA当做J-Link用,当然有部分功能是有所限制的,不过瑕不掩瑜,Jlink的高速、稳定及一些特有的功能一直让接触过它的开发者印象深刻,所以能用low-cost的OpenSDA实现高性能的Jlink实在是让人兴奋,包括在下,哈哈,所以还等什么,赶紧露胳膊抹袖子整整吧,呵呵~     其实这次SEGGER提供的firmware就是OpenSDA的一个Application(我已经上传到本博客最后的附件中了),类似MSD-APP和DBUG-APP等其他的OpenSDA应用,所以它的使用方法类似,具体可以参考我之前的一篇博客《尝鲜OpenSDA方式调试仿真Freedom平台》 http://blog.chinaaet.com/detail/31795.html 。     (1)将firmware更新到OpenSDA的平台之后,再回到normal mode,这样就可以把OpenSDA当J-Link用了。将硬件连接好之后,打开J-Link Commander,弹出的窗口如下图所示,看吧,有点如假包换的J-Link味道了吧,呵呵,而且还有正版的S/N序列号哦。     (2)当然在IAR环境下使用它还需要简单的设置几步,如下图所示,建议不使用flash loader而是使用jlink自带的调试下载引擎,更稳定且速度杠杠的,呵呵:     (3)一切都准备好之后,就可以按照J-Link的调试方法调试Kinetis了,呵呵。当然有个最大的好处是,借用J-Link的特性,使用OpenSDA也可以支持Live watch了,可以实时更新观察变量,这点灰常灰常给力,如下图: Limitations:     当然我们也会猜到SEGGER不会那么蠢到自断财路(OpenSDA平台可是非常low-cost的),不然谁还会用那么昂贵的正版J-Link啊,呵呵。所以使用SEGGER提供的这个firmware有以下几点限制: 1)只能用在飞思卡尔平台基于ARM的产品上; 2)只可以调试飞思卡尔的评估板,所以貌似如果用在自己画的板子上可能有问题; 3)还有一个比较遗憾的,那就是不支持使用J-Flash软件(我一直觉着J-Flash很好用); 4)SEGGER不提供技术支持(这个我觉着无所谓)。     总体来说,还是利好的消息的,我还是灰常灰常看好OpenSDA的应用前景的,连SEGGER都低头兼容了,看来飞思卡尔以后调试器短板有望得到弥补,加油吧,呵呵。     不聊了,附件为更新的固件,未完待续~ /*****************************************************************************************************************************************/ English Version:    It feels realy good to see that SEGGER has offered a firmware running on the FRDM OpenSDA platform which makes OpenSDA compatible to J-Link lite, allowing users to take advantage of most J-Link features. It means we can do the same things with high-performance by using the low-cost OpenSDA platform. 1) How to do?    The J-Link firmware SEGGER offered is just an OpenSDA Application, so put the FRDM board into Bootloader mode and update the firmware , which is enclosed in the attached, just like other OpenSDA applications . Then put it into normal mode and the J-Link driver will be installed. Open the J-Link Commander, and we will see the diagram below. In IAR IDE, some setup steps need to follow: 2) Why to do?     Most inland customers get used to J-Link to debug ARM based products since ARM7 time and the J-Link is realy good debugger by my experience, althougn the legal J-Link is expensive. So we can help the customer to develop and evaluata products with low-cost OpenSDA platform.    In addition, live watch in IAR, which can update the varibles in time, is only supported with J-Link engine, which is very important to customer.   3) Limitations     May be used with ARM based Freescale devices only;     Only debugging on evaluation boards is allowed. Debugging on custom hardware is not supported and not allowed;     No production flash programming support;     Unlimited breakpoints in flash available for evaluation only;     No support is given. 4) Suggestions     OpenSDA is a very potential platform. USBDM has also released a firmware which is compatible to OpenSDA recently. So an open source OpenSDA  release from P&E is expected and to help customer to custom their own debugger hardware, which can help us to extend our Kinetis products more convenient. Voila, just give a try!
View full article
Hi, I have a project created by Processor Expert and CodeWarrior 10.2 for TWR-K20 demo kit. Becasue I have some problem to use the Processor Expert USB HID Keyboard Host of the USB stack 4.1.1, I need to change to add the non-PE USB HID Keyboard Host into the project. Can anyone tell me how to do it? It will be very appreciated to give me a simple 'PE' example project, and add the non-PE USB HID keyboard host stack. Thank you! Stanley
View full article
Update of FreeMASTER component for PE
View full article
Hello Community fellows! This time I would like to thank BlackNight for giving us great material to work on. There have been several posts inquiring the uses of USB stack and Processor Expert. The examples he has worked on and now shares with all of us, include this and many more useful concepts that you'll find interesting with the use of boards. For this issue he turns his FRDM-KL25Z into a generic USB keyboard device. With a simple button press he is able to send any keyboard actions to his laptop, making such as ‘print screen’ a single button press...isn't that amazing? :smileygrin: Well, I'll say no more, you better check it out yourself!  MCU on Eclipse by Erich Styger
View full article
R ecently, some customers have provided us with feedback stating they have been experiencing difficulties when connecting  Kinetis L series  microcontrollers using Multilink Universal probes, after checking the connection and software settings no obvious errors could be found. This recurrent problem has been confirmed by several customers, the  problem is caused by a long connection line. My suggestion is to keep connection line length to 10cm or less; otherwise, the IDE may not be able to establish the connection through the Multilink Universal.
View full article
Hi, all The default AN2295 UART bootloader doesn't work well on K21/other Kinetis because of using FEI and complicated autocalibration mechanism. I made a simple version to make it works on MK21DX128VMC5, FYI. Readm.txt: UART bootloader for K21. (Default is MK21DX128VMC5) 128KB_Pflash_64KB_Dflash.icf is application link script example for MK21DX128 used together with UART bootloader, UART bootloader use 0x0 - 0xFFF. Q: Why need this patch? A: The original AN2295 use internal RC and FLL output as system clock. The calibration mechanism is not stable. The main change of this patch is to use external cystal plus PLL as system clock to communicate with PC software. Changes to AN2295 1) Add MK21D5.h for K21 support 2) Add AN2295_TWR_K21_cfg.h for K21 support(Copy from AN2295_TWR_K60_cfg.h) 3) AN2295_TWR_K21_cfg.h    1> #define KINETIS_MODEL K21_50MHz    2> #define KINETIS_FLASH FLASH_128K    3> #define BOOT_UART_BASE UART2_BASE_PTR       #define BOOT_UART_GPIO_PORT PORTE_BASE_PTR       #define BOOT_UART_GPIO_PIN_RX   17       #define BOOT_UART_GPIO_PIN_TX   16    4> #define BOOT_PIN_ENABLE_NUM        7 4) Add mcg folder and mcg.c/mcg.h 5) kinetis_params.h:    1> Modify SRS_REG/SRS_POR_MASK/INIT_CLOCKS_TO_MODULES to meet MK21D5.h    2> Add PORT_PCR_PS_MASK for BOOTLOADER_PIN_ENABLE_INIT to enable Pull-up. 6) bootloader.h: #define BOOT_WAITING_TIMEOUT 500. PC software can't communicate to bootloader if only 1s delay. 7) bootloader.c:    1> #include "mcg.h"    2> Use 25MHz PEE:       SIM_CLKDIV1 = ( 0    | SIM_CLKDIV1_OUTDIV1(1)                            | SIM_CLKDIV1_OUTDIV2(1)                            | SIM_CLKDIV1_OUTDIV4(1));             (void)pll_init(8000000,       /* CLKIN0 frequency */                      LOW_POWER,     /* Set the oscillator for low power mode */                      CRYSTAL,       /* Crystal or canned oscillator clock input */                      4,             /* PLL predivider value */                      25,            /* PLL multiplier */                      MCGOUT);       /* Use the output from this PLL as the MCGOUT */    3> Restore to FEI mode before jump to Application:       pee_pbe(8000000);       pbe_fbe(8000000);       fbe_fei(32768); Knowing issues: 1) Don't use virtualCOM from OSJTAG, it's very hard to communicate with PC software. Use RS232 in TWR-SER2. 2) BOOTLOADER_CRC_ENABLE must be 0, otherwise PC software will report unknown protocol version
View full article
在 EEfocus 上有一个关于 Debug 模式和正常工作模式下进入低功耗模式的问题 , 总结了一下, Post 过来 Share 给大家。 问题现象: 使用串口接收中断,主函数进入睡眠。在调试过程中发现:只有在连接 jlink 调试下,串口可以正常收发数据,串口收到数据可以唤醒 mcu 。但在断开 jlink 情况下,不能正常收发数据。 所做尝试: 尝试过不在 VLPS 模式下,串口是可以正常中断接收数据的,也可以正常发送数据。另外,在使用过程中采用的是内部晶振,串口的时钟源是 FLL 。 主函数代码: while(1) { enter_vlps();  // 进入 vlps 模式 out_char(c); // 串口接收中断函数把字符赋给 c } 解答: 首先,在 VLPS 模式下, FLL 不能工作,也就无法输出 clock 时钟到 UART ,所以进入 VLPS 模式后 UART 不可以用 FLL 做时钟。 其次,在连 J-Link 调试时其实没有进入 VLPS 模式,而是进入了 STOP 模式,此时 FLL 是有输出的。在数据手册上的 MDM-AP Status Register 部分关于 LP 有讲到 :Usage intended for debug operation in which Run to VLPS is attempted. Per debug definition, the system actually enters the Stop state. 所以造成了连接 J-link 从表面上看起来是进入了 VLPS 模式 ( 其实是进入 Stop 模式 ) ,不连接 J-link 就无法正常工作了。
View full article
Hi everyone! I have made a simple touch sensing demo for KL25z Freedom board for fast user friendly test using MSD bootloader (default combined application in Open SDA when you receive the Freedom - Mass Storage Device and serial port). Demo changes the brightness of red led populated on the board and communicate with FreeMaster visualization tool over embedded virtual serial port of Open SDA connection. Touch sensing application is controlled by TSS (touch sensing softwere). For more information about touch sensing and download of TSS go to www.freescale.com/tss The visualization output has 2 separate scope windows: one showing signals captured from electrodes of slider another one showing position of finger on a slider The operation is really simple, just drag and drop the attached *.s19 file into your device using MSD bootloader (as other precompiled projects for Freedom board) open the *.pmp file that is associated with FreeMASTER, choose the correct COM port at speed of 38400 kbps and start communication The demo was made in CodeWarrior 10.4 using TSS library 3.0.1 in Processor Expert tool, source code can be provided if there will be an interest. There is no need to configure MAP file for FreeMaster communication, application uses so called TSA table - it is position independent this way. If you are not familiar with FreeMASTER or not have it installed in your PC - go to www.freescale.com/freemaster to read more and download the free installer, install it and you are good to run the demo. There are two independent snapshots below, showing the response to my finger movement along the slider Enjoy! and keep in touch
View full article
   在培训和论坛提问中,发现用户提出的很多问题都集中在如何有效的检索到“适合的开发工具 和 开发资源” 上。在此帖中,简单的介绍一下在飞思卡尔官方网站上查找到实用的开发资源的一些简单步骤,希望对大家有帮助。     通常学习和应用一款芯片是从选择一个 评估 /开发板 开始的,然后安装相应的 开发环境和硬件驱动 、最后结合芯片 Datasheet 、 Reference Manul 、 参考设计 和 官方例程 编写程序代码 完成项目开发。和其它行业一样,如今对于芯片厂商也流行提供一整套的解决方案,有现成的方案设计提供给客户,减少客户的时间成本,提高开发效率。可是在哪里能找到例程代码、参考设计、如何动手呢,对于很大部分不熟悉飞思卡尔官网的人来说,找到自己需要的资源就很困难,这里以 FSL Kinetis 系列芯片为例简单给大家介绍一 下 在 飞思卡尔官网资源 检索 的通常步骤。     首先,进入飞思卡尔的官网 www.freescale.com , 通常大家更习惯于中文,所以点击右上角“中文”选择显示中文,如图1,以后再次进入网站时,它都会自动默认中文显示。然后选择 “产品” -> 微控制器” 可以看到里面包括飞思卡尔MCU相关的产品,早期 8位/16位MCU、主要用于电机控制的DSC、Vybrid多核控制器,ColdFire架构MCU以及 ARM Cortex 架构的 Kinetis, 这里选择 Kinetis ARM Cortex MCU , 如图2 。 图1 图2        可以看到 Kinetis K 系列、 L 系列、 M 系列、 W 系列的一些 MCU ,这里选择 KL2 ,如图3,打开之后如图4可以看到很多调试仿真器、评估开发板、相关软件工具等,这里是一个资源合集。在 “文档” 栏目中能找到 KL2X 芯片的 Datasheet 、参考手册、应用笔记、用户指南 等等;在 “软件和工具” 栏目中能找到 KL2X 系列 MCU 可以使用的 仿真调试器、评估开发板、软件开发工具、中间件驱动程序 等 ; 图3  图4          如前文所讲,需要先找一个硬件开发平台,于是展开 “评估 / 开发板与系统” ,可以看到很多飞思卡尔公司提供的开发板,包括 FRDM-KL05Z ( KL0 系列 MCU ,不知为何放在这里)、 FRDM-KL25Z ( FRDM 板)、 TWR-KL2548M (塔形板)几个版本,这里我们选择使用最为广泛的的 FRDM-KL25Z ,点击进去,如图5, 就能看到对应于 KL25Z 的 Demo 板相关信息和资源,在 “文档” 栏目里有 KL25Z 相关的应用说明、用户手册等等;在 ” 下载 ” 栏目里能找到 FRDM-KL25Z 开发板的 电路原理图 、 例程代码 (含 Codewarrior 、 IAR 、 Keil 三个版本 )、 开发环境搭建用到的软件 以及告诉你如何 安装驱动的 QSG 文件 ;在 “购买/规格” 栏目里能看到开发板 购买的价格和途径,值得一提的是这款板不仅包括KL25Z芯片的最小系统,还板载了一个 OpenSDA 下载/调试器(既可以调试板载芯片,也可以引出调试其它器件),而价格只有 12.95$, 不到一百块人民币,可谓是超值。 图5      至此, 开发的软件环境、需要准备的硬件板、原理图、驱动软件、例程源代码、 DataSheet 、 User's Manua l 都知道在哪里获得了相应资源了,后续需要自己搭建环境,安装驱动,根据项目需要参照测试例程、 Datasheet 和 User's Manual 进行编程开发了。 至于 其他系列的芯片 Datasheet 、 User's Manual 、例程代码、开发环境等等资源 也可 以按照这个步骤进行检索。另外,飞思卡尔网站对一些重要的资源还提供了 快捷链接 ,如 KL25Z 开发板: www.freescale.com/FRDM-KL25Z , K60 的 100M 开发板: http://www.freescale.com/TWR-K60D100M , MQX操作系统: www.freescale.com/MQX , 技术支持: http://www.freescale.com/support 等等。     另外,大家还可以在官网上看到一些其他的技术信息,有问题也欢迎飞思卡尔官方社区 community.freescale.com 和EEFOCUS飞思卡尔社区 www.freescaleic.org/bbs/ 讨论和分享自己的问题和经验。
View full article
unexplained secured, unexplained locked and unexplained link error.
View full article
Recently I did a porting based on AN4370SW for a customer to support TWR-K20D72M, and with some modification in source code, header file and link file as well, it works well as expected. The following simple describes what I have done: 1.Copy the project file folder for K20D50M "AN4370SW\Source\Device\app\dfu_bootloader\iar_ew\kinetis_k20" and rename is as "kinetis_k20d70m" 2.Change the target settings as well as the flash loader. 3. Replace the header file for K20D50M and include it in derivative.h. The header file for K20D72M can be found from KINETIS_72MHz_SRC(http://cache.freescale.com/files/32bit/software/KINETIS_72MHz_SRC.zip?fpsp=1&WT_TYPE=Lab%20and%20Test%20Software&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=zip&WT_ASSET=Downloads&sr=9) 4.Modify the interrupt table in cstartup_M.s, which is more likely a K60's vertor table. 5.Search the code related with the macro "MCU_MK20D5", and add similar code snippet for K20D72M , You may easily find them by search the keyword "MCU_MK20D7". That code parts include initialization for MCG, and PIT0 and USB interrupt enablements, some definition in bootloader.h . 6. Copy the link file from K20D50M, and modify the PFLASH size,SRAM size and DFLASH size as shown below: Perform MassErase before programming . and then you may press the SW1 on TWR-K20D72M to select which mode to enter after download the application firmware: pressing SW1 to enter bootloader mode and releasing it to enter application mode. 7. Build image for this DFU bootloader. Actually the bareboard projects in KINETIS_72MHz_SRC can be used for that purpose, and only link file needs some modification to put the image starting from 0xA000, since exception table redirection has already been done in these projects. after that, user needs change some settings in the CW projects to use the new link file: and generate S19 file as the output as well as the map file: after compiling , you will have a xxx.afx.s19 file, but that is not the final format, we still need to transform it to bin format, and it can be done by a small tool in "C:\Program Files\Freescale\CW MCU v10.3\MCU\prog" There are some settings for this tool to transform the S19 file, by clicking Burner->Burner Dialog, you will see some option views, please set them as below: Referring to the above figure, maybe you would wonder how to set up the Origin and Length field, actually Origin is the value where the image starts from just as the link file specified , and Length is calculated by the results from the map file. Please refer to the following figure for details. 0x3550 = 0x1c90 + 0x18c0. I also attached the burner's configuration file and image link file as well as the image for reference. Please copy the link file in "KINETIS_72MHz_SRC\build\cw\linker_files". Please kindly refer to the attachment for more details. Hope that helps, B.R Kan
View full article