Kinetis微控制器知识库

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Kinetis Microcontrollers Knowledge Base

讨论

排序依据:
在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就无法正常工作了。
查看全文
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
查看全文
Latest version of the AN2295 universal bootloader includes support for IAR 7.6 IDE. - added support for Kinetis E MCUs - Kinetis K,L,M,E,W,V support
查看全文
La serie Kinetis L es una combinación de eficiencia energética, escalabilidad, valor y facilidad de uso que revolucionará el mercado de microcontroladores de nivel básico. Ofrece a los usuarios de arquitecturas heredadas de 8 y 16 bits una ruta de migración hacia la gama de microcontroladores Kinetis de 32 bits y les permite aumentar el rendimiento y ampliar la funcionalidad de sus productos finales sin incrementar el consumo de energía ni los costes del sistema. La serie Kinetis L se compone de cinco familias de microcontroladores: KL0, KL1, KL2, KL3 y KL4. Cada familia combina excelentes corrientes dinámicas y de parada con una capacidad extraordinaria de procesamiento, una amplia selección de memorias flash y una gran variedad de opciones analógicas, de conectividad y de periféricos HMI. La familia KL0 es compatible en pines con la familia S08Px de 8 bits (lo que tiende un puente entre el desarrollo de 8 bits y la cartera Kinetis) y compatible en software con otras familias de la serie Kinetis L. Las familias KL1, KL2, KL3 y KL4 presentan una compatibilidad mutua en hardware y software, además de ser compatibles con sus equivalentes de la serie Kinetis K basada en el Cortex-M4 (KL1 -> K10, KL2 -> K20…). De este modo, los desarrolladores disponen de una ruta de migración ascendente/descendente hacia mayor/menor rendimiento, memoria y funcionalidad integrada, lo que les permite reutilizar el hardware y el software en todas las plataformas de productos finales y reducir el tiempo necesario para la comercialización. Las primeras familias disponibles en el mercado serán KL0, KL1 y KL2 a finales de septiembre de 2012. La disponibilidad de las familias KL3 y KL4 está prevista para el primer trimestre de 2013. Procesador ARM Cortex-M0+ El procesador ARM Cortex-M0+ ofrece niveles más altos de eficiencia energética y de rendimiento y es más fácil de usar que su antecesor, el Cortex-M0. En cuanto a las instrucciones, mantiene plena compatibilidad con todos los demás procesadores de la clase Cortex-M (Cortex-M0/3/4), por lo que los desarrolladores pueden reutilizar sus compiladores y herramientas de depuración existentes. Principales características: 1,77 coremarks/MHz: entre 2 y 40 veces más que los microcontroladores de 8/16 bits, un 9 % más que el Cortex-M0. Coremarks/mA: entre 2 y 50 veces más que los microcontroladores de 8/16 bits, un 25 % más que el Cortex M0. Pipeline de 2 etapas: reducidos ciclos por instrucción (CPI), lo que permite instrucciones de bifurcación y entradas ISR más rápidas. MTB (Micro Trace Buffer): solución ligera y no intrusiva; la información del rastreo se guarda en una pequeña área de la SRAM del microcontrolador (tamaño definido por el programador), lectura a través de SWD/JTAG. Amplio soporte para el entorno ARM. Acceso E/S monociclo: frecuencia de conmutación de la interfaz GPIO un 50 % más alta que la de la E/S estándar, lo que mejora el tiempo de respuesta a eventos externos y permite manipular bits (bit-banding) y emular protocolos de software. Espacio de direcciones lineal de 4 GB: elimina esquemas de paginación complejos y simplifica la arquitectura de software. Solamente 56 instrucciones: mayoritariamente codificadas en 16 bits; opción para MUL rápida de 32 x 32 bits en un ciclo. Conjunto de instrucciones: totalmente compatible con el procesador Cortex-M0, subconjunto de instrucciones del procesador Cortex-M3/4. La mejor densidad de códigos de su categoría en comparación con arquitecturas de 8/16 bits; menor tamaño de memoria flash y reducción del consumo de energía; mayor rendimiento que sus equivalentes de 8 y 16 bits. Acceso a la memoria del programa; reducción del consumo de energía. Familias de microcontroladores de la serie Kinetis L Los microcontroladores de la serie Kinetis L se basan en la funcionalidad del procesador ARM Cortex-M0+, que presenta un diseño de plataforma de bajo consumo energético así como modos operativos y dispositivos periféricos que ahorran energía. El resultado es un microcontrolador que ofrece la mejor eficiencia energética de la industria, consume menos de 50 μA/MHz en el modo VLPR (Very Low Power Run) y puede despertarse rápidamente desde el estado de reposo, procesar datos y restablecer el modo de reposo, lo cual alarga la vida útil de la batería en las aplicaciones. Para ver una demostración de la eficiencia energética de la serie Kinetis L, visite www.freescale.com/ftf. Familias de microcontroladores: Familia KL0: la puerta de entrada a la serie Kinetis L; microcontroladores de 8-32 kB y de 24-48 pines, compatibles en pines con la familia S08P de 8 bits y en software con todas las demás familias de la serie Kinetis L. Familia KL1: microcontroladores de 32-256 kB y de 32-80 pines con comunicaciones adicionales y periféricos analógicos, compatibles en hardware y software con todas las familias de la serie Kinetis L y con la familia K10 (CM4) de la serie K. Familia KL2: microcontroladores de 32-256 kB y de 32-121 pines con USB 2.0 de máxima velocidad tipo host/device/OTG, compatibles en hardware y software con todas las familias de la serie Kinetis L y con la familia K20 (CM4) de la serie K. Características comunes a todas las familias de microcontroladores de la serie Kinetis L: Procesamiento extremadamente eficiente Procesador ARM Cortex-M0+ de 48 MHz Tecnología flash de bajo consumo de energía: 90 nm Funciones de manipulación de bits < 50 μA/MHz; 35,4 coremarks/mA Barra cruzada de puente periférico Controlador de memoria flash con estado de espera cero Modos de consumo de energía ultrabajo Tecnología flash con baja fuga: 90 nm Múltiples modos RUN, WAIT y STOP Activación en 4,6 μs desde el modo de reposo profundo Bloqueo de reloj y de potencia (clock & power gating), opciones de arranque con bajo consumo de energía Reloj VLPR: precisión con un 3 % máximo de margen de error, que normalmente es del 0,3-0,7 % Consumo de corriente en modo de reposo profundo: 1,4 μA con retención de registros; LVD activo y activación en 4,3μs Periféricos que ahorran energía Los periféricos funcionan en modos de reposo profundo y son capaces de tomar decisiones inteligentes y de procesar datos sin despertar al núcleo: ADMA, UART, temporizadores, convertidor analógico-digital (ADC), pantalla LCD con segmentos, sensores táctiles... ADC de 12/16 bits Convertidor digital-analógico (DAC) de 12 bits Comparadores analógicos de alta velocidad Temporizadores de alta capacidad para una gran variedad de aplicaciones, incluyendo el control de motor Para tener más información del fabricante y de los servicios, por favor visiten nuestra microsite. Via Arrow Europe
查看全文
    MMA9553L是飞思卡尔的一款计步传感器,本文就如何快速使用该传感器做一个简单介绍。    你可能还见到过MMA955xL, 它与MMA9553L是什么关系呢?简单的来说MMA955xL是一个统称,它包括MMA9550L、MMA9551L、MMA9553L和MMA9559L这几个具体型号,其实这四种传感器在硬件上都是一样的。其内部主要由ColdFire 内核、模拟前端、Flash、IIC和SPI接口等部分组成,原理框图如下图所示:    它们的不同之处在于内部的Firmware不同,Firmware在芯片出厂时就已经固化在芯片里面了,不同的Firmware对于不同的功能。这里介绍的MMA9553L主要就用作计步器功能。        MMA9553L和MCU之间可以通过IIC接口或者SPI接口通讯,所以使用MMA9553L的首要前提是把MCU的IIC或者SPI调通。接口调通之后就可以来操作此传感器了。这里以IIC为例来说明。附件为参考代码。 测试平台:IAR7.2 + FRDM_KL25Z+FRDM-FXS-MULTI FRDM-FXS-MULTI开发板上带有MMA9553L,将FRDM-FXS-MULTI开发板和FRDM_KL25Z连接在一起就可以使用了。     下面分析一下源代码:        首先是调用初始化函数pedometer_init(),此函数主要调用以下几个函数:      pedometer_write_config();       // config     pedometer_enable();         // enable pedometer     pedometer_int0_enable();    // enable INT_O pin     pedometer_active();         // active MMA9553 pedometer_wakeup();   // wakeup 在此重点分析前两个函数。第一个函数 pedometer_write_config(),该函数的具体实现如下: void pedometer_write_config(void) {     unsigned char Buf[]={0x15,0x20,0x00,0x10,                            0x0C,0xE0,                            0x13,0x20,                            0x00,0x96,                            0x60,0x50,                            0xAF,0x50,                            0x04,0x03,                            0x05,0x01,                            0x00,0x00};     dvMMA9553_Write(MMA9553_Slave_Addr, MMA9553_Sub_Addr, Buf, 20); } 此函数很简单,就是通过IIC给9553发送一条命令,命令的内容Buf数组中的20个字节    的数据。 dvMMA9553_Write()函数的第一个参数代表MMA9553L的地址,为0x4C。datasheet中有说明。 #define MMA9553_Slave_Addr  0x4C dvMMA9553_Write()函数的第二个参数代表寄存器地址,为0x00。 #define MMA9553_Sub_Addr    0x00 发送的这一串命令:0x15,0x20,0x00,0x10,0x0C,0xE0,0x13,0x20,0x00,0x96,0x60,0x50,0xAF,0x50,0x04,0x03,0x05,0x01,0x00,0x00 具体是什么含义呢? 0x15:表示Application ID,计步器的Application ID就是0x15 0x20:表示这条命令是Write Config command,即这条命令是用来写Configuration 寄存器的。 0x00:表示配置寄存器的偏移地址。 0x10:表示要写16字节的内容。 0x0C,0xE0,0x13,0x20,0x00,0x96,0x60,0x50,0xAF,0x50,0x04,0x03,0x05,0x01,0x00,0x00 这16字节就是写入配置寄存器中的具体内容。 配置寄存器共用8个,分别是Sleep Minimum register,Sleep Maximum register,Sleep Count Threshold register,Configuration/Step Length register,Height/Weight register,Filter register,Speed Period/Step Coalesce register,Activity Count Threshold register,每个寄存器为16 bit(2 字节),所以总共16字节。 第二个函数 pedometer_enable(),该函数的具体实现如下: void pedometer_enable(void) {     unsigned char Buf[]={0x17,0x20,0x05,0x01,0x00};     dvMMA9553_Write(MMA9553_Slave_Addr, MMA9553_Sub_Addr, Buf, 5); } 这次写入的命令是0x17,0x20,0x05,0x01,0x00 0x17:表示Application ID 0x20:表示这条命令是Write Config command 0x05,0x01,0x00 这三个表示在偏移地址0x5处,写入一个字节的数据0x00 其他几个函数也类似,都是写入一条命令,对某种Application的配置寄存进行设置。 初始化完了,现在就可以读取步数了。 通过调用pedometer_main() 函数就可以读取到步数。 该函数的实现如下: void pedometer_main(void) {     unsigned char Buf[20];     pedometer_cmd_readstatus(); // read  status      while(1)         {            dvMMA9553_Read(MMA9553_Slave_Addr, MMA9553_Sub_Addr, Buf, 2);            if(Buf[1]==0x80)            {               dvMMA9553_Read(MMA9553_Slave_Addr, MMA9553_Sub_Addr, Buf, 16);               break;             }         }         m_status.StepCount = Buf[6] * 256 + Buf[7];         m_status.Distance  = Buf[8] * 256 + Buf[9];         m_status.Calories  = Buf[12] * 256 + Buf[13]; } 主要调用了两个函数,一是pedometer_cmd_readstatus(),这个函数的实现如下: void pedometer_cmd_readstatus(void) {     unsigned char Buf[]={0x15,0x30,0x00,0x0C};     dvMMA9553_Write(MMA9553_Slave_Addr, MMA9553_Sub_Addr, Buf, 4 ); } 它是发送了0x15,0x30,0x00,0x0C这条命令 0x15:表示Application ID 0x30:表示Read Status command 0x00:表示偏移地址 0x0C:表示需要读的字节数为12 之后调用dvMMA9553_Read()函数,通过IIC读取16字节的数据(4字节起始信息+12字节status register内容),读到的16字节数据如下: Step count register寄存器如下,通过其值可以算出步数来。    另外还可以读取三轴加速度的值,过程与读取步数是类似的,也是先写配置寄存器,然后再读取状态寄存器。   总的来说操作MMA955L的关键搞清楚有两个重要的寄存器:配置寄存器和状态寄存器。配置寄存器可读可写,状态寄存器只可读。 写配置寄存器,格式是: APP_ID+0x20+offset+number+number字节的内容 读配置寄存器,格式为: 先发送:APP_ID+0x10+offset+number, 再通过IIC读number+4字节的内容,前4字节为起始信息。 读状态寄存器,格式为: 先发送:APP_ID+0x30+offset+number,再通过IIC读number+4字节的内容,前4字节为起始信息。 读Command 回的内容如下:
