Kinetis Microcontrollers Knowledge Base

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

Kinetis Microcontrollers Knowledge Base

Discussions

Sort by:
Some early TWR-K64F120M Revision B boards were shipped with incorrect jumper configurations and demo application. Jumper settings should be: J39 shunt 1-2 J16 shunt 1-2 J29 shunt 1-2 J10 shunt 2-3 J15 shunt 2-3 Updated application demo code and Quick Start Guide can be found at https://www.nxp.com/TWR-K64F120M   TWR-K64F120M boards with updated jumper configurations and demo code will be tagged with a label marked TDA4906 on the bottom side of the board.
View full article
1. AN5218-使用LPUART实现ISO7816接口功能​ 2. AN4373-Cookbook for SAR ADC Measuresments 3. AN5160-低功耗模式下使用UART唤醒Kinetis L系列MCU的方法​ 4. AN4905-Kinetis MCU 上支持无晶振 USB​ 5. AN3298-Kinetis芯片焊接温度曲线控制​ 6. AN5034-FleIO模拟UART​ 7. AN4752-FreeMaster的使用方法​ 8. AN4282-使用Kinetis的FlexMemory作为EEPROM的方法​ 9. AN4655-使用I2C接口引导更新Kinetis L系列MCU​ 10. AN4368-使用U盘方式更新带USB Host功能的Kinetis固件程序​
View full article
Please note that the document shown above is an approximation of the original document.
View full article
Hi All, attached bootloader is a short program that allows possibility to update existing firmware in Kinetis-M microcontroller device. It consist of Master PC application and a tiny slave application that runs on target device. It uses UART communication.
View full article
      The MKW01Z device is highly-integrated, cost-effective, smart radio, sub-1 GHz wireless node solution composed of a transceiver supporting FSK, GFSK, MSK, or OOK modulations with a low-power ARM® Cortex M0+ CPU. The highly integrated RF transceiver operates over a wide frequency range including 315 MHz, 433 MHz, 470 MHz, 868 MHz, 915MHz, 928 MHz, and 955 MHz in the license-free Industrial, Scientific and Medical (ISM) frequency bands. This configuration allows users to minimize the use of external components.      The MPXY8600 is a sensor for use in applications that monitor tire pressure and temperature. It contains the pressure and temperature sensors, an X-axis and a Z-axis accelerometer, a microcontroller, an LF receiver and an RF transmitter all within a single package.        This setup offer customers to utilize Freescale MPXY8600/8700 as transmitter and MKW01 as receiver to form 315MHz, 433.92MHz TPMS transmitter and receiver  total solution.
View full article
    不得不说Keil貌似是国内用户使用最多的IDE了,其被ARM收购之后,ARM嵌入了ARMCC等编译器推出了Keil MDK开发环境更是受到了广大ARM开发工程师的欢迎,庞大的用户群(很多是从当年的51等8位机直接转过来的)、简洁的管理窗口和友好的UI界面等优势都让其风靡一时,而且毕竟现在成了ARM的“亲儿子”了,其对ARM内核的产品支持还是灰常不错的。     而GCC更是大名鼎鼎,这个至今仍然在维护的GNU项目下的产物,在N多大牛的维护下不断得到优化,其强大的编译效率和跨平台能力也是广为大家所认可(Codewarrior10.x之后,针对ARM的编译器就是集成了GCC)。     而本文的目的是针对那些想从GCC平台迁移到Keil MDK平台的开发者(并不是代表ARMCC比GCC好,这里不拿这两者做对比),可能用习惯了GCC的话移植到ARMCC下会有些差别需要注意,如匿名的联合体union在ARMCC下是不支持的,要想再ARMCC下使用需要在前面添加“#pragma anon_unions”,而这种格式在GCC却是直接支持的。     而如果开发者想将原来在GCC下的工程整体迁移到Kei MDK下,如果工程里存在大量的这种定义,那人为的一条条修改绝对是一件让人抓破头皮的事,呵呵,那有没有简单的一蹴而就的方法呢?咳咳,我都这样说了那肯定就有啦,有点卖关子了,呵呵,其实很简单,我们进入到Project->Options…,设置如下图所示,即添加“--gnu”即可实现在Keil工程下使用GNU工具链GCC来编译工程C文件了,是不是有点太简单了,呵呵。     当然最后我需要提一句,这个“--gnu”是添加在C/C++这个选项卡下的,如果你最开始使用Keil重新新建的一个工程并添加了Keil自动生成的启动代码的话(startup_xxx.s)请慎用在ASM选项卡下添加“--gnu”,因为ARMCC下的汇编格式是与GCC完全不一样的,所以用GCC来编译Keil下生成的汇编是不行的,这点需要注意。
