飞思卡尔K60 DMA 中文手册
飞思卡尔单片机快速上手指南说明书
Freescale Semiconductor, Inc.Document Number: 用户指南 Rev. 0, 09/2014Confidentiality statement, as appropriate to document/part status.___________________________________________________________________飞思卡尔单片机快速上手指南作者:飞思卡尔半导体IMM FAE 团队飞思卡尔半导体是全球领先的单片机供应商,其单片机产品包含多种内核,有数百个系列。
为支持用户使用这些产品,飞思卡尔提供了丰富的网站资源、文档及软硬件工具,另外,我们还有众多的第三方合作伙伴及公共平台的支持。
对于不熟悉飞思卡尔产品和网站的初学者来说,了解和使用这些资源这无疑是一个令人望而生畏的浩瀚工程。
本指南的目的,就是给初学者提供一个指导,让他们不被这些海量信息淹没;用户根据本指导提供的操作步骤,能迅速找到所需的资源,了解如何使用相关的工具。
在本指南中,我们以飞思卡尔的新一代Kinetis 单片机K22系列为例,介绍了如何获取与之相关的资源,如何对其进行软硬件设计和开发。
实际上,这些方法也适用于其它的单片机系列。
当然,对于其它有较多不同之处的产品,我们也会继续推出相应的文档,供广大用户参考。
目录1 如何获取技术资料与支持 ..........................................................2 2 如何选择产品、申请样片及购买少量芯片和开发工具 ........... 93 飞思卡尔单片机的开发环境、开发工具和生态系统 ............. 224 如何阅读飞思卡尔的技术文档 ................................................ 45 5 飞思卡尔单片机硬件设计指南 ................................................ 55 6飞思卡尔单片机软件开发指南 (67)飞思卡尔单片机快速上手指南, Rev. 1, 09/20142Freescale Semiconductor, Inc.1 如何获取技术资料与支持1.1 概述当用户使用飞思卡尔单片机芯片时,如何获取芯片的数据手册(Datasheet )、参考设计(Reference Manual )和官方例程等资源呢?另外当用户遇到了技术问题该如何获得帮助和解答呢?这里以Kinetis 的K22系列芯片为例为大家介绍如何解决这些问题。
K60A电压用户指南说明书
K60A Voltage User GuideAugust 5 2010, Second EditionWARNING: SAFETY FIRSTFor safety reasons and to avoid personal injury, read all operating guides and information in the product guide. DO NOT attempt to modify Mentor device and sensors in any way. This may result in fire, injury, electric shock or severe damage to you or them.1.DO NOT operate Mentor device and sensors with wet hand, this may cause anelectric shock.2.DO NOT use Mentor device and sensors in close proximity to flammable or explosivegases, or chemical vapors. Use this product in a well ventilated area.3.For safety reasons keep this sensor out of reach of children or animals to preventaccidents, for example swallowing small size of the sensor. DO NOT allow children to play on or around the sensor.4.DO NOT use the sensor to check AC power circuits. DO NOT use the sensor in ACpower outlet or sockets, this may cause a hazardous injury to you.CAUTION:1.DO NOT use Mentor device and sensors in extreme conditions which are over theoperating range and short-term exposure limit conditions. Stresses above input range may cause permanent damage.2.Exposure to absolute maximum conditions for extended periods may degrade sensorreliability.3.The sensors are permanently sealed during construction and cannot be opened toany purpose. DO NOT attempt to decompose, modify or repair the sensor in any other ways. This may cause permanent damage to the sensor.4.Liquids shall not come into direct contact with the sensor. DO NOT place sensor orcable in water, liquids, flame or on a hot plate.5.DO NOT use this sensor in close proximity to flammable or explosive gases. Chemicalvapors may interfere with the polymer layers used for capacitive this sensor and high levels of pollutants may cause permanent damage to this sensor.Features and Specifications FeaturesItem DescriptionFeature Two voltage clips with electric patch cords: red testclip(+), black test clip(-)Non volatile memory supported for user calibration. Dimension Sensor base housing: 42x18x16 (WxDxH) in mmAlligator clip: 6cm(L),Electric patch cords l : 35cm(L), 3mm(φ)Usage Use only in a dry place at room temperature below+40°C.SpecificationsItem DescriptionInput range Differential: - 15V to +15VResolution 14bit spacing amplitude, Typ. ±2mV, Max. ±3mVAccuracy Typ. ±10mV, Min.±5mV @<±1.0V, Max. ±30mV Measurement deviation from linear correlation: -In full scale range: Typ.±0.2%-In lower range: Typ. ±0.05% @<±1.0VSampling rate1Default sampling periods: 0.2s (5samples/sec) Max.20samples/sMax. over voltage2±30VInput impedance 5.3±1.5% MΩ @25°CCalibration Factory calibration stored and FC values recovery supported to restore factory calibration.Optional user calibration data can be wrote to non-1If you need the sampling rate up to 1000samples/s, use the voltage sensor K60B. Or if you use the oscilloscope probe, you can view the waveform graph for voltage with max. 200kHz sampling rate in ±10V range.2Maximum overload voltage without damage, stress above this range may cause permanent damage.Item Descriptionvolatile user memory.User calibration methods: 1 or 2 points linearcalibrationZero offset Zero-voltage offset drift: Typ. ±1mV@25°CZero setting with non-volatile memory supported.NOTE:You do not need the calibration when using the voltage sensor. But if you calibrate the sensor for your any purpose, the calibration data created by user does not erased after disconnecting the sensor or power off Mentor. The data for calibration or zero setting with MentorStart is wrote to non-volatile memory in the sensor.Additional equipment or applicationMentor device and MentorStart application software needed. If you are using Mentor application, consult your instructor for more information. CAUTION:1.DO NOT connect this sensor to over voltage anywhere in the circuit orpower source. The voltage should NOT exceed +15V above or below earth ground.2.Always use the sensor on a known live voltage under the maximum inputrange before proceeding with your test and measurements.3.Make sure you are reasonably well grounded and isolated from the cableor any piece of equipment you are measuring.4.In some cases, the sensor may falsely indicate the voltage value due to anincorrect circuit you use.Setup and Usageunch the MentorStart software and connect the sensor to the sensorport in your Mentor device. MentorStart will automatically detect the sensor.2.To measure the voltage between the V+(red) clip and the V-(black) clip,connect the voltage clips across a battery, DC power source, or circuit elements.To measure the voltage with a voltmeter-like readingWhen you are reading one-shot data with Snapshot mode, you can use the sensor as a voltmeter which can be used to measure negative or positive potential difference.Fig.1 Testing a battery voltage with the Voltage sensor. You can check and test the most common type of household battery. For example, an AA battery is commonly used in electronic devices. When you replace the battery with an equal replacement battery to assure proper operation of your electronic device, you can check the battery which has enough voltage to power the device or not. In this activity, the voltage between the plus and minus on the battery have been referred to as EMF voltage generated by the battery.NOTE: The Voltage sensor is always connected in parallel with the part of the circuit to measure the potential difference across a circuit element.Fig.2 Testing the voltage with a voltmeter-like one shot reading after settingZero to the voltage sensor.Voltage and current measurementIn an application of Ohm’s law, you can measure the voltage across anelectrical resistance or Ohmic materials with the Voltage sensor and thecurrent through it with the Current sensor. When you measure the current,the Current sensor is placed always in series and the Voltage sensor isconnected in parallel. For an example of measuring the voltage and current,you use two 1.5volts batteries and the red LED3 (See Fig.3 and Fig.4).3 You can choose a LED referred to the supplier’s catalogues. You might check the parameters such as the forward voltage and current, and then you use a proper resistor for LED.Fig.3 Measure the voltage and the current through LED. Using Ohm’s law which works even for non-Ohmic materials where the resistance depends upon the current, you can calculate the resistance for LED.Fig.4 Voltage and Current measurement with the Voltmeter/Ammeter-like one-shot reading.Guide to Physics ExperimentsTable.1 Science experiments using the Voltage sensor.Students’ activity with practical physics experiments1 Measure the voltages across electrical elements in parallel2 Test the Voltage law4 and explore the Current law3 Test the Ohm’s law and explore the relationship5 between the voltageand the current4 Measure the power dissipated in a resistor5 Measure the DC power voltage in series or parallel circuits6 Test the combination rules for any number of resistors in series orparallel circuits7 Measure the charging or discharging voltage on a capacitor8 Investigate the behavior of LED or electrolytes with everydayhousehold materialsMeasure the voltage across a resistor in seriesIn this activity, students can easily demonstrate the voltage law with therelationship between the voltage and the electrical resistance which isdefined as the ratio of the voltage applied to the electric current while thecurrent flows through the resistance and the value of the current is the samein each resistor by the current law. Whether or not your material obeysOhm’s law, you can measure the potential difference with the resistors. Asyou can see Fig.1 shown below, you can make the combination for a numberof the resistors in series and you can measure the voltage across each or anynumber of resistors by the voltage law as the following calculation:V=V1 + V2 + V3 + … Vn4The voltage law is expressed as the net voltage drop around any closed loop path must be zero. See the reference from: /hbase/hframe.html5 A correlation between voltage and current is an important problem that students critically face during a physics concept developing by inquiry. For example, a student correlates the direct relationship that voltage is the required energy that drives the flow of current which will flow through conductorsWhere V is the sum of the voltages around any closed loop, V1, V2, … Vn are the voltage drops across the resistors r1, r2,…rn.Fig.1 Testing the voltage law with the combination rules for a number of the resistors in series. Each resistor has 1kΩ and the voltage of a battery is 1.5V. Exploring the transient behavior of a capacitorIn this experiment, if you connect the battery using the clip B+ and B- to the circuit as Fig.2 shown, the capacitor will be fully charged up to the battery voltage and the voltage reading will has a constant value of the maximum voltage. Just after then, if you disconnect the battery and join two clips of (B+)and (B-) together, the voltage reading will follow a type of an exponential decay curve. The mathematical model of a charging or discharging capacitor can be formed as the followings:V=Vb[1-exp(-t/RC)]… Charging capacitorV=Vc*exp(-t/RC)… Discharging capacitorwhere V is the changing voltage, R is the resistance and C is the capacitor. The voltage rate of charging or discharging can be described in terms of a time constant RC.Fig.2Testing the voltage rate for charging or discharging a capacitor. The resistor has 3000Ω and the capacitor is 1000μF.Table.1 Analysis results of decaying curve fit for discharging a capacitor. The mathematical formula of this decaying model is V=Vc*exp(-(t’+t0)/RC))+V0. For circuit parameters in this experiment, the theoretical value of RC is 0.333 where R=3000Ω and C=0.001F, and the calculated value with the decaying model is 0.327.Parameters Analysis resultst0 30.2t1 38.4dt (Sampling periods in seconds) 0.2Vc (Coefficient of best fit) 0.796Parameters Analysis results Theoritical value of (1/RC) 0.333 Calculated value of (1/RC) with0.327 exponential decaying modelV0 (Intercept of best fit) 0.018R-squared 0.999RMSE(Fit standard error) 0.015Fig.3 Voltage measurement graph of charging and discharging capacitor. You connect two voltage clips to the battery, and after reading the maximum voltage continuously, join two clips together to discharge the capacitor.You can fit the exponential curve with MentorStar t program as Fig.4 shown below and report the results if the curve fit, for example as you see Table.1.Fig.4 Exponential fit of decaying curve with MentorStart. When you press the curve fit icon on the screen of MentorStart, you can choose the equation of your model, y=A*exp(B*x)+C and calculated the parameters in the Table.1 above. To view the results of analysis, press the viewing results icon on the screen of MentorStart, not only you can get the results of the parameters such as the coefficients A, B and C with the fitting model, y=A*exp(B*x)+C, but also when you are trying to analyze the charging curve of a capacitor, you can choose the exponential model: y=A*(1-exp(B*x))+C.NOTE: To get the best fit of the measurement data, you predict the equation and choose the proper curve fitting model on the screen of MentorStart. Testing Ohm’s law with ohmic or non-ohmic materialsIn this activity, you measure the voltage and the current through the resistor, test and describe the relationship of Ohm’s law. The slopes in Fig.5 shown below tell us how an unknown resistance can be measured with a closed circuit and this makes it very easy to represent and apply Ohm’s law.Fig.5 Measurement chart of voltage versus current. To test Ohm’s law, youuse the Voltage senor and the Current6 or Galvanometer sensor. As the DCpower source, you use the battery or power supply. Each slope of the linearfit equation on voltage versus current chart shows the resistance of 56Ω,152Ω and 498Ω.In this activity, it is helpful to discuss the properties of the ohmic or non-ohmic materials7 in terms of the relationship between the resistance and thevoltage across it. Students inquire the relationship between the voltage andthe current depends on the source of electricity and materials being used inthe circuit.6In according to the results of the testing Ohm’s law, you can describe a logistic equation as the following: i=(E-V)/r, where E is the EMF voltage of power source, V is the voltage drop through the test resistor and r is a very small equivalent resistance due to dissipation of the Current sensor.7Although you use non-ohmic materials, you can use Ohm’s law to calculate the resistance across the non-ohmic materials. For example, you use LED and you can measure the voltage drop through LED.LIMITED WARRANTYPlease check that this product is operating properly prior to when you intend to use it for educational purposes only. Use this device and sensors for teaching and learning. The information given in this electronic document shall not be regarded as a guarantee or warranty of physical characteristics and any conditions. We will not replace or cover the costs of a damaged sensor or probe due to negligent or destructive, improper use.Korea Digital Co., Ltd.©2009 Korea Digital, All rights reserved.707, Ace Twin Tower1804, Ace Twin Tower2Guro Digital Complex, Seoul, Korea+82-2-2109-8877 (Tel)+82-2-2109-8878 (Fax)ScienceCube Mentor is a trademark ofKorea Digital, Co., Ltd.Designed by Korea Digital in KoreaFor more information about installingMentor, using other applications andgetting the feedbacks, contact:ScienceCube international distributor.If you have any questions about a guideto physics experiment using the sensor,please contact author at *************。
飞思卡尔K60入门
一、飞思卡尔Kinetis功能特性
1、ARM发展史 2、ARMv7处理器分类 3、ARM Cortex-M4特性 4、飞思卡尔Kinetis家族介绍 5、K60内部资源介绍
山东大学 Kinetis培训
ARM发展史
ARM架构发展历程
山东大学 Kinetis培训
ARMv7处理器分类
ARMv7根据应用分类:
• 应用处理器(Cortex-A系列) Aplication Processor • 实时控制器(Cortex-R系列) Real-time Processor • 微控制器(Cortex-M系列) Micro Controller 山东大学 Kinetis培训
最快频率、最高性能、合理功耗 即
模拟比较器
开发环境
3通道
CW10.1、IAR、MDK
山东大学 Kinetis培训
软件应用
调试工具
开发环境
二、K60开发生态系统
其 他 支 持
山东大学 Kinetis培训
Kinetis开发环境
支持Kinetis开发的IDE(集成开发环境)目 前主要包括CodeWarrior10.1及以上版本, IAR6.1及以上版本和Keil MDK(即Keil for ARM)等。
山东大学 Kinetis培训
飞思卡尔Kinetis家族
Kinetis系列是由飞思卡尔推出的业界第一款基于ARM
Cortex-M4内核的混合信号微控制器,采用飞思卡尔创新的 90nm薄膜存储器(TFS)闪存技术,具有独特的Flex存储器
(可配置的内嵌 EEPROM)。
Kinetis 微控制器系列融合了最新的低功耗革新技术,具有 高性能、高精度的混合信号能力,宽广的互连性,人机接口和
K60(Rev6-Ch49-SPI)(中文)
第49章SPI(DSPI)49.1 导言串行设备接口(serial peripheral interface ,SPI)模块提供一个在MCU和一个外部设备之间进行通信的同步串行总线。
49.1.1 框图SPI(DSPI)的框图如下所示:图49-1 DSPI框图49.1.2 特性DSPI支持三种SPI特性:•全双工,四线同步传输•主机与从机模式•持续选择从机,使数据流工作在从机模式下•使用有4级TX FIFO缓冲进行传输操作•使用有4级RX FIFO缓冲进行接收操作•TX与RX的FIFO可以被分别地禁止,低延迟更新到SPI队列•TX和RX的FIFO在调试解除时是透明的•可对每一帧的传输属性进行编程:•2个传输属性寄存器•可以对串行时钟的极性和相位进行编程•多种可编程的延迟•串行帧长度可被编程为4到16位,通过软件控制可以扩展•可以连续保持片选•6个外设片选,可以用复用器扩展到64个•通过复用器稳定地支持多达32个设备片选•DMA支持附加到TX FIFO的入口并且从RX FIFO中移除入口•TX FIFO未满(TFFF)•RX FIFO未空(RFDF)•6个中断条件:•到达队列结尾(EOQF)•TX FIFO未满(TFFF)•当前帧传输完成(TCF)•在发送FIFO为空时试图发送(TFUF)•RX FIFO未空(RFDF)•在接收FIFO满时接收帧(RFOF)•全局中断请求线•在与低俗外设进行通信时使用变更的SPI传输格式•低功耗结构特性•支持停止模式•支持休眠模式49.1.3 DSPI配置DSPI模块始终工作在SPI配置下。
SPI配置允许DSPI发送和接收串行数据。
此配置允许SDPI工作像基本SPI模块一样,使用内部FIFO,支持外部队列操作。
发送数据和接收数据在不同的FIFO。
主机CPU或一个DMA控制器从接收FIFO读取接收数据,并且写发送数据到发送FIFO。
对于队列操作,SPI队列可以驻留在系统RAM,并扩展到DSPI。
k60介绍(中文)
第2章简介2.1 概要本章提供了Kinetis组合和K60系列产品的概述。
同时,本章提供了本文件所包涵设备的高水准的描述。
2.2 Kinetis组合Kinetis是低功耗可扩展和在工业上使用混合信号ARM®Cortex™-M4系列MCU的最好的组合。
第一部分介绍超过200引脚、外围设备和软件兼容性的5个MCU系列。
每个系列提供了优良的性能,与普通外设内存,内存映射,并提供内部和系列之间轻松迁移包和功能可扩展性。
Kinetis MCUs使用了飞思卡尔的新的90nm带有独特FlexMemory的薄膜存储器(TFS)闪存技术。
Kinetis系列MCU结合了最新的低功耗革新技术和高性能,高精密混合信号功能与连通,人机界面,安全及外设广泛。
Kinetis MCUs使用了飞思卡尔和ARM第三方合作伙伴的市场领先的捆绑模式。
表示低功耗混合信号USB 段LCD以太网加密和篡改检测DDR所有Kinetis系列都包涵强大的逻辑、通信和时序阵列和带有伴随着闪存大小和I/O数量的集成度等级的控制外围部件。
所有的kinetis系列包涵一下共同特征:· 内核:· ARM Cortex-M4内核提供1.25 DMIPS / MHz的DSP指令(浮点单元在kinetis系列可用)。
· 高达32位的DMA,同时尽可能减小CPU干预。
· 提供50MHz、72MHz和100MHz几种CPU频率(120MHz和150MHz在kinetis可用)。
· 超低功耗:· 10种低功耗操作模式通过优化外设执行和唤醒时间来延长电池寿命。
· 为了增加低功耗的灵活性,增加了低漏唤醒单元、低功耗定时器和低功耗RTC。
· 业界领先的快速换醒时间。
· 内存:· 从32 KB闪存/ 8 KB的RAM可扩展为1 MB闪存/128 KB的RAM。
同时使空白的独立闪存执行代码和固件更新。
K60(Rev6-Ch24-MCG)(中文)
第24章多用途时钟信号生成器(MCG)24.1 介绍多用途多用途时钟信号生成器(MCG)模块为MCU提供多种时钟源选项。
这个模块由一个频率环锁(FLL)和一个相位环锁(PLL)组成。
FLL可由一个内部或外部参考时钟控制,而PLL可由一个外部参考时钟控制。
这个模块要么在FLL或PLL输出时钟之间,要么在内部参考时钟或外部参考时钟之间选择一个时钟源以作为MCU系统时钟。
MCG操作与晶体振荡器有关,其中晶体振荡器允许一个外部晶体、陶瓷共振器或外部时钟源产生外部参考时钟。
24.1.1 特性MCG模块的关键特性:◆频率环锁(FLL)。
●数控石晶(DCO)。
●DCO可设置时钟范围有四个。
●低频率外部参考时钟源的编程选项和最大DCO输出频率。
●内外参考时钟可以作为FLL源。
●可以作为其他片上外设的时钟源。
◆相位环锁(PLL)●电压控制振荡器(VCO)●外部参考时钟作为PLL时钟源。
●VCO频分模块。
●相位/频率检测器。
●集成环过滤器。
●可以作为其他片上外设的时钟源。
◆内参考时钟生成器●9个微调位的精确慢时钟●4个微调位的快时钟●可以被用作FLL的时钟源。
在FEI模式下,只有慢内参考时钟(IRC)可以被用作FLL源。
●无论是快时钟还是慢时钟都不能用作MCU的时钟源●可以作为其他片上外设的时钟源。
◆低功耗的石晶时钟发生器位MCG外部参考提供控制信号:●HGO,RANGE,EREFS◆从晶振获得外部时钟●可被用作FLL或PLL的时钟源●可被用作MCU的时钟源◆从RTC获得外部时钟●只能作为FLL的时钟源●只能选择MCU的时钟源◆带有重置请求能力的外部时钟监视器,可以在FBE,PEE,BLPE或者FEE模式下对外部时钟进行监测◆在PLL中使用的有中断请求能力的锁检测器◆外时钟参考的内参考时钟自动裁切功能(ATM)。
◆FLL和PLL的参考分频。
◆为其他片上设备提供时钟源的MCG PLL 时钟(MCGPLLCLK)◆为其他片上设备提供时钟源的MCG FLL时钟(MCGPLLCLK)◆为其他片上设备提供时钟源的MCG Fixed Frequency时钟(MCGPLLCLK)◆为其他片上设备提供时钟源的MCG 内参考时钟(MCGPLLCLK)图24-1 多用途时钟生成器(MCG)框图24.1.2 运行模式MCG共有九中运行模式:FEI,FEE,FBI,FBE,PEE,BLPI,BLPE,和终止模式。
K60快速使用手册
K60核心开发板快速使用说明1、K60连接方式:K 60的JTAG的10pin线插接方式,miniUSB也是要插上去的,送的miniUSB是供电给K60的转接板的插线方式,10pin是连接K60的,20pin是连接Jlink V8或者ulink2的标准JTAG接口K60和JlinkV8连接后的图K60和JlinkV8连接后的图如果要查看串口的输出信息,可以使用TTL转串口的板子,例程的串口使用的是K60的串口3,串口3可以输出很多调试信息和例程的相关信息。
K60板子上的插针C16和C17就是串口的RXD和TXD。
波特率是115200K60核心板供电方式可以使用USB接口供电,也可以使用插针位置供电,请注意插针位置供电的选择:2开发软件的安装:Kinetis_K60(客户资料)\开发软件这个文件夹下有相关的开发软件,一般推荐IAR开发软件。
IAR-EWARM-EV-CD-6307安装这个开发软件IAR_Kegen_PartB,这个是注册机,用来生成IAR的注册码的,win7下使用的时候的,请使用管理员模式运行,否则无法生成正确的注册码。
例如图中已经生成了一个注册码使用注册机的时候,第一步:先选择对应版本的IAR软件,第二步,点获取注册码,然后根据顺序,将生成的license number复制后,粘贴到IAR的安装要求输入对话框中,下一步将生成的license key复制,贴到IAR的安装下一步要求输入对话框中,继续点下一步完成安装。
注意:win7下使用的时候的,请使用管理员模式运行,否则无法生成正确的注册码。
我们的开发例程都是IAR的请先安装IAR软件,IAR软件在光盘我们已经配备了\Kinetis_K60-100(客户资料)\开发软件工具\IAR开发软件及注册机在这里找到要安装IAR软件:IAR-EWARM-EV-CD-6307启动后,选择如下图所示的目录,启动IAR软件的安装。
启动安装后,直接点“next”就行了。
飞思卡尔半导体用户指南说明书
Freescale Semiconductor User’s Guide1OverviewThe Freescale Freedom development platform is a set of software and hardware tools for evaluation and development. It’s ideal for the rapid prototyping ofmicrocontroller-based applications. The Freescale Freedom KL26Z hardware (FRDM-KL26Z) is a capable and cost-effective design featuring a Kinetis L seriesmicrocontroller, the industry’s first microcontroller built on the ARM® Cortex™-M0+ core.FRDM-KL26Z can be used to evaluate the KL16 and KL26 Kinetis L series devices. It features a KL26Z128VLH4, a device boasting a maximum operating frequency of 48MHz, 128KB of flash, a full-speed USB controller, and numerous analog and digital peripherals. The FRDM-KL26Z hardware is form-factor compatible with the Arduino™ R3 pin layout, providing a broad range of expansion board options. The on-board interfaces include an RGB LED, a 6-axis digital sensor (combining a 3D accelerometer and 3Dmagnetometer), ambient light sensor, and a capacitive touch slider.The FRDM-KL26Z features the Freescale open standard embedded serial and debug adapter known as OpenSDA.Doc Number:FRDMKL26ZUGRev. 0, 10/2013Contents1.Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.Reference documents . . . . . . . . . . . . . . . . . . . . . . . . . 23.Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24.FRDM-KL26Z hardware overview . . . . . . . . . . . . . . 25.FRDM-KL26Z hardware description . . . . . . . . . . . . . 5FRDM-KL26Z User’s GuidebyFreescale Semiconductor, Inc.Reference documentsThis circuit offers several options for serial communications, flash programming and run-control debugging.2Reference documentsThe table below provides a list of reference documents for the FRDM-KL26Z hardware. All of these documents are available online at /FRDM-KL26Z.Table1. FRDM-KL26Z reference documentsFilename DescriptionFRDM-KL26Z Quick Start Package Quick Start Guide and supporting files for getting started with the FRDM-KL26Z FRDM-KL26Z User’s Guide This document—overview and detailed information for the FRDM-KL26ZhardwareFRDM-KL26Z Pinouts Spreadsheet of pin connections for all MCU pins. Includes pinout for the I/Oheaders, Arduino R3 compatibility chart, and OpenSDA MCU pinout.FRDM-KL26Z Schematics PDF schematics for the FRDM-KL26Z hardwareFRDM-KL26Z Design Package Zip file containing all design source files for the FRDM-KL26Z hardware OpenSDA User’s Guide Overview and instructions for use of the OpenSDA embedded debug circuit3Getting startedSee the FRDM-KL26Z Quick Start Package for step-by-step instructions to get started with the FRDM-KL26Z. See the Jump Start Your Design section on /FRDM-KL26Z for the Quick Start Package and software lab guides.4FRDM-KL26Z hardware overviewThe features of the FRDM-KL26Z include:•MKL26Z128VLH4 in a 64 LQFP package•Capacitive touch slider•FXOS8700CQ accelerometer and magnetometer•Tri-color (RGB) LED•Ambient light sensor•User push button•Flexible power supply options – USB, coin cell battery, external source•Battery-ready, power-measurement access points•Easy access to MCU I/O via Arduino™ R3 compatible I/O connectors•Programmable OpenSDA debug interface with multiple applications available including:—Mass storage device flash programming interface—P&E Debug interface provides run-control debugging and compatibility with IDE toolsFRDM-KL26Z hardware overview—CMSIS-DAP interface: new ARM standard for embedded debug interface—Data logging applicationFigure1 shows a block diagram of the FRDM-KL26Z design. The primary components and their placement on the hardware assembly are pointed out in Figure2.Figure1. FRDM-KL26Z block diagramFRDM-KL26Z hardware overview! (Figure2. FRDM-KL26Z feature call-outsFRDM-KL26Z hardware description5FRDM ‐KL26Z hardware description5.1Power supplyThere are multiple power supply options on the FRDM-KL26Z. It can be powered from either of the USB connectors, the VIN pin on the I/O header, an on-board coin cell battery, or an off-board 1.71-3.6V supply from the 3.3V pin on the I/O header. The USB and VIN supplies are regulated on-board using a 3.3V linear regulator to produce the main power supply. The other two sources are not regulated on-board. Table 2 provides the operational details and requirements for the power supplies.Table 2.Power supply requirementsNote that the OpenSDA circuit is only operational when a USB cable is connected and supplying power to J10. However, protection circuitry is in place to allow multiple sources to be powered at once.Figure 3 shows the schematic drawing for the power supply inputs and the on-board voltage regulator.Figure 3. Power supply schematicIn addition, regulated power can be supplied to J3 pin 10 from an external source through P5-9V_VIN by populating the board with an optional voltage regulator, e.g. a 7805 style regulator in a TO-220 package, thus providing a high current supply to external devices. To prevent voltage sag under a high load, C23,Supply Source Valid RangeOpenSDA Operational?Regulated on-board?OpenSDA USB (J7)5V Yes Yes KL26Z USB (J5)5V No Yes V in 4.3-9V No Yes 3.3V pin 1.71-3.6V No No Coin cell battery1.71-3.6VNoNoFRDM-KL26Z hardware descriptionC24, C25 & C28 should be populated with appropriately sized capacitors to match the regulator chosen. See Figure4.Figure4. Optional voltage regulator schematicTable3. FRDM-KL26Z power suppliesPowerDescriptionSupply NameP5-9V_VIN Power supplied from the V in pin of the I/O headers (J3 pin 16)P5V_SDA Power supplied from the OpenSDA USB connector (J10). A Schottky diode provides back drive protection.P5V_KL26Z Power supplied from the KL26Z USB connector (J6). A Schottky diode provides back drive protection P3V3_VREG Regulated 3.3V supply. Sources power to the P3V3 supply rail with an optional back drive protection Schottky diode.12P3V3_BATT Coin cell battery supply voltage. Sources power to the P3V3 supply rail with the option of adding a back drive protection Schottky diode.3P3V3Main supply rail for the FRDM-KL26Z assembly. May be sourced from P3V3_VREG, P3V3_BATT, or directly from the I/O headers (J3 pin 8).P3V3_KL26Z KL26Z MCU supply. Header J5 provides a convenient means for energy consumption measurements.4 P3V3_SDA OpenSDA circuit supply. Header J15 provides a convenient means for energy consumptionmeasurements.4P5V_USB Nominal 5V supplied to the I/O headers (J3 pin 10). Sourced from either the P5V_KL26Z or P5V_SDA supply through a back drive protection Schottky diode.FRDM-KL26Z hardware description5.2Serial and debug adapter (OpenSDA)OpenSDA is an open standard serial and debug adapter. It bridges serial and debug communications between a USB host and an embedded target processor as shown in Figure 5. The hardware circuit is based on a Freescale Kinetis K20 family microcontroller (MCU) with 128 KB of embedded flash and anintegrated USB controller. OpenSDA features a mass storage device (MSD) bootloader, which provides a quick and easy mechanism for loading different OpenSDA applications such as flash programmers, run-control debug interfaces, serial-to-USB converters, and more. See the OpenSDA User’s Guide for more details.Figure 5. OpenSDA high-level block diagramOpenSDA is managed by a Kinetis K20 MCU built on the ARM® Cortex™-M4 core. The OpenSDA circuit includes a status LED (D8) and a pushbutton (SW2). The pushbutton asserts a reset signal to the KL26Z target MCU. It can also be used to place the OpenSDA circuit into Bootloader mode. OpenSDA MCU RESET can be isolated from SW2 by cutting the trace between pins on J13. SPI and GPIO signals1By default the linear regulator, U1, is a 3.3V output regulator. However, this is a common footprint that would allow the user to modify the assembly to utilize an alternative device such as a 1.8V or 2.5V regulator. The KL26Z microcontroller has an operating range of 1.71V to 3.6V.2D2 is bypassed by J14. By default, the pins of J14 are shorted together, to reduce the voltage drop across D2. To use D2, cut the trace between the pins of J14.3If a coin cell battery is to be used, add a small amount of solder to the coin cell ground pad before adding the battery holder. Also, it is recommended to populate D1 as a protection diode when using a coin cell battery.4J5 and J15 are not populated by default. The two pins of these headers are in parallel with 0 Ω resistors. In addition, J5 is also in parallel with a 10 Ω resistor. To measure the energy consumption of the KL26Z, either a voltmeter or an ammeter may be used. To use a voltmeter, R3 (0 Ω) must be removed before connecting the voltmeter probes to the pins of J5. Both R3 and R2 (10 Ω) must be removed to measure current with an ammeter. For the OpenSDA MCU, energy consumption can be measured by removing R4 (0 Ω) and connecting ammeter probes to the pins of J15.FRDM-KL26Z hardware descriptionprovide an interface to the SWD debug port of the KL26Z. Additionally, signal connections are available to implement a UART serial channel. The OpenSDA circuit receives power when the USB connector J10 is plugged into a USB host.5.2.1Debug interfaceSignals with SPI and GPIO capability are used to connect directly to the SWD of the KL26Z. These signals are also brought out to a standard 10-pin (0.05”) Cortex Debug connector (J7). It is possible to isolate the KL26Z MCU from the OpenSDA circuit and use J7 to connect to an off-board MCU. To accomplish this, cut the trace on the bottom side of the PCB that connects J8 pin 1 to J8 pin 2. This will disconnect the SWD_CLK pin to the KL26Z so that it will not interfere with the communications to an off-board MCU connected to J7.Figure6. SWD debug connectorNote that J7 is not populated by default. A Samtec FTSH-105-02-F-D or compatible connector can be added to the J7 through-hole connector. A mating cable, such as a Samtec FFSD IDC cable, can then be used to connect from the OpenSDA of the FRDM-KL26Z to an off-board SWD connector.5.2.2Virtual serial portA serial port connection is available between the OpenSDA MCU and pins PTA1 and PTA2 of the KL26Z. Several of the default OpenSDA Applications provided by Freescale, including the MSD Flash Programmer and the P&E Debug Application, provide a USB communications device class (CDC) interface that bridges serial communications between the USB host and this serial interface on the KL26Z.5.3KL26Z microcontrollerThe target microcontroller of the FRDM-KL26Z is the KL26Z128VLH4, a Kinetis L series device in a 64 LQFP package. The KL26Z MCU features include:FRDM-KL26Z hardware description•32-bit ARM Cortex-M0+ core—Up to 48 MHz operation—Single-cycle fast I/O access port•Memories—128 KB flash—16 KB SRAM•System integration—Power management and mode controllers—Low-leakage wakeup unit—Bit manipulation engine for read-modify-write peripheral operations—Direct memory access (DMA) controller—Computer operating properly (COP) Watchdog timer•Clocks—Clock generation module with FLL and PLL for system and CPU clock generation—4 MHz and 32 kHz internal reference clock—System oscillator supporting external crystal or resonator—Low-power 1kHz RC oscillator for RTC and COP watchdog•Analog peripherals—16-bit SAR ADC w/ DMA support—12-bit DAC w/ DMA support—High speed comparator•Communication peripherals—Two 16-bit Serial Peripheral Interfaces (SPI)—USB dual-role controller with built-in FS/LS transceiver—USB voltage regulator—Two I2C modules—One low-power UART and two standard UART modules—One I2S module•Timers—One 6-channel Timer/PWM module—T wo 2-channel Timer/PWM modules—2-channel Periodic Interrupt Timer (PIT)—Real time clock (RTC)—Low-power Timer (LPTMR)—System tick timer•Human-Machine Interfaces (HMI)—General purpose input/output controllerFRDM-KL26Z hardware description—Capacitive touch sense input interface hardware module5.3.1Clock sourceThe Kinetis KL26 microcontrollers feature an on-chip oscillator compatible with three ranges of input crystal or resonator frequencies: 32-40 kHz (low freq. mode), 3-8 MHz (high frequency mode, low range) and 8-32 MHz (high frequency mode, high range). The KL26Z128 on the FRDM-KL26Z is clocked from an 8 MHz crystal.5.3.2USB interfaceThe Kinetis KL26 microcontrollers feature a dual-role USB controller with on-chip full-speed andlow-speed transceivers. The USB interface on the FRDM-KL26Z is configured as a full-speed USB device. J6 is the USB connector for this interface.Figure7. USB connector schematicIn order to enable USB host functionality on the FRDM-KL26Z, it is necessary to populate J9 and R8 as shown in Figure7. However, there is no electrical protection provided. Use the USB host functionality at your own risk.FRDM-KL26Z hardware description 5.3.3Serial portThe primary serial port interface signals are PTA1 and PTA2. These signals are connected to both the OpenSDA and to the J1 I/O connector. Note that the OpenSDA connection can be isolated from J1 by removing R13 & R14, if required.5.3.4ResetThe PTA20/RESET signal on the KL26Z128 is connected externally to a pushbutton, SW2, and also to the OpenSDA circuit. However, J13 has been provided to isolate the OpenSDA MCU from SW2. Isolating the RESET line allows a more accurate measurement of the target device’s power consumption in low-power modes. The reset button can be used to force an external reset event in the target MCU. The reset button can also be used to force the OpenSDA circuit into bootloader mode. See Section5.2, “Serial and debug adapter (OpenSDA), for more details.5.3.5DebugThe sole debug interface on all Kinetis L Series devices is a serial wire debug (SWD) port. The primary controller of this interface on the FRDM-KL26Z is the onboard OpenSDA circuit (see Section5.2, “Serial and debug adapter (OpenSDA)). However, an unpopulated 10-pin (0.05”) Cortex Debug connector, J7, provides access to the SWD signals. The Samtec FTSH-105-02-F-D or compatible connector can be added to the J7 through-hole debug connector to allow for an external debug cable to be connected.5.4Capacitive touch sliderTwo Touch Sense Input (TSI) signals, TSI0_CH9 and TSI0_CH10, are connected to capacitive electrodes configured as a touch slider. Freescale’s Touch Sense Software (TSS) provides a software library for implementing the capacitive touch slider.5.56-axis accelerometer and magnetometerA Freescale FXOS8700CQ low-power, six-axis accelerometer and magnetometer is interfaced through an I2C bus and two GPIO signals as shown in Table4. By default, the I2C address is 0x1D (SA0 pulled high).Table4. Accelerometer signal connectionsFX0S8700CQ KL26Z128SCL PTE24SDA PTE25INT1PTD0INT2PTD1FRDM-KL26Z hardware descriptionFigure 8. FXOS8700CQ schematic diagram5.6RGB LEDThree PWM-capable signals are connected to a red, green, blue LED, D7. The signal connections are shown in Table 5.Table 5. RGB LED signal connectionsFigure 9. RGB LED schematic diagramRGB LEDKL26Z128Red cathodePTE29Green cathodePTE31Blue cathodePTD511PTD5 is also connected to the I/O header on J2 pin 10 (also known as D13).FRDM-KL26Z hardware description5.7Ambient light sensorAn ambient light sensor is connected to ADC0_SE3 (PTE22). This sensor may be isolated from PTE22 by removing R36.5.8Input/Output connectorsThe KL26Z128VLK4 microcontroller is packaged in a 64-pin LQFP. Some pins are utilized in on-board circuitry, but many are directly connected to one of four I/O headers.The pins on the KL26Z microcontroller are named for their general purpose input/output port pin function. For example, the 1st pin on Port A is referred to as PTA1. The I/O connector pin names are given the same name as the KL26Z pin connected to it, where applicable.FRDM-KL26Z hardware descriptionNote that all pinout data is available in spreadsheet format in FRDM-KL26Z Pinouts. See Section2, “Reference documents” for details.5.9Analog reference voltageThe onboard ADC of the KL26Z128VLH4 MCU uses the Reference V oltage High (VREFH) and Reference V oltage Low (VREFL) pins to set high and low voltage references for the analog modules. On the FRDM-KL26Z, by default VREFH is attached to P3V3_KL26Z (3.3V Supply). VREFL is connected to GND. Figure10 illustrates this circuitry.Figure10. FRDM-KL26Z VREFH circuit schematicIf desired, VREFH can use a VDDA independent reference by adding R11 and a Zener diode (D6). R10 (0 Ω resistor) must be removed when implementing this option. Alternatively, VREFH can be attached to an external source through AREF by removing R10 and populating R9 with a 0 Ω resistor.5.10Arduino compatibilityThe I/O headers on the FRDM-KL26Z are arranged to allow compatibility with peripheral boards (known as shields) that connect to Arduino™ and Arduino-compatible microcontroller boards. The outer rows of pins (the even numbered pins) on the headers share the same mechanical spacing and placement as the I/O headers on the Arduino Revision 3 (R3) standard.FRDM-KL26Z hardware descriptionRefer to the FRDM-KL26Z Pinouts spreadsheet for a compatibility chart showing how all the functions of the KL26Z signals on the I/O connectors map to the pin functions available on the Arduino Uno R3.Document Number:FRDMKL26ZUG Rev. 010/2013Information in this document is provided solely to enable system and software implementers to use Freescale products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document.Freescale reserves the right to make changes without further notice to any products herein. Freescale makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters that may be provided in Freescale data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including “typicals,” must be validated for each customer application by customer’s technical experts. Freescale does not convey any license under its patent rights nor the rights of others. Freescale sells products pursuant to standard terms and conditions of sale, which can be found at the following address: /SalesTermsandConditions.How to Reach Us:Home Page:Web Support:/supportFreescale, the Freescale logo, and Kinetis are trademarks of FreescaleSemiconductor, Inc., Reg. U.S. Pat. & Tm. Off. ARM is the registered trademark ofARM Limited. ARM Cortex-M0+ is the trademark of ARM Limited. All other product orservice names are the property of their respective owners.© 2013 Freescale Semiconductor, Inc.。
飞思卡尔K60入门资料课件
将JTAG调试器连接到计算 机,并下载和安装相应的 驱动程序。
打开Keil MDK-ARM软件 ,创建一个新项目,选择 正确的芯片型号(K60), 并配置项目属性,如工作 空间、工具链等。
使用串口通信线将开发板 与计算机连接起来,以便 在开发过程中进行调试和 数据传输。
使用Keil MDK-ARM软件 编写代码,并进行编译和 调试。
K60在图像处理中的应用
K60芯片具有高速的图像处理能力,可以用于实现各种图像处理算 法,如图像增强、目标检测、人脸识别等。
图像处理实例代码
提供一些基于K60芯片的图像处理实例代码,包括图像增强、目标 检测等。
通信系统实例
通信系统概述
通信系统是实现信息传输和交换的技术体系,包括无线通信、有 线通信、卫星通信等。
软件问题及解决方案
总结词
软件问题通常涉及到编程环境、编译错误、烧录程序等,需要检查软 件配置和代码错误。
编程环境配置
确保你使用的编程环境(如IAR Embedded Workbench、Keil uVision等)已正确配置,包括驱动程序安装、工具链设置等。
编译错误
检查代码是否有语法错误或逻辑错误,仔细阅读编译器给出的错误提 示,定位并修复问题。
K60在通信系统中的应用
K60芯片具有高速的通信接口和强大的数据处理能力,可以用于实 现各种通信系统,如无线通信网络、卫星通信系统等。
通信系统实例代码
提供一些基于K60芯片的通信系统实例代码,包括无线通信网络协 议栈的实现、卫星通信系统的数据处理等。
05
K60芯片常见问题及解决方案
硬件问题及解决方案
开发环境常见问题及解决方案
1. Keil MDK-ARM软件安装问题:确保从官方网 站下载正确的版本,并按照安装向导进行操作。 如果遇到问题,可以查阅Keil官方文档或寻求技 术支持。
飞思卡尔中文手册
Slide 6
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2005.
内部EEPROM位置初始化寄存器
EEON 1 = EEPROM IS ENABLED 0 = EEPROM IS DISABLED
Slide 7
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2005.
内部寄存器位置初始化寄存器
15 14 13 12
Slide 5
11 10 9 8 0 000
7654 3210 0000 0 0 0 0 0x1000
0
0 0 1
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2005.
K60(Rev6-Ch27-Flash-Memory-Controller)(中文)
a第27章 FLASH内存控制器(FMC)27.1 介绍FLASH内存控制器(FMC)是一个内存加速单元提供:●在设备和双行之间的一个接口,64位不易失性内存。
●缓存可以加速FLASH,和FlexNVM数据传输。
27.1.1 概述FLASH内存控制器管理设备和双行之间的一个接口,64位不易失性内存。
FMC接收状态信息详细记录了内存的配置,使用该信息可确保一个正确的接口。
下表显示了支持8位,另外,FMC位加速设备和Flash内存之间的接口提供了3个分开的机制。
一个64位预缓冲可以预先得到下一个64位flash内存的位置,两个4路,8位设置的缓存和一个单入口的64位缓冲可以存储预先访问的flash内存或者快速访问时间的FlexMemory数据。
27.1.2 特征FMC特征包括:1.flash内存的一个写操作或者在错误环境了的FlexNVM结果。
●设备和双行之间的一个接口,64位flash内存和FlexMemory:●8位,16位,32位读操作到程序flash内存和FlexNVM。
●8位,16位,32位读操作和写操作到FlexRAM作为EEPROM。
●连续的读访问(如0x0,,0x4)返回第二次读数据且没有等待状态。
内存通过32位总线访问返回64位。
●为设置没有访问,只读访问,只写访问提供保护的交叉主访问,或位每个交叉主访问的读写访问。
●加速从flash内存和FlexMemory到设备的数据传输:●每个主机和行的指令/数据访问的带有控制的64位预缓冲●带有每行替换算法和每行锁定控制的32个64位条目的4路,8集,64位行大小的缓存。
●可以使能每行的单条目的缓存●每个缓存的无效控制。
27.2 操作模式FMC只在设备访问flash内存或者FlexMemory时操作。
就设备电源模式而言:●FMC只在运行和等待模式操作,包括VLPR和VLPW模式。
●对于任何模式,在FMC禁止时,FlexMemory或者flash内存不能被访问。
飞思卡尔K60CH45ENET中文
飞思卡尔K60CH45ENET中文飞思卡尔K60 参考手册2012年6月2日版Chapter45 ENET·实现802.3规范,支持前导码/SFD产生,帧填充,CRC产生和校验·支持0长度前导码·可动态配置为支持10/100Mbps·支持10/100Mbps全双工,可配置为半双工·与AMDmagic包检测兼容·可以支持PHY:>4比特MII,工作于25MHz>2比特RMII,工作于50MHz·64比特FIFO用户应用接口·全速CRC32校验,可配置是否转发FCS给客户层·CRC32产生并添加到发送帧中,也可直接由用户应用提供FCS·全双工模式下:>实现自动pause帧产生和终止,允许没有用户应用干预的流控。
>pause时长可动态编程>pause帧生产可以有用户应用产生来进行流控>可配置是否将pause帧转发给应用>实现标准的流控机制。
·半双工模式下:提供完整的冲突检测,包括jamming,backoff 和自动重传等·支持VLAN帧·可编程的MAC地址:插入到发送帧,接收时丢弃地址不匹配的帧(广播帧和pause帧除外)·可编程为混杂模式,接收时不检查MAC地址·接收时采用hash开展多播地址和组播地址过滤,节省上层处理负担·可编程的最大帧长,支持标准和专有帧长·统计·简单握手的用户应用FIFO接口,提供完全可编程的深度和门限·用户接口收到的每个帧都提供各自的状态,如帧长,类型,错误信息等·多种内部loopback选项·MDIO主接口用于PHY的配置,采用两个可编程MDIO基地址·支持传统的FEC缓冲区描述符45.1.2.2 IP协议性能优化·只对协议数据和IP头优化·支持线速处理·支持IPV4和IPV6·其他类型和协议数据透传·指示VLAN帧·接收时自动进行IP头和载荷校验计算和检查·自动IP收和载荷简要产生并自动插入到发送帧中·支持IP、TCP、UDP、ICMP数据校验和产生和检查·支持IPV4和TCP协议头部的所有可选项·支持IPV6·支持接收IP和协议错误的统计信息·可配置自动丢弃错误帧·可配置自动进行收发期间IP和TCP.UDP.ICMP头字节顺序的转换·可配置接收时丢弃短IP帧的填充·可配置以太网载荷对齐,以允许头部和载荷的32比特对齐处理·FIFO可配置为存储转发45.3.1 ENET_EIR事件发生时会设置EIR中的一个比特,如果相应的EIMR位置位,则会产生一个中断。
飞思卡尔K60入门课件
K60芯片内置硬件浮点单元,支持浮点运算 和数字信号处理。
外设接口丰富
可扩展性
K60芯片集成了多种外设接口,如UART、 SPI、I2C等,方便开发者进行硬件连接和 通信。
K60芯片支持多种外设扩展,可以根据不同 的应用需求进行功能扩展。
02 K60开发环境搭建
开发环境概述
嵌入式系统开发环境
用于编写、编译、调试嵌入式系统程序的环境。
飞思卡尔官方网站和开发者社区提供了丰富的教程资源,从入门到进阶,涵盖 了K60微控制器的各种应用场景和开发技巧。
参与开源项目
开源项目
参与开源项目是学习K60的一种有效 方式,可以了解其他开发者是如何使 用K60进行开发的,并从中获取灵感 和学习经验。
贡献社区
通过参与开源项目,不仅可以学习到 其他人的开发经验,还可以将自己的 经验和技巧分享给社区,与其他开发 者共同进步。
电平;在读操作时,可以读取引脚的电平状态。
中断编程
中断概述
中断是一种常见的硬件机制,用于处理紧急事件或异常情况。在微控制器中,中断可以由 外部事件或内部事件触发,打断当前正在执行的程序,转而执行相应的中断处理程序。
中断配置
配置中断的触发方式、优先级和中断处理程序。在飞思卡尔K60微控制器中,可以通过编 程配置中断的属性。
连接调试接口
将调试器正确连接到K60开发板的调试接口上, 确保物理连接稳定。
ABCD
驱动安装
根据调试器型号,安装相应的驱动程序,以便于 与开发环境进行通信。
配置调试参数
在开发环境或调试软件中设置调试参数,如波特 率、数据位、停止位等,确保通信正常。
系统烧写
准备烧写文件
根据K60的硬件配置和开发 需求,准备相应的系统烧写
Kinetis K60核心板套件用户手册V2.0
通联物网Kinetis K60 Cortex ™-M4 核心板+扩展板用户手册(ARM ® Cortex ™-M4 V2.0)北京通联物网教育咨询有限公司更新说明1、本次更新为2.0版本2、本次更新了K60套板的全部基础案例,共计59个案例。
后续基于KL04的传感器模块基础实验会不断更新到本文档目录更新说明 (2)目录 (3)一、Kinetis K60 Cortex ™-M4 (4)二、产品介绍 (6)1、产品简介 (6)2、开发板硬件资源 (10)2.1、核心开发板硬件资源 (10)2.2、通用扩展开发板硬件资源 (11)2.3 K60 核心板+通用扩展板配套光盘资料 (12)2.4 K60 核心板+扩展板C语言代码实验案例 (13)三、实验案例操作方法 (13)3.1搭建开发环境 (13)3.2安装串口转USB接口驱动 (15)3.3建立实验调试“超级终端”环境 (15)3.4注意事项及建立IAR6.3调试环境 (18)3.5基础案例 (23)一、Kinetis K60 Cortex ™-M4核心板+扩展板及配件照片:图1-1 K60/K10 核心板(正面)图1-2 K60/K10 核心板(反面)图1-3 K60 完全版扩展板(正面)图1-4 K60/K10 核心板+简化扩展板+JLINK 仿真器连接图图1-5 JLINK V8 仿真器二、产品介绍1、产品简介Cortex-M 系列内核是ARM 公司针对低功耗和高性能的嵌入式控制市场而开发的内核。
Cortex-M0 和Cortex-M3 系列芯片广泛的应用于智能仪表、智能卡、智能家电、智能玩具、短距离联网应用(Zigbee 和NFC)、汽车电子和高效电机控制等领域。
ST、TI、NXP、Atmel 和东芝等芯片设计公司都已经推出Cortex-M3 的MCU。
Cortex-M4 是ARM 公司于2009 年下半年推出的内核,其性能比Cortex-M3 提高20%。
智能车摄像头DMA采集方案
在之前做飞思卡尔智能车比赛时接触过K60的DMA,用DMA可以采集图像,也可以用DMA来测速。
概念相信大家都清楚:所谓 DMA就是直接内存取( Direct Memory Access ),是计算机科学中的一种内存访问技术。
书上说,DMA模块可以不占用CPU自行传输数据,能够减轻CPU的负担,然而具体原理是怎样的呢?为什么DMA能够不需要CPU的介入呢?我查阅了相关资料,大概地了解了些。
在STM32中,DMA单元和Cortex CPU之间对总线使用一种交叉存取的机制。
DMA 传输遵循相应的传输流程。
其中,在数据从内存传输到内存的情况下,每传输一个字要消耗5个时钟周期:1个读周期,1个写周期,插入3个空闲周期供CPU使用。
所以,每个DMA通道都只是在总线存取周期才会占用总线,即使传输大量数据,DMA单元最大也只会消耗40%的数据总线带宽。
所以说,STM32中的DMA与CPU对总线的使用方式是交叉式的。
在K60中,DMA是通过DMA控制器接管接管数据和地址总线。
如果CPU正在执行指令,DMA控制利用空闲的地址和数据总线完成数据传送,某种程度上说,CPU 运算和数据传送是在并行进行的。
K60的DMA数据的传送分为主循环(major loop)和副循环(minor loop)。
major loop循环一次,可能需要minor loop循环多次。
每个minor loop循环都需要DMA源发来请求或者通过软件请求。
每个minor loop传送完毕,对应的DMA通道就进入空闲模式,等待下一次DMA请求。
当所有DMA传送完毕,即置DONE标志,并且可以通过设置选择传送完毕是否触发中断。
此外,可以通过相关寄存器设置,使用Kinetis的DMA模块的主/副循环链接功能、散/聚模式、副循环映射。
对DMA模块的相应的寄存器进行初始化后,便可开启DMA功能。
例如(K60例程):以智能车摄像头组图采集应用为例。
使GPIO口 D0~D7采集数字摄像头OV7620的8位灰度输出,使用引脚位灰度输出,使用引脚 A19输入像素同步脉冲pclk4分频后的信号,上升沿触发分频后的信号,上升沿触发DMA 请求。
K60(Rev6-Ch34-ADC)(中文)
第34章模拟到数字转换(ADC)34.1 引言16位模数转换(ADC)是一个连续的近似ADC,它是带有芯片的完整的微控制器系统。
注意对于特定操作模式的芯片,涉及到设备能量信息的管理。
34.1.1 特征ADC模块包括以下特征:●线性连续的近似值算法可以达到16位的分辨率。
●有4个差分和24个单端外部模拟输入。
●输出模式:有16位、13位、11位、9位不同的差分模式,或者16位、12位、10位、8位的单端模式。
●输出应用差分的16位二进制补码扩展成不同的模式。
●输出在右对齐未标记转换成单端模式。
●单端或者继续转换模式(单端之后自动转换成空闲模式)。
●配置采样时间和转换速度/电压。
●转换完成/硬件平均完成标记和中断。
●输入时钟可从四个时钟源选择。
●在低电压模式下进行低噪音操作。
●低噪音操作模式下使用异步时钟源输出时钟。
●可选择的硬件转换来激活硬件通道选择。
●自动比较中断可以大于、等于、小于、超过可编程值、或者在可编程值区间之内。
●温度传感器。
●硬件平均性能检测。
●可选择的电压:直流或交流。
●自校对模式。
●可编程的增益放大器(PGA)达到64倍增益34.1.2 模块示意图图34-1是ADC模块框图。
图34-1 ADC模块示意图34.2 ADC信号描述ADC模块支持4对差分输入和24个单端输入,每个不同的对要求有两个输入,DADPx 和DADMx。
ADC也需要四个提供/参数/场地链接。
表34-1 ADC信号描述34.2.1 模拟电源(V DDA)ADC模拟使用VDDA作为它的电源连接。
在一些封装中,VDDA是连接到内部的VDD 上。
如果外部有效,则将VDDA引脚连接到同一有效电压上作为VDD。
外部滤波必须保证清除VDDA的毛刺来保证得到有效的结果。
34.2.2 模拟地线(V SSA)ADC模拟部分使用V SSA作为它的地线连接。
在一些封装中,V SSA是连接到内部的V SS 上的。
如果外部有效,则将V SSA引脚接到外部有效电压作为V SS。
MK60最小系统板使用说明书
MK60系统板模块使用说明书一简介:K60系列微控制器具有IEEE 1558以太网,全速和高速USB 2.0 On-The-Go带设备充电探测、硬件加密以及防篡改探测能力,具有丰富的模拟、通信、定时和控制外设,从100LQFP封装256KB闪存开始可扩展到256MAPBGA 1MB内存。
大内存的K60系列微控制器还提供可选的单精度浮点单元、NAND闪存控制器和DRAM控制器。
144脚LQFP封装的K60的引脚分布图如图1所示,很多引脚都是功能复用引脚,至于引脚选择哪个功能取决于相关寄存器的配置。
图1 K60 144 LQFP引脚分布图由功能框图可知,K60含有的功能模块包括:串行通信UART、GPIO、定时器、A/D、D/A、CMP、TSI、SPI、I2C、I2S、CAN、USB、SDHC以及存储模块。
不同单片机的相同功能模块用法是基本一样的,因此,这里的UART、GPIO、定时器、A/D、SPI、CAN与XS128的功能模块用法是一样的,CMP与XS128的PWM模块功能类似,都可以输出PWM波形。
关于其他模块的功能这里不再进行介绍,请大家参考K60的datasheet或者reference manual。
二模块特点:1.模块将单片机的引脚基本上全部引出,便于进行二次开发;2.模块电源设计了过流和过压保护,进一步增加系统抗电压和电流冲击能力;3.特别提醒大家的是,该模块不和5V接口兼容,所以使用时一定要小心,别直接使用5V电源供电,否则可能烧坏模块。
三模块使用注意事项◆板子为镀金板,使用过程中要轻拿轻放同时不要用手触摸金面,因为手上汗液容易引起金面氧化,产品使用久了,易导致接触不良等故障;◆产品放置时,因为焊接元器件个别高度凸出,因此不要有其它重物压在上面,以防压坏电路板上的贴片元件,进而影响板子性能;◆电路板存放温度不要超过55°,湿度小于60%;◆板子放置不要靠近潮湿地方,以防板子受潮影响使用,如果板子受潮,请将板子至于通风干燥地方进行干燥处理,如空调下,利用空调热风进行干燥;◆由于板子的引脚是裸露设计,请不要用手触摸相关引脚,以防静电损坏芯片引脚,影响板子性能。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
/*----------------------------------------------------------------------------------------------------------------------------- 桂林电子科技大学物联网工程Editor:JaceLin Date:2014.2.5-------------------------------------------------------------------------------------------------------------------------------- 一、DMA特性1)k60有16个DMA通道二、寄存器1)控制寄存器:DMA_CR31-18 reserved17 CX 取消转移,0正常操作,1取消剩下数据转移16 ECX 错误取消转移,0正常操作,1取消转移15-8 reserved14 EMLM 使能副循环映射0 禁止,TCDn.word2 为32位1 使能,TCDn.word被重新定义6 CLM 持续连接模式,0当副循环结束后,再次激活DMA要通过裁决,1不用裁决5 HALT 停止DMA操作,0正常模式,1停止DMA操作4 HOE 错误时停止,0正常操作,1当有错误时HALT=1,也就是DMA停止3 reserved2 ERCA 使能循环通道裁决,1 EDBG 使能调试,写0,调试也用DMA,写1,调试时DMA不可用0 reserved2)错误状态寄存器DMA_ES31 VLD 所有错误状态位逻辑或,0没有错误,1表示至少有1个错误没有清除30-17 保留16 ECX 转移被取消0没有被取消的转移,1最后一次记录是被取消的转移15 保留14 CPE 通道优先错误,0没有通道优先错误,1有13-12 保留11-8 ERRXHN 错误通道位/被取消的位(最多16位)7 SAE 源地址错误,0没有源地址配置错误,1有错误6 SOE 源偏移错误,0没有源偏移配置错误,1有偏移配置错误5 DAE 目标地址错误,0没有错,1有错误4 DOE 目标偏移错误,0没有错误,1有3 NCE NBYTES/CITER配置错误,0没有,1有2 SGE Scatter/Gather配置错误,0没有,1有1 SBE 源总线错误,0没有错误,1有0 DBE 目标总线错误,0没有,1有3)使能请求寄存器DMA_ERQ (16个通道的请求信号寄存器)以下都是0禁止,1使能:31-16 保留15-0 ERQ15-ERQ04)使能错误中断寄存器DMA_EEI (16个通道的错误中断寄存器)以下都是0禁止,1使能:31-16 保留15-0 EEI15-EEI05)清除使能中断寄存器DMA_CEEI(清除EEI的使能中断)7 NOP 0正常操作,1没有操作,这个寄存器所有脱下可以忽略6 CAEE 清除所有使能错误中断,写0清除特定EEI,写1清除所有EEI5-4 保留3-0 清除使能错误中断(一共16位,写相应位表示选定,通过CAEE清除)6)设置使能错误中断寄存器DMA_SEEI7 NOP 0正常操作,1没有操作,这个寄存器所有脱下可以忽略6 SAEE 设置所有使能错误中断,写0设置特定EEI,写1设置所有EEI5-4 保留3-0 设置使能错误中断(一共16位,写相应位表示选定,通过SAEE设置)7)清除使能请求寄存器DMA_CERQ(清除ERQ的请求中断)7 NOP 0正常操作,1没有操作,这个寄存器所有脱下可以忽略6 CAER 清除所有使能请求,写0清除特定ERQ,写1清除所有ERQ5-4 保留3-0 清除使能请求中断(一共16位,写相应位表示选定,通过CAER清除)8)设置使能请求寄存器DMA_SERQ7 NOP 0正常操作,1没有操作,这个寄存器所有脱下可以忽略6 SAER 设置所有使能请求,写0设置特定ERQ,写1设置所有ERQ5-4 保留3-0 设置使能请求(一共16位,写相应位表示选定,通过SAER设置)9)清除完成状态位寄存器DMA_CDNE7 NOP 0正常操作,1没有操作,这个寄存器所有脱下可以忽略6 CADN 清除所有完成位,0清除特定位,1清除所有位5-4 保留3-0 CDNE 清除(特定完成位,共16位)10)设置状态位寄存器DMA_SSRT7 NOP 0正常操作,1没有操作,这个寄存器所有脱下可以忽略6 SAST 配置所有完成位,0设置特定位,1设置所有位5-4 保留3-0 SSRT 设置(特定完成位,共16位)11)清除错误寄存器DMA_CERR7 NOP 0正常操作,1没有操作,这个寄存器所有脱下可以忽略6 CAEI 清除所有完成位,0清除特定位,1清除所有位5-4 保留3-0 CERR 清除(特定位,共16位)12)清除中断请求寄存器DMA_CINT7 NOP 0正常操作,1没有操作,这个寄存器所有脱下可以忽略6 CAIR 清除所有中断请求位,0清除特定位,1清除所有位5-4 保留3-0 CINT 清除(特定位,共16位)13)中断请求寄存器DMA_INT (16个通道)以下都是0禁止,1使能:31-16 保留15-0 INT15-INT014)错误寄存器DMA_CRR (16个通道)以下都是0禁止,1使能:31-16 保留15-0 ERR1-ERR015)硬件请求状态寄存器DMA_HRS(16个通道)以下都是0禁止,1使能:31-16 保留15-0 HRS15-HRS016)通道n优先级寄存器DMA_DCHPIn7 ECP 使能通道优先权写0不支持高优先级,写1支持高优先级6 DPA 禁止优先级功能写0支持低优先级,写1不支持任何优先级5 5-4 保留3-0 CHPRI 通道n优先级设定,共16个优先级-----------------------------------------------------------------------------17)TCD源地址(DMA_TCD_SADDR)31-0 SADDR 源地址18)TCD信号源地址偏移(DMA_TCD_SOFF),表示下一个数据的存储地址15-0 SOFF 源地址信号偏移19)TCD传输属性(DMA_TCD_ATTR)15-11 SMOD 源地址模数10-8 SSIZE 源数据转换大小000 8位001 16位010 32位011 保留100 16字节其它保留7-3 DMOM 目标地址模数详见SMOD定义2-0 DSIZE 目标数据转换大小详见SSIZE定义20)TCD副循环计数器(DMA_TCD_NBYTES_MLNO)31-0 NBYTES 副循环转换计数,也就是副循环每次传输的字节数,21)TCD有符号副环路偏移(DMA_NBYTES_MLOFFNO)31 SMLOE 副循环源地址使能0没有应用SADDR,1应用于SADDR32 DMLOE 副循环目标地址偏移使能0没有应用DADDR,1应用于DADDR29-0 NBYTES 副循环偏移计算---- 22)TCD有符号副循环偏移(DMA_NBYTES_MLOFFYES)31 SMLOE 源副循环偏移使能0没有应用SADDR,1应用于SADDR32 DMLOE 目标副循环偏移使能0没有应用SADDR,1应用于SADDR29-10 MLOFF 当SMOE和DMOE为1,这里是偏移量,或者说是下次数据地址9-0 NBYTES 副循环字节转换计算23)TCD末尾(结束)源地址调整(DMA_TCD_SLAST)31-0 SLAST 末尾(结束)源地址调整24)TCD目标地址(DMA_TCD_DADDR)31-0 DADDR 目标地址25)TCD有符号目标地址偏移(DMA_TCD_DOFF),每次传输完存储目标地址增量15-0 DOFF 目标地址偏移* 26)TCD当前副循环连接(主循环计数)DAM_TCD_CITER_ELINKYES* 15 ENLINK 当副循环结束时,是否使能通道连接,0禁用,1使能* 14-13 保留* 12-9 LINKCH LINKCH连接通道号* 8-0 CITER 当前主循环迭代计数器,用于对主循环总次数计算(也就是副循环循环次数)** 27)TCD当前副循环连接(主循环计数)DMA_TCD_CITER_ELINKNO15 ELINK 使能通道对通道最小循环0不用,1使能14-0 CITER 循环数28)TCD末尾(结束)目标地址调整(DMA_TCD_DLASTSGA)31-0 SLASTSGA29)TCD控制与状态(DMA_TCD_CSR)15-14 BWC 带宽控制00 没有DMA 引擎停止01 保留10 DMA每读写一次停止4个周期11 DMA每读写一次停止8个周期13-12 保留11-8 MAJORLINKCH 连接通道号(16位)7 DONE 通道完成,该位标志DMA主循环完成,6 ACTIVE 通道执行,该位标志通道已经执行5 MAORELINK 使能通道对通道连接在一个主循环完成后0禁止通道连接,1使能通道连接4 ESG 使能散/聚模式0禁用,1使能3 DREQ 禁止请求,0通道ERQ位不作用,1通道ERQ位清除当主循环完成后2 INTHALF 使能一个中断当主计数完成一半时0禁止,1使能1 INTMAJOR 使能一个中断当主循环计数完成时0禁止,1使能0 START 通道开始,0没有开始,1开始* 30)TCD起始副循环连接(DMA_TCD_BITER_ELINKYES)** 15 ELINK 使能通道对通道连接当副循环完成时0禁止,1使能* 14-13 保留* 12-9 LIMKCH 连接通道号* 8-0 BITER 开始主循环计数,该值必须和CITER相同** 31)TCD起始副循环连接(DMA_TCD_BITER_ELINKNO)15 ELINK 使能通道对通道连接当副循环完成时0禁止,1使能14-0 BITER开始主循环计数------------------------------------------------------------------------------1)通道配置寄存器(DMAMUX_CHCFGn)7 ENBL DMA通道使能6 TRIG DMA通道触发使能0触发禁止,1触发使能5-0 source DMA通道源(64个DMA源,可映射16个中任何一个DMA通道)------------------------------------------------------------------------------DMA 请求复用配置---DMA request multiplexer configuration这个选项总结了这个DMA模块是怎么配置的,-------------------------------------------------------------------------*/。