查看全文
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
查看全文
Common: 1. 如何在IAR、Keil和Codewarrior中禁止掉Kinetis的NMI脚 2. 使用Codewarrior、IAR和Keil三大IDE配置生成bin文件 3. Codewarrior、IAR和Keil三大IDE局部优化指令 Kinetis Design Studio 1. 飞思卡尔免费开发环境KDS调试时显示外设寄存器内容​ CodeWarrior: 1. Codewarrior中如何查看Flash和RAM占用Size大小, include路径如何配置? 2. Codewarrior10.5低功耗模式唤醒后保持调试功能 3. 浅谈Codewarrior局部优化技巧 4. 在Codewarrior10.x调试模式下导出内存数据到s19文件 5. CodeWarrior10.x中英文系统界面切换 6. CodeWarrior10.x新建Kinetis工程方法 7. Codewarrior10.x下使用ewl_noio库以节省代码空间 8. Codewarrior10.x下生成的image文件后缀都是.hex 9.代码重定位-CodeWarrior/KDS-kineits L 系列 IAR: 1. 利用IAR Timeline工具测试delay函数执行时间 2. 使用老版本IAR支持新器件 3. IAR环境下Flash loader工作原理 4. IAR环境下Flash调试和RAM调试的区别 5. IAR环境下更改ARM大小端存储模式 6. 简单移植Kinetis IAR开发框架模板的方法 7. Kinetis图形化显示stack堆栈使用情况 8. IAR使用小技巧(常用快捷键,LiveWatch配置方法,修改调试模式入口地址) 9. 实现IAR下S19、Bin、Hex文件格式转换 10. IAR生成和调用Kinetis函数库 11. 批处理查找添加IAR工程头文件 12. 通过IAR MAP文件查看目标文件内存分配 13. 解析IAR的ILINK链接器icf配置文件 14. 重定向printf输出到IAR虚拟终端 15. 解决双击eww文件无法同时打开多个IAR工程的问题 16. IAR下使用noinit段的方法和指定地址的变量分配 Keil: 1. Keil编译器ARMCC中添加对GCC扩展格式的支持 2. 关于Keil无法正确下载程序问题的总结
查看全文
底层驱动源码,mdk5.0打开。 另有移植好了的ucGUI的源码。
查看全文
1 Abstract Stepper motor can be controlled by the electrical pulse signal with the open loop system, it use the electrical pulse signal realize the angular movement or linear movement.  The speed and position of the stepper motor is determined by the pulse frequent and the pulse number. Stepper motor can be used in the low speed area application, with higher work efficiency and low noise. KE02 is the 5V kinetis E series MCU, it is based on ARM Cortex M0+ core, KE series are designed to maintain high robustness for complex electrical noise environment and high reliability application. For these advantages, KE02 is fit the Stepper motor control application. This document is mainly about how use the KE02 realize the Stepper motor speed, step and direction control. It can use the UART in the PC to control the Stepper motor speed. The following picture is the control diagram.                                                                              Fig.1 2. Motor control parameter calculation      Just as Fig.1 shows, KE02 should control the EN, DIR, PWM signal to the motor driver, then realize the stepper motor control. EN is the motor driver enable signal, 0 is enable, 1 is disable; DIR is the stepper motor direction control, 0, clockwise, 1 anticlockwise; PWM is the pulse signal to control the step and speed for the stepper motor.       Stepper motor is 1.8’, it means a round have 360’/1.8’= 200 steps. But because the Motor driver have the divider, it is 32, so one stepper motor round should have 200*32 = 6400 steps.       KE02 system, it use the external 10Mhz crystal, and configure both core and bus frequent to 20Mhz,  it use FTM0 module as the motor pulse generate module, bus clock with 32 prescale used as the FTM0 clock source, choose up counter. If need to change the motor speed and control step, just control the FTM PWM frequent and PWM counter. For Stepper motor, one FTM period means one motor step. From the reference manual of KE02, we get that, the FTM period in up counting mode is: (MOD-CNTIN+1)*period of the FTM counter clock, if want to change the frequent of motor, just calculate the MOD of FTM is ok, then count the number of the FTM cycle, now assume CNTIN =0, then: Tftm= (32/20Mhz)*(MOD+1) From the Stepper Motor and it’s driver, we get that one step time is : Tmstep= 60/(V*6400) V is the speed of Motor, the unit is round/minute. Because Tftm=Tmstep, then we know: MOD= (60/(V*6400))*(20Mhz/32)-1                     (F1) In this document, we calculate the speed of 150 round/minute, 110 round/minute, 80 round/minute, 50 round/minute and 0.1 round/minute, according to (F1), we can get the MOD for each speed as the following: 150 round/minute   MOD=38 110 round/minute   MOD=52 80 round/minute     MOD=72 50 round/minute     MOD=116 0.1 round/minute    MOD=58592 If each speed need to do 10 Stepper motor round, then just control the speed counter number to: 10*6400=64000. 3. MCU pin assignment PTF0 : DIR PTF1 : EN PTA0 : PWM PTC6 : UART1_RX PTC7 : UART1_TX 4. code writing (1)FTM initial code void STEEPMOTOR_PWM_Init(uint16 MODdata) {                    SIM_SCGC |= SIM_SCGC_FTM0_MASK;                 FTM0_SC = 0;                 FTM0_C0SC = 0 ;                 FTM0_C0SC = FTM_CnSC_MSB_MASK |FTM_CnSC_ELSA_MASK ;                 FTM0_C0V = 0;                 FTM0_C0V = MODdata>>1;                 FTM0_MOD=MODdata;                 FTM0_SC |=FTM_SC_CLKS(1) | FTM_SC_PS(5) | FTM_SC_TOIE_MASK                 enable_irq(17); //enable interrupt } MODdata can choose the different Stepper motor speed, eg, 150 round/minute, MODdata is 38. (2) interrupt service function void FTM0_IRQHandler(void) {                                 FTM0_SC  &= ~FTM_SC_TOF_MASK;//clear the TOF flag. roundcount++;                 if(roundcount >= 64000) {FTM0_C0SC = 0x00; FTM0_SC &= ~(FTM_SC_TOIE_MASK);} } It can used for the step counter, and when reach the 10round, then stop the motor( stop the FTM output). (3)Speed choose with UART input void Motor_Speed_GPIO_CTRL_30round(void) {                 char motormode=0;                 uint32 COMPDATA=0;                                 printf("\n 1 for 150 round/minute\n\r");                 printf("\n 2 for 110 round/minute\n\r");                 printf("\n 3 for 80 round/minute\n\r");                    printf("\n 4 for 50 round/minute\n\r");                    printf("\n 5 for 0.1 round/minute\n\r");                 motormode = UART_getchar(PC_TERM_PORT);                                     switch(motormode)                                 {                                    case '1':                                                       STEEPMOTOR_PWM_Init(38);//150 round/minute                                                         break;                                   case '2':                                                       STEEPMOTOR_PWM_Init(52);//110 round/minute                                                         break;                                   case '3':                                                                       STEEPMOTOR_PWM_Init(72);//80 round/minute                                                          break;                                   case '4':                                                                       STEEPMOTOR_PWM_Init(116);//50 round/minute                                                         break;                                   case '5':                                                                       STEEPMOTOR_PWM_Init(58592);//0.1 round/minute                                                         break;                                                                                default: break;                                 }                                 while( roundcount < 64000 ) {} //10 round                                 Disable_PWM;                                 printf("\n %c 10round PWM is finished ", motormode);                                 roundcount=0; } 5 DEMO About the test code, please find it from the attachment.
查看全文
The modularity of the tower system makes it great for prototyping, but for higher speed interfaces, there might be timing/signal integrity issues from having the TWR-MEM. For example, if you run the NFC demo from MQX 4.2: C:\Freescale\Freescale_MQX_4_2\mqx\examples\nandflash\build\iar\nandflash_twrk60f120m, It works well standalone, but with TWR-MEM connected. It failed when trying to read the data from nandflash. Because the NAND flash is on the TWR-K60F120M board, any time you access the NAND flash through NFC the signal will still travel all the way to the MRAM and reflect back which can distort the signals. Checking with the NFC driver code, you may find the high driven strength of NFC IOs has already been enabled. Decreasing the NFC module clock by setting SIM_CLKDIV4_NFCDIV to 31,  the demo still failed. How to fix it? Here we provide a trick/solution for this issue: Enable the internal pull-ups on NFC interface. then you may set a slower NFC clock by setting SIM_CLKDIV4_NFCDIV to 12, this value can be larger to make the communication more stable, but please note if you try to design a custom board, there is no reason it shouldn’t work at max frequency with a better layout. Hope that helps, -Kan
查看全文
To do: The development platform is Eclipse. The EVAL Board is the Kinetis Tower TWR K60. On the Tower, you find 2 pushbuttons and 4 LEDs. a) Generate a hexadecimal random number from 0x0 to 0xF as long as pushbutton1 is pressed. Display the result with the 4 LEDs for about 3 seconds. b) Replace the code for recognizing a pressed key by a macro "KEY1_PRESSED". c) Replace the access to the 4 LEDs by a macro "LEDx_TOGGLE" with x = 0...3". Use active wait loops instead of the timer in this Kinetis exercise. Result: TWR_K60_RANDOM.zip
查看全文
This document explains a potential issue where interrupts appear to be disabled after enterring debug mode. This is as a result of the NMI being active when debug is enabled.
查看全文
本文分享自China-FAE Team,谢谢同事的sharing! MQX如何自适应10/100Mbps网络          Kinetis K60 媒体接入控制器MAC(Media Access Layer)实现了数据链路层,同时支持10Mbps和100Mbps两种速率。MAC通过MII/RMII接口与PHY芯片连接。         现有的MQX4.0 RTCS协议栈在K60  Tower System Board无法支持与10Mbps交换机等网络设备通信。问题的原因是MQX4.0 BSP初始化代码macnet_init.c默认将MAC配置为100Mbps/Full Duplex模式。     MQX4.0 BSP针对TWR-SER所使用的PHY芯片(KSZ8041NL)的初始化代码没有考虑用户指定链路速率的情况,仅由PHY做默认设置。为了能够自适应链路速率,不仅需要设置KSZ8041NL的控制寄存器(0.13 Speed Select、0.8 Duplex Mode),还要设置K60的ENET_RCR/ENET_TCR寄存器。 解决办法: 修改MQX4.0 BSP代码,使能PHY芯片与网络设备端进行链路速率自动协商,然后读取PHY协议好的链路速率,通过这个链路速率设置MAC的相关寄存器ENET_RCR/ENET_TCR。MQX4.0的 PHY的接口函数已经提供了speed和duplex函数,可供MAC初始化调用,可以保证系统代码的可移植性。 测试结果: 修改后的MQX4.0 BSP代码能够自适应10/100Mbps网络,网络通信正常。
查看全文
Hey there Kinetis lovers!  We in the Systems Engineering team for Kinetis Microcontrollers see all kinds of situations that customers get into, and none can be particularly troubling like how the reset pin is handled.  The purpose of this document is to provide a list of Frequency Asked Questions (FAQ) that we get here in the Kinetis Systems Engineering department.  This is intended to be a living list and as such, may in no way be complete.  However we hope that you will find the below questions and answers useful.   Q:  Do I need to connect the reset signal to be able to debug a Kinetis device?   This is a commonly asked question. Strictly speaking, you do not need to connect the device reset line of a Kinetis device to the debug connector to be able to debug. The debug port MDM-AP register allows the processor to be held in reset by means of setting the System Reset Request bit using just the SWD_CLK and SWD_DIO lines.   However, before deciding to omit the reset line from your debug connector you should give some careful thought to how this may impact the ability to program and debug the device in certain scenarios. Does the debugger/flash programmer or external debug pod require the reset pin? It may be that the specific tool you are using only supports resetting the device by means of the reset line and does not offer the ability to reset the device by means of the MDM-AP. Have you changed the default function of the debug signals? You may need to use the SWD_CLK and/or the SWD_DIO signals for some other function in your application. This is especially true in low pin count packages. Once the function is changed (by means of the PORTx_PCRy registers) you will no longer have access to the MDM-AP via those signals. If you do not have access to the reset signal then you have no way of preventing the core from executing the code that will disable the SWD function of the pins. So you will not be able to re-program the device. In order to prevent this type of situation you need to either: Setup your code to change the function of the SWD pins several seconds after reset is released so that the debugger can halt the core before this happens. Put some kind of “backdoor” mechanism in your code that does not re-program the SWD function, or re-enables the SWD function, on these pins. For example, a specific character sequence sent via a UART or SPI interface.   Some Kinetis devices allow the reset function of the reset pin to be disabled. In this case you can only use the SWD signals as a means of resetting the device via the MDM-AP. If you change the SWD pin function in addition to disabling the reset pin then you must provide a backdoor means of re-enabling the SWD function if you want to be able to reprogram the device.
查看全文
This project is for neck's physical therapy and for a wheel chair that will move just with two buttons. This project is intended to be for persons who cannot move arms to do stuff.Instead of having a little joystick to move, they will just have to press one button turn around on the wheel chair or press the other button to make it advance. Because of the time we have to present this project, we will for now apply this idea to a toy car that will help children to do physical therapy on the neck.   Silla de Ruedas controlada por movimientos del cuello - YouTube   Facebook Original Attachment has been moved to: Code.zip
查看全文
I’ve noticed some comments about Kinetis MCUs availability and status that I’d like to address for the entire community. The Kinetis MCU portfolio has seen significant growth in the mass market and is on track for continued strong growth in the coming years. Due to this growth, the demand on the Kinetis MCUs has outstripped the available supply, leading to extended leadtimes.  We have invested additional resources across the manufacturing line for 2018 and beyond to increase overall capacity and are pleased to be able to communicate that the lead time is being reduced from 39 weeks to low 30's this month.  It is anticipated there will be further reduction in Q3 2018 with a target of being back to a typical 12-14wk lead time in Q1 2019.  Additionally, we have increased our product longevity commitment on Kinetis K, L, E, V, M and W MCUs to 15 years to support the strong pipeline of design-in activity across the Kinetis portfolio that we are seeing in the market.  This document was generated from the following discussion: Kinetis Availability &amp; Longevity
查看全文
Hi All, All training examples were tested on TWR-KM34Z75M board. We will be using the same board during the hands-on. If you have this board, please take it with you. We have in Roznov 15 pcs which will be given for use during the training. We will be using IAR Embedded Workbench for ARM. During installation, we recommend to download a 30 day eval version from IAR home page. The course license will be provided to you in Roznov prior training. Please install the following tool chains prior training: Tool description Link IAR Embedded Workbench for ARM 7.60.1 http://netstorage.iar.com/SuppDB/Protected/PRODUPD/011007/EWARM-CD-7601-11216.exe FreeMASTER 2.0 FreeMASTER 2.0 Application Installation TWR-KM34Z75M training examples Kinetis-M Bare metal drivers and examples 4.1.5
查看全文
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-332687
查看全文
You can put the code directory in the SDK_2.6.0_FRDM-K64F\boards\frdmk64f to use. 1、Introduction As is known to all, we use debugger to download the program or debug the device. FRDMK64 have the opsenSDA interface on the board, so wo do not need other’s debugger. But if we want to design a board without debugger but can download the program, we can use the bootloader. The bootloader is a small program designed to update the program with the interface such as UART,I2C,SPI and so on. This document will describe a simple bootloader based on the FRDMK64F.The board uses SD card to update the application. User can put the binary file into the card. When the card insert to the board ,the board will update the application automatically. The bootloader code and application code are all provided so that you can test it on your own board.   2、Bootloader’s implementation   The schematic for SD card is shown below. The board uses SDHC module to communicate with SD card.                                                  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 bootloader uses SDHC and fafts file system. So we should add files to support it.                   Figure 2.The support file   In main code, the program will wait until the card has inserted. Then it will find the file named “a000.bin” in sd card to update the application. If the file do not exist, the board will directly execute the application. If there is no application, the program will end. The following code shows how the program wait for inserting sd card. It will also check if the address has the application’s address.                      Figure 3.The code -- wait for inserting card   The following code shows how the program opens the binary file. If sd card doesn’t have the file, the program will go to the application. Figure 4.Open the binary file   If the program opens the file normally, the update will begin. It will erase 200k’s space from 0xa000. You can adjust it according to your project. Now I will explain update’s method in detail. Our data is written to the buffer called “rBUff”. The buffer size is 4K. Before write data to it, it is cleared.  Please note that when we erase or program the flash, we should disable all interrupts and when the operations finish we should enable the interrupts.  The file size will decide which way to write the data to flash.  1、If the size < 4k ,we just read the file’s data to buffer and judge if its size aligned with 8 byte. If not , we increase the size of “readSize” to read more data in our data buffer called “rBuffer”. The more data we read is just 0.    2、If the size > 4K, we use “remainSize” to record how much data is left. We read 4k each time until its size is smaller than 4k and then repeat step 1. When finish the operation at a  time, we should clear the buffer and increase the sector numer to prepare the next transmission. Figure 5.Write flash operation code   The way to clear the space is shown in the figure. It will initialize the flash and erase the given size from the given address.  “SectorNum” is used to show which sector to erase. Figure 6.Erase operation code   The following figure shows how to write the data to flash.              Figure 7.Program operation code    Before we go to the application, we should modify the configuration we did in the bootloader.     Close the systick, clear its value.     Set the VTOR to default value.     Our bootloader runs in PEE mode. So we should change it to FEI mode.     Disable the all pins. You should disable the global interrupt when run these codes. And don’t forget to enable the global interrupt. Figure 8.Deinitalization code   Then we can go to the application. Figure 9.Go to Application   3、Memory relocation The FRDMK64 has the 1M flash, from 0x00000000 to 0x00100000.As shown in figure 10,we use the 0xa000 as the application’s start address.            Figure 10.The memory map   Now, I will show you how to modify the link file for user application in different IDE. In IAR                                    Figure 11.IAR’s ICF In MDK Figure 12.MDK’s SCF   In MCUXpresso Figure 13.MCUXpresso’s flash configuration 4、Run the demo 1) Download the bootloader first. 2) Prepare a user application program. We use the “led blinky” as an example. 3) Modify the Link file. 4) Generate the binary file with your IDE, please name it as “a000.bin”. 5) Put it into the sd card like figure 5. Figure 14.SD card’s content        6) Insert the card. And power on. Wait for a moment, the application will execute automatically. 5、Reference 1) Kinetis MCU的bootloader解决方案 2) KEA128_can_bootloader
查看全文