Kinetis Microcontrollers Knowledge Base

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

Kinetis Microcontrollers Knowledge Base

Discussions

Sort by:
Hello Kinetis fans, This time I bring to you a document which explains what is and how to configure scatter/gather feature which is present in the Enhanced Direct Memory Access (eDMA). This document includes an example project for the Kinetis Design Studio (KDS) which works in the FRDM-K64F board but the configuration is the same for any MCU which includes the eDMA peripheral. If you are interested in the channel linking feature, please take a look into the document What is and how to configure the eDMA channel linking feature​. I hope you find this document useful. Best regards, Earl Orlando Ramírez-Sánchez Technical Support Engineer NXP Semiconductors
View full article
For Remote Control means, that is needed two computers - Server Computer and User Computer, which will be in connection. There are two types of connection, which can be used - HTTP or DCOM. There are two different ways how to set up the remote control in Windows. I made the tutorial, which describes both types of Remote Control. Ok - so, let´s start! HTTP Settings On the Server Computer side: 1. Plug the board to the Server Computer 2. Go to Remote Communication Server 3. Set HTTP connection and choose the right COM Port according the plugged board If the plugged board is on e.g. COM23, it is possible to edit number of Port in Device Manager On the User PC side: 1. Open FreeMASTER,  go to Project -> Options 2. Choose Plug-in Module: FreeMASTER CommPlugin for Remote Server (HTTP) and type the IP address of the server, do not forget join to IP address :8080 3. And start communication by STOP button to successful connection DCOM Settings On the Server Computer side: 1. Plug board to the Server Computer 2. Launch DCOM in FreeMASTER Remote Server Choose COM according plugged board or edit COM according to step 2 - Server Computer in HTTP Connection (up). 3. Setting permissions for the user, User PC. Right click on Computer -> Manage. In Computer Management click to Distributed COM Users. In Distributed COM Users Properties add the user, User Computer. After that, set the permissions in Component Services. In cmd type dcomcnfg.exe In Component Services go to Computers -> My Computer -> DCOM Config -> MCB FreeMASTER Remote Server Application Right click on MCB FreeMASTER Remote Server Application and go to Properties. In Security Tab is possible to add the permissions. There are 3 types of permissions. First permission - Launch and Activation Permissions. There are 4 permission options. Local Launch and Remote Launch means, that user, User Computer can launch e.g. FM Remote Server Application. But for success communication is needed allowing Local Activation and Remote Activation. Second permission - Access Permissions. Click to Edit and Allow Local Access and Remote Access for the user. Do not forget that if there is a change of permissions, specifically allowing, it is necessary for User to log out and log in. On the User Computer side: 1. Open Freemaster, go to Project -> Options 2. Choose Plug-in Module: FreeMASTER CommPlugin for Remote Server (DCOM) and for filling Connect string is possible to use Configure. Definitely, type the IP address of the server and ;Port Name. 3. And start communication by STOP button in FreeMASTER to successful connection And now.. you can do anything 🙂
View full article
Document describing first steps of simple touch sensing application in Code Warrior and TWR board is attached. We will use K60 board from www.freescale.com/tower, CodeWarrior from www.freescale.com/codewarrior, TSS package www.freescale.com/tss, and later FreeMASTER visualization and debugging software  www.freescale.com/freemaster the proces is described in detail and final code is attached for easy jump into the topic Pavel Sadek
View full article
Hi Team :      Recently we are working on USB DFU , there are some experience to share with you . Best regards, David
View full article
Example of integrating CMSIS3.20 into MQX4.0.x on the TWR-K60D100M (no floating point unit) using CW10.4 using the MQX4.0.2\mqx\examples\hello2 project. In the attached ZIP file (hello2twrk60d100m_CMSIS_NoFPU.zip) is a MSWord document detailing the steps used.  That document name is TWR-K60D100M_CMSIS_CW10.4_MQX4.0.x.docx. Regards, David
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
Using five channels from FTM2 module of the KE02 microcontroller included on the FRDM-KE02Z board for controlling a robotic arm powered by five servomotors. Each servomotor is controlled by a couple of buttons of a matrix keyboard, which is connected to eigth GPIOs. Interrupts are not used in this example. The code was generated and compiled on CodeWarrior for Microcontrollers v10.5.
View full article
This application demonstrates the use of the FRDM-KL25 as a HID HOST. In this project the HID Device is a Numeric Keyboard and the HOST Device (FRDM-KL25) is handling the data and printing them in a 16x2 LCD used in 8 bits mode .
View full article
Hello Kinetis fans, This time I bring to you a document which explains what is and how to configure channel linking feature which is present in the Enhanced Direct Memory Access (eDMA). If you are interested in the scatter/gather feature, please take a look into the document What is and how to configure the eDMA scatter/gather feature. I hope you find this document useful. Best regards, Earl Orlando Ramírez-Sánchez Technical Support Engineer NXP Semiconductors
View full article
My customer wanted to use K60 in his design but he only has the Keil IDE, so I helped to port some examples in KINETIS_SC for him as a starting point. The attachment is my porting work, which also includes a exe file to create new keil project. You may refer to "keil\build\uv4\make_new_project_keil.exe" for details. Hope that helps, B.R Kan
View full article
        在我们嵌入式工程应用中,中断作为最常用的异步手段是必不可少的,而且在一个应用程序中,一个中断往往是不够用的,多个中断混合使用甚至多级中断嵌套也经常会使用到,而这样就涉及到一个中断优先级的问题。         以我们最熟悉的Cortex-M系列为例,我们知道ARM从Cortex-M系列开始引入了NVIC的概念(Nested Vectors Interrupts Controller),即嵌套向量中断控制器,以它为核心通过一张中断向量表来控制系统中断功能,NVIC可以提供以下几个功能: 1)可嵌套中断支持; 2)向量中断支持; 3)动态优先级调整支持; 4)中断可屏蔽。         抛开其他不谈,这里我们只说说中断优先级的问题。我们知道NVIC的核心工作原理即是对一张中断向量表的维护上,其中M4最多支持240+16个中断向量,M0+则最多支持32+16个中断向量,而这些中断向量默认的优先级则是向量号越小的优先级越高,即从小到大,优先级是递减的。但是我们肯定不会满足于默认的状态(人往往不满足于约束,换句俗话说就是不喜欢按套路出牌,呵呵),而NVIC则恰恰提供了这种灵活性,即支持动态优先级调整,无论是M0+还是M4除了3个中断向量之外(复位、NMI和HardFault,他们的中断优先级为负数,它们3个的优先级是最高的且不可更改),其他中断向量都是可以动态调整的。         不过需要注意的是,中断向量表的前16个为内核级中断,之后的为外部中断,而内核级中断和外部中断的优先级则是由两套不同的寄存器组来控制的,其中内核级中断由SCB_SHPRx寄存器来控制(M0+为SCB_SHPR[2:3],M4为SCB_SHPR[1:3]),外部中断则由NVIC_IPRx来控制(M0+为NVIC_IPR[0:7],M4为NVIC_IPR[0:59]),如下图所示: M0+中断优先级寄存器: M4中断优先级寄存器:         其中M4所支持的动态优先级范围为0~15(8位中只有高四位[7:4]才有效),而M0+所支持的动态优先级范围则为0~3(8位中只有高两位[7:6]才有效),而且秉承着号越小优先级越高的原则(0最高,15或3为最小),同时也间接解释了为什么复位(-3)、NMI(-2)和HardFault(-1)优先级最高的原因,很简单,人家都是负的了,谁还能比他们高,呵呵,而且这三位中复位优先级最高,NMI其次,HardFault最低(这个最低仅限于这三者)。 下面给出个ARM CMSIS库中关于M0+和M4中断优先级设置的API函数NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)实现供大家来参考: M0+: NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) {   if(IRQn < 0) {     SCB->SHP[_SHP_IDX(IRQn)] = (SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |         (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }  /* set Priority for Cortex-M  System Interrupts */   else {     NVIC->IP[_IP_IDX(IRQn)] = (NVIC->IP[_IP_IDX(IRQn)] & ~(0xFF << _BIT_SHIFT(IRQn))) |         (((priority << (8 - __NVIC_PRIO_BITS)) & 0xFF) << _BIT_SHIFT(IRQn)); }   /* set Priority for device specific Interrupts  */ } M4: void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) {   if(IRQn < 0) {     SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M  System Interrupts */   else {     NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff);    }        /* set Priority for device specific Interrupts  */ }
View full article
Here you will find the code and project files corresponding to the I2C-Accelerometer project. The accelerometer/magnetometer is connected to the I2C port, although bot the accelerometer and magnetometer are contained within a single package, they must be initialized individually. In this example the measurements from both devices (X,Y and Z axis) is performed and displayed at the serial terminal. In order to compile the project, the following library must be imported: FXOS8700Q.h Code: #include "mbed.h" #include "FXOS8700Q.h" //I2C lines for FXOS8700Q accelerometer/magnetometer FXOS8700Q_acc acc( PTE25, PTE24, FXOS8700CQ_SLAVE_ADDR1); FXOS8700Q_mag mag( PTE25, PTE24, FXOS8700CQ_SLAVE_ADDR1); //Temrinal enable Serial pc(USBTX, USBRX); MotionSensorDataUnits mag_data; MotionSensorDataUnits acc_data; int main() {     float faX, faY, faZ;     float fmX, fmY, fmZ;     acc.enable();     printf("\r\n\nFXOS8700Q Who Am I= %X\r\n", acc.whoAmI());     while (true)     {         acc.getAxis(acc_data);         mag.getAxis(mag_data);         printf("FXOS8700Q ACC: X=%1.4f Y=%1.4f Z=%1.4f  ", acc_data.x, acc_data.y, acc_data.z);         printf("    MAG: X=%4.1f Y=%4.1f Z=%4.1f\r\n", mag_data.x, mag_data.y, mag_data.z);         acc.getX(&faX);         acc.getY(&faY);         acc.getZ(&faZ);         mag.getX(&fmX);         mag.getY(&fmY);         mag.getZ(&fmZ);         printf("FXOS8700Q ACC: X=%1.4f Y=%1.4f Z=%1.4f  ", faX, faY, faZ);         printf("    MAG: X=%4.1f Y=%4.1f Z=%4.1f\r\n", fmX, fmY, fmZ);                 wait(1.0);     } }
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
   CodeWarrior v10.6 and KDS are integrated development tools which are based on Eclipse, these two IDEs provide easy way to build project when using the GUI, but some engineers still want to build their projects from command line to do automated builds. This document provides examples on how to do it! Build project in CodeWarrior from command line: For a CW v10.6 created project, CW provides the “Make” tool and can also generate the needed “MakeFile” to build this project out of eclipse GUI. The below are the steps: Create and new project “k22_makefile” in CW v10.6, you will see there are two build configurations: RAM & FLASH Launch “cmd prompt” in Windows and go to “eclipse” folder of CW installation Now, you can generate the makefile for configuration FLASH by executing the below command ecd.exe –generateMakefiles –project “C:\workspace_cmd\k22_makefile” –config FLASH Now, checking the “FLASH” subfolder in project location, you will see “makefile” is generated. 4.To use “make” tool convenient, we can define an environment variable pointing to {CW}\gnu\bin where “make” is located. See command as below: 5. Go to the configuration folder “FLASH” where the project’s makefiles are located and run the follow commands to build the project. %MCU_BIN%\make.exe PS: to get more information of make and ecd, please just run the below command: Ecd.exe –help Make.exe –help Build project in KDS from command line: Compare with CodeWarrior, it is much easier to build an application in command mode. KDS provides a command “eclipse.exe” with which you can build a project with only two steps. In this example, I have created an application with name “cmd_ke02”, and the workspace path is “C:\wks_kdscmd”. To build the application in cmd, please first launch command mode in Windows system and then go to {KDS}\eclipse. Then, you need import the application into current workspace in the below command: eclipsec.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data "C:\wks_kdscmd" -import "C:\wks_kdscmd\cmd_ke02" then, build the project with the below command: eclipsec.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data "C:\wks_kdscmd" -build "cmd_ke02" For more details of building project from command line in KDS, please refer: http://mcuoneclipse.com/2014/09/12/building-projects-with-eclipse-from-the-command-line/
View full article
Welcome to the FRDM-K64 mbed workshop, in this page you will find all the code examples we will review on this session. The program covers the following modules: GPIO Serial communication Interrupts PWM ADC I2C (Accelerometer) USB Ethernet Depending on how fast we advance during the session some of the modules might be skipped; however here you can find both the source code and binary files ready to be flashed into the FRDM-K64 development board. FRDM-K64Z120M The FRDM-K64 is fully compatible with the Arduino rapid prototyping system, the following image depicts the board's pinout, the green labels can be used directly into your mbed proyects, they have already been defined in the headers and libraries in order to make development easier. Sign up at mbed.org In order to create the projects covered on this session it is necessary to create an mbed user account, open the website and create a user account, if you have already signed up please log in. Mbed debugging application To enable the FRDM-K64 development board using the binary files generated by mbed it is necessary to update the board's firmware, follow the steps mentioned below in order to enable the board to be programmed: Press the board's reset button While pressing the reset button connect the board to your computer using the USB cable, it must be connected to the J26 USB connector. Once the unit has enumerated as "Bootloader", copy the 20140530_k20dx128_k64f_if_mbed.bin file into the unit Disconnect and reconnect the USB cable, the board must enumerate as "MBED" Serial communication driver To implement serial communication you need to install the serial driver in your computer, download the driver, once your board has enumerated as MBED execute the driver and wait for it to be finished, this might take a couple of minutes. Serial terminal In order to communicate with the board via serial port it is necessary to use a serial terminal, by default WIndows 7 and 8 do not have this application, XP does. If your OS does not feature a serial terminal, you can download the one at the bottom (Teraterm). ! Your board is now ready to be programmed using mbed!
View full article
On behalf of EarlOrlando​ Hello community, This document is intended to be a basic guide to get started with the eGUI. If you need a closer view about what this driver is, it is recommended to take a look into the eGUI Introduction document. Before starting, it is needed to download the library from the NXP eGUI website and it is recommended to take a look into the eGUI Reference Manual. For this document, a demo included in the eGUI drivers will be run and then modified to toggle a LED in the TWR-K70F120M board from the eGUI interface displayed in the TWR-LCD-RGB board. Contents. Introduction. 1. About this document. 2. Running the K70 demo on IAR. a. Compiling the TWR-K70F120M MQX libraries. b. Adding the SD card content. c. Download the application to the MCU. 3. Modifying the eGUI demo. a. Creating a new screen. i. Adding a new source file for the new screen. ii. Adding the screen header files. iii. Adding some macro definitions. iv. Defining screen attributes. v. Declaring the screen. vi. Defining a new string. vii. Adding the screen interfaces b. Opening the new screen. c. Creating a new button. d. Toggling the LED. 4. Conclusion. I hope you find this guide useful. Enjoy this guide, any feedback is welcome!
View full article
BSDL file for the MK20DN512VLL10.
View full article
  1 Introduction    Previously we used sd card to upgrade the program. We have to insert the sd card into the computer every time, copy the program to the sd card, and then insert it into the sd card slot of mcu to update the program. This method seems to be a bit troublesome, so we implemented a more convenient method. It no longer needs to insert or remove the SD card from PC and MCU. Use the usb function of mcu to recognize mcu as a storage U disk. When we need to update the program, connect the MCU’s usb interface to PC. After the computer recognizes it, copy the program that needs to be burned in. Then the bootloader will recognize the file and then upgrade the application. Bootloader detects changes of the file, not the existence of the file. In other words, if the a000.bin file has already existed in the sd card, the application will not be updated. When this a000.bin is overwritten with another a000.bin, the operation of updating the application will be performed.   2  Bootloader’s implementation The schematic for SD card is shown below. The board uses SDHC module to communicate with SD card.                                                  Figure 1. Figure 1.Schematic for SD card   We use the 2.6.0 version of FRDM-K64F’s SDK. You can download the SDK in our website. The link is “mcuxpresso.nxp.com”.   The schematic for USB is shown below.                                                                                                        Figure 2. Schematic of USB   Bootloader uses SDHC, fatfs, usb, flash, So we should add files to support them. Our code is based on the example “usb_device_msc_sdcard_lite” that belongs to usb example.   In main code, the program will initialize the usb, sd and fatfs. Then the computer will communicate will MCU. Finally, PC will recognize the mcu as a u-disk.                Figure 3.u-disk The method of how to update the program and prepare the application has written in this document. You can refer it. https://community.nxp.com/docs/DOC-344903   Use a variable “wrFlag” to check the modification of the file. When we put file into the u-disk, this variable will be set.                                           Figure 4. Modification of flag When this variable is set, the program will open the “a000.bin”. Then update the application. Finally, go to the application.                      Figure 5. Update the application   3  Run the demo     Download this bootloader     Prepare a user application program. We use the “led blinky” as an example. Use it to generate the binary file. Name it as “a000.bin”. Put it into the u-disk. You will see some log in the uart.       The application will execute automatically
View full article
Microgenios viabilizou a realização de videos de treinamentos de curta duração para ensinar os primeiros passos com o microcontrolador Kinetis L como parte do Road Show de Microcontroladores ARM cortex-M0+ (Kinetis L Freescale), projeto realizado em parceria pela a Freescale em 10 cidades espalhadas pelo Brasil. Veja os videos para iniciar seu projeto com Kinetis L: Neste vídeo aprenderemos o processo de download e instalação do CodeWarrior V10.3 e outros pacotes de softwares Freescale: http://www.youtube.com/watch?v=bjtsLHMImDY Neste vídeo aprenderemos o processo de atualização do CodeWarrior V10 (baseado no Eclipse) e conheceremos as pastas criadas na instalação: http://www.youtube.com/watch?v=Sslf0nF0Td8 Neste vídeo conheceremos a ferramenta de hardware Freedom Board da Freescale com microcontrolador ARM cortex-M0+; e entenderemos a utilização da interface de gravação e depuração OpenSDA: http://www.youtube.com/watch?v=jeuq7ErvTGQ Neste vídeo aprenderemos a criar nosso primeiro projeto com a Freedom Board (FRDM-KL25Z), que possui microcontrolador da família Kinetis L (núcleo ARM cortex-M0+) da Freescal; utilizaremos como ferramenta de software o CodeWarrior V10.3 e o Processor Expert: http://www.youtube.com/watch?v=sx2tpDBWDt8 Neste vídeo conheceremos a IDE cloud mbed, que possibilita desenvolvimento e aplicações diretamente no navegador: http://www.youtube.com/watch?v=N7qMvO_R6Sc Mais informações visite: http://www.microgenios.com.br/website/index.php/hands-on-freescale
View full article
  对于 Kinetis 芯片来说,发生在工程师调试,小批及量产阶段都经常发生的一个问题就是Kinetis Lock(锁住),尤其是在刚用这个芯片设计及小批的客户身上,这个错误几乎都会遇 到。附件中的文档将对这个问题作出详细的讨论。
View full article