View full article
¡ FELICIDADES AL GANADOR! El sábado 7 de diciembre se realizó la final del Kinetis L MCU Challenge México en las instalaciones del Centro de Congresos, Tecnológico de Monterrey Campus Guadalajara; donde se eligió al ganador a través de las redes sociales y la herramienta RankTab. La emoción se sintió entre los participantes durante la votación; al finalizar el conteo de votos y calificaciones en Ranktab ¡obtuvimos un ganador! Nos complace presentar a: Andrés Gafford con el proyecto Tablet Braille para Invidentes como el ganador del Kinetis L MCU Challenge México 2013. Quién se irá de viaje con todos los gastos pagados al Freescale Technology Forum (FTF) en Dallas, Texas del 8 al 11 de abril del 2014. Agradecemos a los finalistas por su esfuerzo y participación en el evento;  también agradecemos a todas las personas que nos ayudaron con su calificación y voto a elegir el mejor de los proyectos. Esperamos que esta competencia haya sido un semillero de grandes ideas que se conviertan en las innovaciones del mañana.
View full article
The SAI of Kinetis supports 4 modes:normal mode, network mode, I2S mode, AC97 mode, the documentation give the brief introduction about the 4 modes, give the waveform of the 4 modes.
View full article
On NXP website we had provide an application note " Kinetis-M Two-Phase Power Meter Reference Design" which can been found here: http://www.nxp.com/docs/en/application-note/DRM149.pdf  This is really a quite useful solution for 2-Phase Power Meter design. From the schematic, there has a LCD display. Many customer sent email to ask for the datasheet of this LCD display(GDH-1247WP). Yes agreed, it is really difficult to find it. ( Even from the google.) I am attaching the data sheet for the segment LCD here for customer to make reference.
View full article
Today the universal motor is still widely used in home appliances such as vacuum cleaners, washers, hand tools, and food processors. The operational mode, which is used in this application, is closed loop and regulated speed. This mode requires a speed sensor on the motor shaft. Such a sensor is usually an incremental sensor or a tachometer generator. The kind of motor and its drive have a high impact on many home appliance features like cost, size, noise, and efficiency. Electronic control is usually necessary when variables speed or energy savings are required. MCUs offer the advantages of low cost and attractive design. They can operate with only a few external components and reduce the energy consumption as well as the cost. This circuit was designed as a simple schematic using key features of a Kinetis L MCU. For demonstration purposes, the Freescale low cost Freedom KL25z development platform was used. This application note describes the design of a low-cost phase angle motor control drive system based on Freescales’s Kinetis L series microcontroller (MCU) and the MAC4DC snubberless triac. The low-cost single-phase power board is dedicated for universal brushed motors operating from 1000 RPMs to 15,000 RPMs. This application note explains both HW and SW design with an ARM Kinetis L series MCU. Such a low-cost MCU is powerful enough to do the whole job necessary for driving a closed loop phase angle system as well as many others algorithms.        -Freedom development platform with universal motor drive board extension The phase angle control technique is used to adjust the voltage applied to the motor. A phase shift of the gate’s pulses allows the effective voltage, seen by the motor, to be varied. All required functions are performed by just one integrated circuit and a small number of external components. This allows a compact printed circuit board (PCB) design and a cost-effective solution. Learn more about the Kinetis L series Freedom Board Get the full application note in the link bellow:
View full article
The mbed Compiler delivers full online editor. it provides a lightweight online C/C++ IDE that is pre-configured to let you quickly write programs, compile and download them to run on your mbed Microcontroller. The only weakness is that it doesn’t have debug feature. In fact, you don't have to install or set up anything to get running with mbed. Because it is a web app, you can log in from anywhere and carry on where you left off, and you are free to work on Windows, Mac, iOS, Android, Linux, or all of them. Currently, mbed Compiler support: FRDM-KL25Z FRDM-KL46Z FRDM-KL05Z FRDM-K20D50M FRDM-K22F Ethernet IoT Starter Kit This article will introduce how to use mbed Compiler to develop code on Freescale FRDM board. Summary:  we can use mbed Online Compiler edit, build, generate binary file. But CAN’T debug. With mbed FRDM KL25z Upgrade pakage, we can burn binary file to board with drag and drop. Its really simple, and it's free, because it is a web based compiler, multi-platforms are supported. so lets get started!
View full article
Introduction What is a gated timer and why would I need one? A gated timer is a timer whose clock is enabled (or "gated") by some external signal.  This allows for a low code overhead method of synchronizing a timer with an event and/or measuring an event. This functionality is not commonly included on Freescale microcontroller devices (this functionality is only included on devices that are equipped with the upgraded TPM v2 peripheral; currently K66, K65, KL13, KL23, KL33, KL43, KL03) but can be useful in some situations.  Some applications which may find a gated timer useful include asynchronous digital sampling, pulse width duty cycle measurement, and battery charging. How do I implement a gated timer with my Kinetis FTM or TPM peripheral? To implement a true gated timer with a Kinetis device (that does not have the TPM v2 peripheral), additional hardware will be required to implement the enable/disable functionality of a gated timer.  This note will focus on two different ways (low-true and high-true) to implement a gated timer.  The method used will depend on the requirements of your application. Implementing a gated timer for Kinetis devices without the TPM v2 peripheral requires the use of a comparator and a resistive network to implement a gated functionality (NOTE:  Level shifters could be used to replace the resistive network described; however, a resistive network is likely more cost effective, and thus, is presented in this discussion).  Figure 1 below is the block diagram of how to implement a gated timer functionality.  The theory behind this configuration will be explained in later sections. Theory of Operation Comparator and resistive network implementation The comparator is the key piece to implementing this functionality. For those with little experience with comparators (or need a refresher), a comparator is represented by the following figure.  Notice that there are three terminals that will be of relevance in this application: a non-inverting input (labeled with a '+' sign), an inverting input (labeled with a '-' sign), and an output. A comparator does just what the name suggests: it compares two signals and adjusts the output based on the result of the comparison.  This is represented mathematically in the figure below. Considering the above figure, output of the comparator will be a  logic high when the non-inverting input is at a higher electric potential than the inverting input.  The output will be a logic low if the non-inverting input is at a lower electric potential than the inverting input.  The output will be unpredictable if the inputs are exactly the same (oscillations may even occur since comparators are designed to drive the output to a solid high or solid low).  This mechanism allows the clock enable functionality that is required to implement a gated timer function provided that either the non-inverting or inverting input is a clock waveform and the opposite input is a stable logic high or low (depending on the desired configuration) and neither input is ever exactly equal.  Comparator Configurations There are two basic signal configurations that an application can use to enable the clock output out of the comparator: low-true signals and high-true signals.  These two signals and some details on their implementation are explained in the following two sections.  Low-true enable A low-true enable is an enable signal that will have zero electric potential (relative to the microcontroller) or a "grounded" signal in the "active" state.  This configuration is a common implementation when using a push button or momentary switch to provide the enable signal.  When using this type of signal, you will want to connect the enable signal to the non-inverting input of the comparator, and connect the clock signal to the inverting input. The high level of the enable signal should be guaranteed to always be the highest voltage of the input clock plus the maximum input offset of the comparator. To find the maximum input offset of the comparator, consult the device specific datasheet.  See the figure below to see a graphical representation of areas where the signal will be on and off. The external hardware used should ensure that the low level of the enable signal never dips below the lowest voltage of the input clock plus the maximum input offset of the comparator. The following figure displays one possible hardware configuration that is relatively inexpensive and can satisfy these requirements. High-true enable A high-true enable is an enable signal that will have an electric potential equal to VDD of the microcontroller in the "active" state.  This configuration is commonly implemented when the enable signal is provided by an active source or another microcontroller.  When interfacing with this type of signal, you will want to connect the enable signal to the inverting input of the comparator, and connect the clock signal to the non-inverting input.  When the comparator is in the inactive state, it should be at or below the lowest voltage of the clock signal minus the maximum input offset of the comparator.  Refer to the following figure for a diagram of the "on" and "off" regions of the high true configurations. The external hardware will need to guarantee that the when the enable signal is in the active state, it does not rise above the highest voltage of the clock signal minus the maximum input offset of the comparator. The following figure displays one possible hardware configuration that is relatively inexpensive and can satisfy these requirements. Clocking Options Clocking waveform requirements will vary from application to application.  Specifying all of the possibilities is nearly impossible.  The point of this section is to inform what options are available from the Kinetis family and provide some insight as to when it might be relevant to investigate each option. The Kinetis family provides a clock output pin for most devices to allow an internal clock to be routed to a pin.  The uses for this option can vary.  In this particular scenario, it will be used to provide the source clock for the comparator clock input. Here are the most common clock output pin options across the Kinetis K series devices.  (NOTE:  If the application requires a clock frequency that the CLKOUT signal cannot provide, a separate FTM or TPM instance or another timer module can be used to generate the required clock.) In the Kinetis L series devices, the following options will be available. The clock option selected should be the slowest allowable clock for the application being designed.  This will minimize the power consumption of the application.  For applications that require high resolution, the Bus, Flash, or Flexbus clock should be selected (note that the Flexbus clock can provide an independently adjustable clock, if it is not being used in the application, as it is always running).  However, if the target application needs to be more power efficient, the LPO or MCGIRCLK should be used.  The LPO for the Kinetis devices is a fixed 1 kHz frequency and will, therefore, only be useful in applications that require millisecond resolutions.
View full article
This sample is to use two FRDM-KL02Z to testing the I2C.  By working at 400KHz baud rate, some customer may found the I2C_SDA will generating a dig when failing edge of the I2C_CLK.  Actually it should related with I2C port layout and the question is why this happen and how to get rid of the dig? The truth is I2C pins are open drain, so no one actually drives a high value. The high value is only there because of a pullup resistor on the lines. For the case to connect two of FRDM-KL02Z using the I2C0_SCL and I2C0_SDA lines that are available on J7, these lines are also used for connecting to the inertial sensor that is on the board, and there are 4.7K pullups on both lines. Problem is that there are 4.7K pullups on the lines on both boards, so the pullups are weaker than intended. So customer should remove the pullup resistors from one of the two boards that should help. We even recommend customer might need to replace the 4.7K pullups with an even stronger pullup though when they have more devices on the I2C bus that are all adding loading.
View full article
NXP 的BLE芯片目前包括QN902x 和 Kinetis KW3x两大系列,NXP BLE Solution 主页为:Bluetooth Smart|Bluetooth Low Energy|BLE|恩智浦 1)QN902x系列包括QN9020和QN9021,他们主要区别是封装不同,QN9020为QFN48(6x6mm),QN9021为QFN32(5x5mm)。QN902x的主要技术参数如下: 》Cortex- M0内核 》支持BLE4.1 》96Kb ROM,128Kb SPI Flash ,64Kb RAM 。代码在RAM中执行 》最高工作频率32Mhz 》输出功率:-20~4dBm;接收灵敏度:-95dBm 》功耗:接收电流:9.25mA,发送电流:8.8mA ,sleep mode:3uA 该芯片的datasheet:http://cache.nxp.com/documents/data_sheet/QN902X.pdf?fpsp=1&WT_TYPE=Data%20Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf… 官方的评估板为QN9020DK,链接为:高度可扩展的QN9020应用开发平台|恩智浦 另外一第三方公司也有一套开发板,可用来评估QN902x芯片,其连接地址为:FireBLE - Firefly wiki 2)KW3x,包括KW30和KW31两个系列,KW30 具体信息可以参考:KW30Z|Kinetis Bluetooth Low Energy MCU|恩智浦 KW31具体信息可以参考:KW31ZlKinetis BLE无线MCU|恩智浦 随便说下,NXP还有一个KW4x系列,该芯片可以同时支持Zigbee和BLE,它包括KW40和KW41,主页分别为:KW40Z|Kinetis BLE & 802.15.4无线MCU|恩智浦 和KW41ZlKinetis BLE & 802.15.4无线MCU|恩智浦
View full article
First let us see the clock tree: Core clock up to 112M, Bus clock up to 56M, Flash clock up to 28M. Clock can been from: System OSC、Slow IRC 、Fast IRC and System PLL 1. OSC SCG_SOSCCFG 2. PLL configuration formula: SPLL_CLK = (VCO_CLK)/2 VCO_CLK = SOSC_CLK/(PREDIV + 1) *(MULT + 16)  3. SCG_SPLLCSR void SystemClockInit(void) { SCG->SOSCCFG = 0x3C; SCG->SOSCCSR |= 1<<0; /* SOSCEN=1 enable SOSC clock */ /*wait clock active*/ while((SCG->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK) == 0); SCG->SPLLCSR &= ~(0x1<<0) ; /* SPLLEN=0: disable PLL*/ SCG->SPLLCFG &= ~(0x7<<8); /* PREDIV=0: 1 */ SCG->SPLLCFG |= 0xCU<<16; /* MULT=12: 28   PLL VCO = 8/1*(12+16) = 224M */ SCG->SPLLCSR |= 0x1<<0; /* SPLLEN=1: enable PLL */ /* wait PLL active*/ while((SCG->SPLLCSR & SCG_SPLLCSR_SPLLVLD_MASK) == 0); SCG->RCCR |= SCG_RCCR_DIVCORE(0); /* DIVCORE=0: 1, CORE/SYS_CLK  112MHz */ SCG->RCCR |= SCG_RCCR_DIVBUS(1); /* DIVBUS=1: 2, BUS_CLK  56MHz */ SCG->RCCR |= SCG_RCCR_DIVSLOW(3); /* DIVSLOW=2: 4   FLASH_CLK  is 28MHz */ SCG->RCCR &= 0xFEFFFFFF; /* Initially set to SIRC so that LSB could be set as '0' */ SCG->RCCR |= SCG_RCCR_SCS(6); /* SCS=6: system clock System PLL */ }
View full article
       上篇详细的介绍了加密锁定Kinetis的一种方法,本篇再接再厉,给大家再介绍一种加密方法(哎,这点家底都晒出来了)。当然实际上原理还是不变的,即还是通过修改0x400~0x40F地址段的内容来实现加密锁定,万变不离其宗,所谓殊途同归罢了,下面好戏登台:        既然实现security最终都是改写寄存器加载段flash地址的内容,那实际上修改flash内容的方式还是灵活多变的,方案一中提到的在中断向量表的最后添加flash配置信息只是其中一种,那还有哪些呢?还是不摆谱了,小心被拍砖,哈哈。不错,那就是通过在指定地址定义常量的方法,当然定义常量大家都会用到(有些应用譬如LCD显示的字模或者一些固定的查找表为节省RAM空间我们一般会选择定义const常量的方法将它们存放到flash空间中),但是指定地址的存放方式用的会少些(一般都是让编译器自动分配的),如果我们非要指定地址呢(哎,强迫症又开始了,呵呵),即将flash配置信息作为常量强制指定存放到0x400起始的地址,那岂不是跟方案一有了异曲同工之妙了,好吧,这样的话那就该“@”这位老兄上场了(咳咳,可不是给单片机发email啊,呵呵),相信很多人到此处就都明白了。下面我仍然以IAR环境下锁定K60为例,简单介绍下方案二的使用步骤: 1. 打开待加密工程中的main.c文件,在其中的main函数之前以添加如下图所示常量定义,即将FlashConfig数据组数据存放到“.flashConfig”段中,其中FlashConfig[11]即为0x40C地址: 2. 至于这个.flashConfig段属性是需要在与该工程匹配的IAR连接文件(.icf文件)中人为添加定义的,如下图所示,需要添加三个部分,然后保存: 3. 前两步完成之后,其实需要添加的部分就已经完成了,但是还有特别重要的两点需要注意,这里我加红注释一下,如下: (1)采用方案二的情况,需要确保vectors.c中中断向量表最后的16个字节没有被添加,即不能有4个CONIFG_x配置信息的,否则会出现编译错误,因为这就涉及到两者冲突的问题,也就是说在采用方案一的话就不能采用方案二,同理,采用方案二的话也不能采用方案一,总之两者不能同存; (2)还需要考虑编译器优化的问题,因为我们在.flashConfig段定义了常量,但是在代码程序里却没有使用它,这种情况下编译器会直接把这段常量优化掉,所以我们做的工作算是白做了,即使我们在IAR的优化等级中设置成low或者none都不行,因为人家编译器认死理儿,反正你也没有使用它,我就是怕它pass掉,这下子伤心了,呵呵。还好IAR给我们留了条后路,在options->Linker->Input选项卡中提供了Keep symbol功能,如下图,将FlashConfig添加进去即可强制编译不优化它,这样目的就达到了,呵呵,看来还是天无绝人之路啊有木有。 3. 编译通过,下载调试,程序下载之后同样会出现进入不到调试窗口的现象,这个是正常现象,因为这个时候芯片就已经被security了,这样就可以放心量产了,呵呵~       希望这两篇系列文章能对大家有所帮助,enjoy it~
