Kinetis Microcontrollers Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Kinetis Microcontrollers Knowledge Base

Discussions

Sort by:
Timer PWM Module presented by Ali Piña. Module Explanation Connection Diagram Output compare Configuration Hands-On Input Campture Configuration Hands-On Overflow Configuration Hands-On Modulo de Timer y PWM presentado por Ali Piña. Explicación del modulo. Diagrama de conexión. Configuración para output compare. Hands-on Configuración como Input Capture. Hands-On Configuración del Overflow. Hands-On
View full article
This application note provides guidelines on Kinetis K53 family for using the internal Operational Amplifiers (OPAMP), Transimpedance Amplifiers (TRIAMP), and the Analog-to-Digital Converter (ADC) modules to measure the temperature through a thermocouple and a thermistor and the result is shown on a LCD display using the LCD Controller (LCD) module. All these modules are available on the K53 MCU. The application uses different OPAMP configurations, such as internal gain and external gain using external resistor. TWR-K53N512 board was used as base hardware for performing this application. Watch the Freescale Kinetis K53 family in action. The internal Operational Amplifiers (OPAMP), Transimpedance Amplifiers (TRIAMP), and the Analog-to-Digital Converter (ADC) modules are used to measure the temperature through a thermocouple and a thermistor. The result is shown on a LCD display using the LCD Controller (LCD). Get the full Application Note
View full article
  当我们在使用Keil 时,经常会遇到无法下载程序的问题,以下对两种常见的情况进行总结:    1. 在我们需要将某工程代码移植到同系列其他型号器件上使用时,如果只是更改了器件型号,这时可能会导致无法正确下载。需要注意的是不仅要在Device中更换型号,还需要在Flash Download栏中选择正确的flash loader 并且设置正确的RAM起始地址。   举个例子:假设我们需要将FRDM_KL26的Sample code中的hello_world工程移植到256K flash的KL26上使用。打开FRDM_KL26的Sample code中hello_world工程,我们可以看到Device中器件为MKL26Z128xxx4,        在Target中可以看到Flash和RAM的起始地址和大小信息。          如果使用Jlink调试接口,选择J-LINK/J-TRACE Cortex  ,之后选择Setting,可以看到flash loader的相关信息。         将此工程移植到到256K flash的器件上,我们需要做的事情是:      在device中进行修改,选择MKL26Z256xxx4               在Target中可以看到这时flash和RAM的起始地址和大小信息已经自动做了更改。不需要再手动修改了。         但是在Flash Download中的设置还是之前的设置,并没有改变。           所以这时是无法正确下载程序的,需要我们手动去修改这里的两处配置。     一是 RAM for Algorithm中的Start应该设置为0x1FFFE000(从Target栏中可以获取该值),Size不用更改。      二是Program Algorithm 删除掉128k的flash loader ,添加256K的flash loader。       2.第二种可能遇到的情况是:本来可以正常下载的程序当复制到另外一台电脑时就无法正常下载了。遇到这种现象时,需要检查一下Flash Download中的相关配置是否正确,很可能会遇到 Program Algorithm中flashloder为空的情况,发生这种情况的原因可能是两个电脑的Keil版本不同,所以flash loader所在路径就会不同,这样flash loader就会变成空白,这时需要自己手动添加一下即可。
View full article
To do: Implement a program that lets the 4 LEDs on the Tower toggle all together using the PIT Interrupt. For easy debugging, let the program run in the RAM. * toggle period 0.5 s, * extract vector table and service routines in 'vector.c. Hint: Use the 'arm_cm4.c and 'arm_cm4.h' from the freescale kinetis homepage, which include access functions for the NVIC. For ease of use, these routines are included in the result file. Result: TWR_K60_PIT0.zip
View full article
中文版本:     相信很多博友在调试ARM代码的时候,尤其是涉及到操作底层的时候,由于一些误操作常常会遇到Hard fault错误或者程序跑飞的情况,这些bug采用正常的方法是比较难定位的,往往需要我们逐行去排查测试,最后看的眼花缭乱,永远给人以苦逼程序员的印象,呵呵。此篇内容致力于节省广大程序员的精力,以崭新的一种方法角度或者说是手段来定位跟踪bug(仅限于支持Coresight技术的ARM处理器,本篇只讲针对M0+内核的),故冠之以“原创猛料”之称号,希望能名副其实,好了,闲话不多说,呵呵,开整……     ARM的Coresight技术估计大家有所耳闻(没听过的可以参考我之前的一篇介绍类文章http://blog.chinaaet.com/detail/29770.html),它实际上包括了ARM嵌入到其处理器内核的片上跟踪调试组件和相关的配套系统软件标准之类的,方便我们开发调试ARM产品。可能单说Coresight技术有点太泛了,把它具体化的话就不得不提到ETB(Embeded Trace Buffer)和MTB(Micro Trace Buffer)这两个经典的模块,其中ETB模块是Cortex-M3/M4内核的片上跟踪单元,而MTB模块则是Cortex-M0/M0+内核的跟踪单元。不过估计很多人没有用过,所以我就本着“吃螃蟹”的态度去尝试了一番,结果还是挺让我惊喜的,灰常好用,所以下面我就把使用方法分享给大家供大家评估,本文以MTB模块调试飞思卡尔基于Cortex-M0+内核的Kinetis L系列为例:     在介绍使用方法之前需要提一下,目前我测试的结果是J-link暂不支持MTB模块(但是支持ETB模块),所以我使用了OpenSDA平台的CMSIS-DAP固件来调用MTB模块,所以如果你手中有Kinetis L系列的Freedom板的话就直接可以跟我做了,其中CMSIS-DAP固件在本博客附件中,使用方法仍旧是类似更新OpenSDA的应用,不过换过CMSIS-DAP固件之后OpenSDA的小灯可能不亮,这个纯属正常,不要惊慌,哈哈。 测试环境:IAR6.6 + Freedom OpenSDA(CMSIS-DAP firmware) 测试目标芯片:Kinetis MKL25Z128     1)打开一个KL25的demo例程,然后右键工程Options->Debugger,选择“CMSIS-DAP”调试器,然后其他默认即可,设置完毕,点击“OK”,如下图所示:     2)点击调试按钮,进入调试界面,此时菜单栏会出现CMSIS-DAP选项,选择CMSIS-DAP->ETM Trace,调用MTB模块,弹出跟踪窗口,如下图所示。默认情况下跟踪功能是禁止的,此时点击跟踪窗口ETM Trace左上角的“电源符号”,打开跟踪功能,此时调试界面的左上角的ETM显示绿色,表示已经打开;     3)此时MTB功能已经打开,我们可以点击“全速运行”,然后再点击“暂停”,此时就可以在ETM Trace跟踪窗口看到从运行到断点停止这段时间所有的指令执行情况了,非常直观,如下图所示,此外可以选择同时查看汇编和C语言,也可以保存跟踪的结果,进而分析程序执行情况。     说到这,我们就该想到这种方式的好处了吧,如果遇到Hardfault或者程序跑飞的时候,通过设置断点或者点击暂停,然后就可以捕捉到出现hardfault或者程序跑飞的之前的程序执行情况从而帮助我们快速定位到bug的地方,非常方便实用。此外,实用CMSIS-DAP调试工具还有一个好处是,可以使用很多插件了,比如Timeline等等,灰常不错,哈哈~ English Version:     As we know, ARM Coresight, the ARM debug and trace technology, is the most complete on-chip debug and real-time trace solution for the entire System-On-Chip(SoC), making the ARM processor-based SoCs the easiest to debug and optimize. In this technology, the ETB in  Cortex-M3/M4 and MTB in Cortex-M0/M0+ are representative two units, which can effectively help us to monitor the process of software executing or focus on some hard faults by tracing the instructions.     In the article, I wanna introduce the MTB useage in our product Kineits L series, which may be helpful to some customers using KL chip. But, before that, a CMSIS-DAP firmware for OpenSDA platform is needed, which you can find in the attachment of this article. So far as I know, it seems that J-Link don't support MTB yet, but do support ETB of Cortex-M4. Testing Platform:     IAR EWARM6.6 + FRDM KL25 (OpenSDA with CMSIS-DAP fimware) Testing steps:     1) firstly, update the OpenSDA with CMSIS-DAP fimware, just like other OpenSDA applications;     2) open any KL25 demo with IAR, access project setting "Options->Debugger", and select the "CMSIS-DAP" adapter as the screenshot shown below;     3) click the debug button to access thw debug window, then click the CMSIS-DAP->ETM Trace from the menu bar,  and the ETM trace window will appear. Note that, the trace function is disabled in default, so another step is needed to click the "power port" at the top left corner to enable the trace function. The screenshot shows it below;     4) Now, the MTB is working. We can try it by click "run" and wait a while to click "pause", then the instructions from run to pause are shown in the trace window, it is really convenient. Besides, we can save, clear or zoom the trace results. Conclution:    Through the above method, some painstaking issues like hardfault or program fleet can be captured simply by setting breakpoints or mannuly pause, which can help to positioning the source of the problem. Beyong that, the CMSIS-DAP can support plugs like timeline tool. BTW, it is a pity that MTB unit in the new Kinetis E series is cut out.         Happy Tracing!
View full article
for M68HC08, HCS08, ColdFire and Kinetis MCUs by: Pavel Lajsner, Pavel Krenek, Petr Gargulak Freescale Czech System Center Roznov p.R., Czech Republic The developer's serial bootloader offers to user easiest possible way how to update existing firmware on most of Freescale microcontrollers in-circuit. In-circuit programming is not intended to replace any of debuging and developing tool but it serves only as simple option of embedded system reprograming via serial asynchronous port or USB. The developer’s serial bootloader supported microcotrollers includes 8-bit families HC08, HCS08 and 32-bit families ColdFire, Kinetis. New Kinetis families include support for K series and L series. This application note is for embedded-software developers interested in alternative reprogramming tools. Because of its ability to modify MCU memory in-circuit, the serial bootloader is a utility that may be useful in developing applications. The developer’s serial bootloader is a complementary utility for either demo purposes or applications originally developed using MMDS and requiring minor modifications to be done in-circuit. The serial bootloader offers a zero-cost solution to applications already equipped with a serial interface and SCI pins available on a connector. This document also describes other programming techniques: FLASH reprogramming using ROM routines Simple software SCI Software for USB (HC08JW, HCS08JM and MCF51JM MCUs) Use of the internal clock generator PLL clock programming EEPROM programming (AS/AZ HC08 families) CRC protection of serial protocol option NOTE: QUICK LINKS The Master applications user guides: Section 10, Master applications user guides. The description of Kinetis version of protocol including the changes in user application: Section 7, FC Protocol, Version 5, Kinetis. The quick start guide how to modify the user Kinetis application to be ready for AN2295 bootloader: Section 7.8, Quick guide: How to prepare the user Kinetis application for AN2295 bootloader.
View full article