View full article
1. USB Multilink Universal    支持 Kinetis, HCS08, HC(S)12(X), S12Z, RS08, ColdFire V1/+V1, ColdFire V2-4*, Qorivva 5xxx, DSC.    PE Micro, http://www.pemicro.com/ 2. USB Multilink Universal FX    支持 Kinetis, Qorivva MPC5xxx, ColdFire +V1/ColdFire V1, ColdFire V2/3/4, HC(S)12(X), S12Z, HCS08, RS08, DSC, 683xx, HC16.    PE Micro, http://www.pemicro.com/ 3. J-Link    支持飞思卡尔ARM based Microcontroller Kinetis.    可以配合PC端的软件JFlash对目标板进行烧写。    Segger, http://www.segger.com 4. ULink2    支持飞思卡尔ARM based Microcontroller Kinetis.    Keil, http://www.keil.com/arm/ulink/ 5. USBDM    开源调试器    可以配合PC端的上位机对目标板进行烧写。    http://usbdm.sourceforge.net/    https://github.com/podonoghue    http://sourceforge.net/projects/usbdm/ 6. CMSIS-DAP    ARM公司开源调试器    仿真器相关介绍页: http://mbed.org/handbook/cmsis-dap-interface-firmware    仿真器的源码下载: https://github.com/mbedmicro/CMSIS-DAP 7. OpenSDA     P&E Microcomputer Systems
View full article
For Jorge_Gonzalez Subject: MKE04 interrupt latency in Kinetis microcontrollers This is the code I was using to measure interrupt latency. David Hollinrake
View full article
The Kinetis K70 MCU family includes 512KB-1MB of flash memory, a single precision floating point unit, Graphic LCD Controller, IEEE 1588 Ethernet, full- and high-speed USB 2.0 On-The-Go with device charge detect, hardware encryption, tamper detection capabilities and a NAND flash controller. 256-pin devices include a DRAM controller for system expansion. The Kinetis K70 family is available in 196 and 256 pin MAPBGA packages. For more information visit www.freescale.com/kinetis
View full article
You probably have heard of what's new on Kinetis side of the house. YES, talking about KL02, measuring only 1.9mm x 2.0mm. Take a look at the picture in which this powerful ARM based chip gets compared real scale, and being this tiny yet delivers 60 percent more GPIO than the nearest competing MCU. :smileygrin:!!!
View full article