在Android系统中,添加文件打开方式是开发者常需面对的一项任务。这涉及到应用程序的Intent过滤器,使得当用户点击特定类型的文件时,你的应用能够作为选择之一来打开它。这篇博客详细介绍了如何在Android项目中实现这个功能。 我们需要在AndroidManifest.xml文件中定义一个Intent过滤器。这个过滤器会告诉系统我们的应用可以处理哪些类型的文件。例如,如果我们要让应用支持打开.txt文本文件,可以添加如下代码: ```xml ``` 在这个例子中,`android.intent.action.VIEW` 表示我们希望以查看(读取)的方式处理文件,`android.intent.category.DEFAULT` 指出这是默认操作,`android:mimeType="text/plain"` 指定处理的MIME类型为纯文本。`android:scheme="file"`、`android:host="*"` 和 `android:pathPattern=".*\\.txt"` 一起确保了只有.txt文件会被我们的应用接收。 接下来,你需要创建一个Activity来处理这些文件。在上面的示例中,我们创建了名为 `MyFileHandlerActivity` 的Activity。在这个Activity中,你需要使用 `Intent` 对象来获取传递过来的文件路径,并进行相应的处理,比如读取文件内容: ```java public class MyFileHandlerActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_file_handler); Intent intent = getIntent(); String action = intent.getAction(); String type = intent.getType(); if (Intent.ACTION_VIEW.equals(action) && type != null) { Uri uri = intent.getData(); handleOpenFile(uri); } } private void handleOpenFile(Uri uri) { // 实现读取文件的逻辑,例如: try { File file = new File(uri.getPath()); BufferedReader reader = new BufferedReader(new FileReader(file)); String line; while ((line = reader.readLine()) != null) { // 处理每一行数据 } reader.close(); } catch (IOException e) { e.printStackTrace(); } } } ``` 在 `handleOpenFile()` 方法中,你可以根据实际需求处理读取到的文件内容。此外,为了应对不同来源(如Google Drive或Dropbox)的文件,可能还需要处理其他类型的Uri,如 `content://` Uri。 博客还可能涉及了如何测试这个功能。通常,你可以通过Android设备或模拟器上的文件管理器尝试打开一个.txt文件,看看是否能触发你的应用。同时,也可以使用Android Studio中的模拟意图(MonkeyRunner或UI Automator)来模拟文件打开的动作。 总结来说,实现Android添加文件打开方式主要步骤包括:在AndroidManifest.xml中设置Intent过滤器,创建对应的Activity来处理文件,以及在Activity中解析并处理文件内容。通过这些步骤,你的应用就能成为Android系统中处理特定类型文件的一个选项了。
2026-03-10 09:58:54 1.37MB 添加打开放式
1
百度地图JavaScript API是百度提供的一款强大的地图开发工具,主要用于在网页上实现地图的展示、交互以及自定义功能。离线版3.0主要是为了让开发者在没有网络连接的情况下也能使用地图服务,这对于那些需要在局域网环境或者网络不稳定的地方使用地图功能的应用来说尤其重要。 在“百度地图JavaScript API离线版3.0.zip”这个压缩包中,包含了实现离线地图功能所需的各种文件和资源。主要知识点包括以下几个方面: 1. JavaScript API基础知识:这是百度地图的核心,它提供了丰富的JavaScript函数和对象,用于加载地图、设置地图样式、添加标记、绘制图形、处理地图事件等。开发者需要理解如何引入API库,如何创建地图实例,以及如何调用不同的API方法。 2. 离线地图数据:百度地图离线版的关键在于地图数据的存储和加载。离线地图通常包含不同级别的瓦片图片,这些图片根据用户缩放级别动态加载。开发者需要了解如何组织和管理这些瓦片,以及如何根据用户的浏览行为快速有效地加载正确的瓦片图片。 3. 卫星地图支持:描述中提到“添加卫星地图”,这意味着离线版不仅包含普通地图,
2026-03-10 09:56:42 31.94MB 百度地图
1
软件介绍: 一款体积小巧却很实用的硬盘数据恢复软件recuva1.51,内含32 64位版本,用于在WINDOWS系统下恢复丢失的文件,从已格式化的磁盘分区中直接恢复已删除的数据,只要是删除的数据没有被重复写入都可以进行恢复,支持FAT32-NTFS文件系统。可恢复的设备包括硬盘、U盘以及各种存储卡。本版本为汉化破解版,直接使用即是注册版。本版本支持Ext2和Ext3文件系统,增加了从GUID中恢复丢失的卷标,支持SSD固态硬盘,修复了BUG问题。
2026-03-10 09:40:06 2.66MB 资料恢复
1
【多无人机追捕-逃逸】平面中多追捕者保证实现的分散式追捕-逃逸策略研究(Matlab代码实现)内容概要:本文研究了平面中多追捕者对逃逸者的分散式追捕-逃逸策略,提出了一种能够保证追捕成功的控制算法。该策略基于分布式控制架构,各追捕者仅依赖局部信息进行决策,无需全局通信,增强了系统的可扩展性与鲁棒性。文中建立了追捕-逃逸的动力学模型,设计了相应的控制律,并通过理论分析证明了在特定条件下可实现对逃逸者的有效围捕。同时,借助Matlab进行了仿真实验,验证了所提策略在不同场景下的有效性与稳定性,展示了多无人机协同执行追捕任务的可行性。; 适合人群:具备一定控制理论基础和Matlab编程能力,从事多智能体系统、无人机协同控制、博弈论等相关领域研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①用于多无人机、多机器人系统在安防监控、目标围捕、应急搜救等场景中的协同控制策略设计;②为研究分布式决策、非完整约束系统控制、对抗性博弈等问题提供算法参考与仿真验证平台; 阅读建议:建议读者结合Matlab代码深入理解算法实现细节,重点关注控制律的设计逻辑与收敛性证明过程,同时可通过调整初始布局、速度参数等开展扩展性仿真试验,以加深对策略性能边界的认识。
1
【多无人机追捕-逃逸】平面中多追捕者保证实现的分散式追捕-逃逸策略研究(Matlab代码实现)内容概要:本文研究了平面中多追捕者对逃逸者的分散式追捕-逃逸策略,提出了一种保证实现追捕的控制算法,并通过Matlab进行仿真代码实现。该策略基于非合作博弈思想,适用于多无人机协同追捕场景,重点解决了追捕者之间的协同控制、避障以及对逃逸者运动轨迹的预测与围堵问题。文中详细阐述了算法设计原理、数学建模过程及仿真实验结果,验证了所提策略的有效性和鲁棒性。; 适合人群:具备一定控制理论基础和Matlab编程能力的研究生、科研人员及从事无人机协同控制、智能博弈等相关领域的工程技术人员。; 使用场景及目标:①应用于多无人机协同追捕、安防监控、搜救任务等实际场景;②为多智能体系统中的博弈对抗、路径规划与协同控制提供算法支持与仿真验证平台;③帮助研究人员深入理解分散式控制与非合作博弈在动态环境中的集成应用。; 阅读建议:建议读者结合Matlab代码逐步调试运行,重点关注追捕者策略的实现逻辑与仿真参数设置,同时可扩展研究不同初始布局、障碍物环境及通信延迟对追捕效果的影响,以深化对多智能体协同机制的理解。
2026-03-10 09:38:34 771KB 分散式控制 Matlab仿真 非合作博弈
1
随着无人机技术的快速发展和应用场景的日益广泛,无人机通信系统中的抗干扰信道分配成为了一个重要的研究领域。特别是在复杂的通信环境下,如何有效地进行信道分配,以减少干扰、提高通信效率和可靠性,是一个极具挑战性的课题。Stackelberg博弈方法以其在对抗性决策问题中的优势,被越来越多地应用于这类问题的解决中。 在无人机边缘计算场景中,无人机需要与多个地面站或基站进行通信,而不同的信道可能会受到不同程度的干扰。传统的抗干扰方法往往无法在动态变化的环境下保持高效性和适应性。采用Stackelberg博弈方法,可以将无人机通信系统中的抗干扰信道分配问题构建为一个博弈模型,通过模拟领导者(leader)和跟随者(follower)之间的动态对抗过程,寻找最优的信道分配策略。 在这一过程中,无人机作为领导者,会根据自己的通信需求以及对周围环境的感知,先做出决策,分配信道资源。而地面站或基站作为跟随者,根据无人机的决策,选择自己的响应策略,进行通信。通过这样的互动,可以有效地减少信道间的干扰,并提高系统的整体性能。 使用Matlab代码实现这一过程,不仅可以对算法进行仿真测试,还能实时观察到信道分配的效果。Matlab作为一种高效的科学计算软件,提供了丰富的数学函数和工具箱,能够很好地支持博弈论中的模型构建和算法实现,这对于复杂通信系统的分析和设计具有重要意义。 此外,除了无人机通信中的抗干扰信道分配问题外,无人机技术在其他领域如路径规划、多微电网、车间调度、有功-无功协调优化、状态估计等方面也有广泛的应用。例如,A星算法和遗传算法的结合用于机器人动态避障路径规划,利用NSGAII算法研究柔性作业车间调度问题,以及利用改进的多目标粒子群优化算法优化配电网的有功和无功协调等。这些技术的实现和应用,都离不开强大的仿真和计算工具,而Matlab正好满足了这一需求。 通过Matlab代码的实现,不仅可以快速验证理论和算法的可行性,还能为实际应用提供一个有力的测试平台,从而推动相关技术的进步。特别是在多智能体系统、网络控制、电力系统等领域,Matlab提供了一种便捷高效的实验和模拟手段,极大地促进了学科的发展和技术的创新。 基于Matlab实现的无人机通信抗干扰信道分配研究,不仅在理论上有其深刻的博弈论背景,在实际应用中也有广泛的需求和前景。无人机技术与Matlab仿真工具的结合,为解决复杂系统中的通信问题提供了一个强有力的解决方案,这对于未来智能通信系统的发展具有重要的意义。同时,Matlab强大的计算和仿真能力,也为其他多领域的技术研究与应用提供了坚实的基础。
2026-03-10 09:37:23 247KB Matlab
1
《期待脚本语言 Expect5.45安装指南》 在信息技术领域,自动化是提升效率的关键。Expect作为一种强大的脚本语言,被广泛应用于自动化任务中,尤其是对于那些需要人机交互的任务,如SSH登录、FTP传输等。Expect5.45是这个语言的一个版本,它允许用户编写脚本来模拟终端交互,从而实现对命令行程序的自动化控制。在这个指南中,我们将详细介绍如何安装和使用Expect5.45。 我们注意到在安装Expect5.45之前,可能需要先安装TCL(Tool Command Language)和TK(Tkinter图形界面库)这两个基础组件。TCL是一种通用的解释型编程语言,而TK是TCL的图形用户界面库,它们为Expect提供了运行环境。确保你已经安装了最新版本的TCL和TK,如果没有,可以通过以下步骤进行安装: 1. 下载TCL和TK的安装包,通常可以从官方网站或者第三方软件仓库获取。 2. 按照平台(如Linux、Windows或MacOS)的安装指引进行安装,通常包括解压、配置、编译和安装几个步骤。 3. 验证安装是否成功,可以在终端输入`tclsh`或`wish`命令,如果能正常启动TCL解释器或TK界面,即表示安装完成。 接下来,我们来关注Expect5.45的安装过程: 1. 获取Expect5.45的压缩包,这通常是一个.tgz或.zip文件。 2. 使用解压工具将文件解压到指定目录,例如在Linux中可以使用`tar -zxvf expect5.45.tar.gz`命令。 3. 进入解压后的目录,一般会包含源代码、README文件等。 4. 执行配置脚本,比如`./configure`,这一步会检查系统环境并准备编译选项。 5. 如果配置无误,进行编译和安装,常用命令为`make`和`sudo make install`。 6. 安装完成后,你可以通过`expect`命令来验证安装是否成功。 了解了基本安装流程后,让我们探讨一下Expect的核心功能和用法。Expect通过模拟终端输入和输出,实现了与命令行程序的交互。例如,它可以自动处理SSH登录过程,包括输入用户名、密码,甚至处理验证码等复杂交互。Expect脚本由一系列期望(expect)和发送(send)语句组成,等待特定的输出并作出相应的响应。 例如,一个简单的SSH登录脚本可能如下所示: ```tcl #!/usr/bin/expect spawn ssh user@example.com expect "password:" send "your_password\n" expect "$ " send "ls -l\n" expect "$ " send "exit\n" ``` 这个脚本会启动一个SSH连接,等待“password:”提示,发送密码,然后执行`ls -l`命令,并在完成时退出。 Expect5.45是一个强大的自动化工具,尤其适合处理需要人机交互的任务。通过理解其依赖关系和安装步骤,以及掌握基本的脚本编写技巧,我们可以有效地利用它来简化工作流程,提高工作效率。在实践中,不断探索和优化Expect脚本,你会发现它的潜力无穷。
2026-03-10 09:21:53 614KB expect
1
本项目基于STM32F405微控制器,针对9K4_XG4054型步进电机提供完整的四轴加减速控制解决方案。工程源码涵盖硬件接口设计与软件算法实现,支持精确的脉冲控制、多模式驱动(全步、半步、微步)及平滑加减速策略,适用于精密定位与运动控制系统。通过PID控制与实时信号处理,系统可有效避免失步与抖动,提升运行稳定性。项目采用C语言开发,兼容HAL库或裸机架构,并可在STM32CubeIDE、Keil等环境中编译调试,具备良好的移植性与扩展性。详细内容包括STM32F405架构与资源利用、步进电机工作原理与特性分析、驱动电路设计、四轴同步控制实现方案、加减速曲线算法设计以及PID控制在速度调节中的应用。 STM32F405微控制器是基于ARM Cortex-M4核心的高性能MCU,广泛应用于工业控制、医疗设备、消费电子产品等领域。其中,步进电机控制是微控制器应用中的一大热点,尤其是四轴控制,这通常要求控制器具备强大的计算能力和精细的控制算法。本项目即是基于STM32F405的四轴步进电机控制解决方案,涵盖了硬件接口与软件算法的完整设计。 项目的核心内容包含了对步进电机的精确脉冲控制,允许开发者选择不同的驱动模式,比如全步、半步、微步驱动模式。这些模式提供了不同程度的电机运动精度和扭矩输出,使得控制系统能够适应不同的应用场景需求。控制策略中还包括了平滑的加减速算法,这对于保持运动过程的连贯性及避免过冲现象是至关重要的。控制系统通过实时反馈机制实现,能够及时调整电机的运动状态,以应对负载变化带来的影响。 项目采用PID控制策略,对电机的运行速度和位置进行精确控制,从而提高整个控制系统的稳定性和精确度。在硬件设计方面,源码中包含了针对步进电机的驱动电路设计,这些电路通过与STM32F405的硬件接口相连,以实现对电机的有效驱动。同时,软件设计部分详细介绍了四轴同步控制的实现方案,保证了多轴运动时的协调性和同步性。 对于加减速曲线的设计,源码中提供了一套完整的算法,能够根据不同的运动需求动态调整电机的加速度和减速度,以达到最佳的运动控制效果。在软件层面,源码还详细讲解了如何将PID控制算法应用于电机的速度调节中,保证电机能够按照预设的速度曲线进行精确运动。 整个项目源码使用C语言编写,它既兼容了HAL库架构,也支持裸机编程。用户可以根据实际的开发环境和需求选择合适的编程方式。另外,源码可以在多种集成开发环境中编译和调试,如STM32CubeIDE、Keil等,这样提高了代码的移植性和扩展性,方便开发者将其应用到不同的硬件平台和系统上。 总体而言,该控制项目不仅为四轴步进电机控制提供了一套高效的软件和硬件解决方案,同时也为工程师们提供了一个理解和实践高性能MCU应用开发的良好平台。
2026-03-10 09:15:58 26KB 软件开发 源码
1
nginx-1.28.1 arm64架构 docker 镜像包代表了在特定操作系统环境中针对arm64架构优化的Nginx服务器软件的docker镜像。Nginx是一款开源的高性能HTTP和反向代理服务器,也是IMAP/POP3/SMTP服务器。该镜像支持在信创环境下使用,信创指的是信息技术与创新的结合,往往强调自主可控和安全。在此情况下,所指的系统是Kylin V10,这是一款基于Linux的操作系统,特别针对中国的政府和企业市场开发。 在本例中,"arm64"指的是一种64位的ARM处理器架构,这在性能和能效方面具有优势,常见于移动设备和嵌入式系统。由于arm64架构的普及和性能优势,为这一架构提供的nginx docker镜像可以用于各种服务器设备,特别是对于资源有限的环境来说是一个理想选择。 对于"docker",它是一个开源的应用容器引擎,允许开发者打包他们的应用以及应用的依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器上,也可以实现虚拟化。使用Docker,可以更快地发货和部署应用,更加容易管理应用的生命周期。 这个特定的nginx docker镜像,其文件名称列表中包含了多个看似无序的字符序列,但这些实际上很有可能是镜像的哈希值。这些哈希值可以用来校验文件的完整性和验证其来源。文件列表中的"manifest.json"是一个描述镜像内容的清单文件,包括了镜像的各个层级和配置信息,这对于理解镜像的构建和部署细节至关重要。 "repositories"文件通常包含了镜像仓库的信息,包括镜像的名字、标签等,它帮助Docker识别并管理本地存储的镜像。而其他列出的文件,很可能是在构建nginx-1.28.1 arm64架构docker镜像过程中生成的相关支持文件和配置文件。 综合以上信息,我们可以知道这个nginx docker镜像是针对arm64架构的Kylin V10操作系统环境进行优化的,它可以在那些需要高性能、低能耗服务器的场景中部署,特别是在信创环境下,对于追求安全和自主可控的企业和机构而言,这是一个理想的选择。
2026-03-10 09:07:38 50.73MB arm64 nginx docker KylinV10
1
用于LPC2000系列芯片的程序烧录 /*Hints on Using the LPC2000 Flash Utility This document can be considered as a supplement to the already existing Application note AN10302 “Using the Philips LPC2000 Flash Utility”, which is provided in the same zip file. The Application note covers the following topics: 1. LPC2000 ISP Overview 2. ISP Mode Entry- Manual and RTS/DTR control circuit 3. Flash and RAM buffer operations 4. Keil MCB2100 board and IAR/Philips 210x KickStart board. Topics discussed in this guide are as follows: 1. Using the “Compare Flash” ISP command. 2. Flashless devices- LPC2220, LPC2210, LPC2290 Using the Compare Flash: The below steps need not be carried out if the checksum is part of the code before it is compiled. This would mean that checksum would be part of the hex file been created. For more detailed information on the checksum calculation please refer to the “Flash Memory System and Programming” chapter in the respective device User Manual. In this case, the hex file can be directly loaded using the “Upload to Flash” button and then the “ Compare Flash” button can be used to compare the Flash contents with the hex file. This direct operation is possible since the signature (or checksum) is part of the hex file already. The below steps need to be carried out if the checksum calculation is not part of the code been compiled. In this case, the checksum calculation has to be done by the utility. Step1: Open the “Buffer” menu and browse to “Flash Buffer operations”. When this menu item is clicked the following window will pop-up. Step2: Now click on the “Load Hex file” button. Please browse to the hex file, which needs to be downloaded into Flash. In this case, Blinky.hex would be loaded. Step3: Select the hex file and press “Open”. This would load the hex file into the buffer window as shown below. Please take a note of location 0x14. In this case, the checksum is not computed before the code is compiled. Step4: Now click on the “Vector Calc” button, which would calculate the checksum and load it at the reserved memory location, 0x14. As shown below this location gets updated. The updated value at 0x14 is as shown below Step5: Since this hex file is modified with the checksum, it needs to be saved back into the same location from where it was loaded. Clicking on the “Save Hex File” button would complete this step. When this is done, a message as shown below should appear. Click “Yes”. Step6: Download the hex file into Flash by clicking on the “Download Flash” button. The progress window should show the progress of the Flash download. Step7: The Flash Buffer Operations window can now be closed. Now, please click here and browse to “Blinky.hex” again. Now click the “Compare Flash” button and it should be a success. Flashless devices- LPC2220, LP2210, LPC2290: Since the LPC2220/2210/2290 does not have on-chip Flash, the ISP utility does not have these devices in its listing of supported Flash devices. However, the utility can still be used to issue ISP commands that would access the on-chip SRAM (using RAM Buffer Operations Window) and bootloader specific ISP commands like Read Device ID. For instance, when the above button is clicked, the ISP utility would complain saying that the “Type is not supported” which basically means that this device is not present in the listing of Flash devices. This error message can be ignored. After “OK” is pressed in the above message, the ISP commands will still be executed and the Part ID and the Boot loader ID will be displayed.*/ /*AN10302 Using the Philips LPC2000 Flash utility with the Keil MCB2100 and IAR LPC210x Kickstart evaluation boards Rev. 03 — 10 June 2004 Application note Document information Info Content Keywords LPC2000, Flash utility, Keil MCB2100, IAR LPC210x Abstract Application information for the Philips LPC2000 Flash utility with the Keil MCB2100 and IAR LPC210x Kickstart evaluation boards 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 2 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility Contact information For additional information, please visit: http://www.semiconductors.philips.com For sales office addresses, please send an email to: sales.addresses@www.semiconductors.philips.com Revision history Rev Date Description 3 10 June 2004 Third version (9397 750 13354). Modifications: • Updated Table 2. • Updated Section 4.2.1. 2 12 May 2004 Second version (9397 750 13287). 1 30 April 2004 Initial version (9397 750 13231). 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 3 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility 1. Introduction In-System programming (ISP) is a method of programming and erasing the on-chip flash or RAM memory using the boot loader software and a serial port. The part may reside in the end-user system. The flash boot loader provides an In-System Programming interface for programming the on-chip flash or RAM memory. This boot loader is located in the upper 8 kB of flash memory, it can be read but not written to or erased. 2. LPC2000 ISP overview The flash boot loader code is executed every time the part is powered on or reset. The loader can execute the ISP command handler or pass execution to the user application code. A LOW level, after reset, at the P0.14 pin is considered as the external hardware request to start the ISP command handler. The boot loader samples this pin during reset. Assuming that proper signal is present on X1 pin when the rising edge on RST pin is generated, it may take up to 3 ms before P0.14 is sampled and the decision on whether to continue with user code or ISP handler is made. If P0.14 is sampled LOW and the watchdog overflow flag is set, the external hardware request to start the ISP command handler is ignored. If there is no request for the ISP command handler execution (P0.14 is sampled HIGH after reset), a search is made for a valid user program. If a valid user program is found then the execution control is transferred to it. If a valid user program is not found, the auto-baud routine is invoked. Pin P0.14 is used as hardware request for ISP requires special attention. Since P0.14 is in high impedance mode after reset, it is important that the user provides external hardware (a pull-up resistor or other device) to put the pin in a defined state. Otherwise unintended entry into ISP mode may occur. Figure 1 shows the boot sequence of the LPC210x devices. 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 4 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility Fig 1. Boot process flowchart. 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 5 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility 3. Details of the Philips LPC2000 Flash utility This flash utility is available for free download from the Philips website. This software, in combination with the hardware described below, allows for hands-off erasure, uploading, and execution of code. The Philips LPC2000 Flash utility utilizes two, otherwise unused, signals (RTS and DTR) of the PC serial port to control the microcontroller reset and P0.14 pins. The port pin P0.14, if LOW during reset, puts the microcontroller into In System Programming (ISP) mode; this pin has the alternate functions of external interrupt one and general purpose I/O (GPIO). Some details on the associated circuitry will help in understanding how this works. 3.1 Manual entry into ISP mode With jumper J1 removed and jumper J2 in place ISP mode will be entered manually by holding S2 while pressing and releasing S1 (reset). This can become cumbersome and so it is advantageous to use RTS/DTR control of these signals. 3.2 ISP mode entry using DTR/RTS With jumper J1 inserted and jumper J2 removed the reset and P0.14 signals may be controlled by the previously un-used RTS/DTR signals of the PC serial port. In this application both these signals are active HIGH. When RTS is asserted Q2 is turned on and the microcontroller reset is pulled LOW. While the micro is held in reset, DTR is asserted and P0.14 is held LOW. RTS is then brought LOW and so Q2 is turned off. The 10K pull-up resistor releases the RESET signal by pulling it HIGH. The microcontroller is now running in ISP mode. This sequence of ISP mode entry is performed for every operation offered by the Philips LPC2000 Flash Utility. Fig 2. The RTS/DTR control - an example circuit. 10K DTR S2_INT1_ISP D3 1 2 Q2 3 2 1 RST 22K S1_reset 33K D4 1 2 D1 1 2 P2 DSUB 9-R 5 9 4 8 3 7 2 6 1 5 9 4 8 3 7 2 6 1 100n Note: All signals to P2 except DTR and RTS have been omitted for clarity. 33K J2 12 100n RTS Q1 3 2 1 P0.14 22K Vcc J1 12 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 6 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility The main screen of the Flash Utility provides access to most if its functionality. When the “use DTR/RTS…” box (1) is checked then control of reset and P0.14 is done by the utility as described above. If this box is unchecked then ISP mode must be entered manually. If the “execute code after upload” is checked then, after code is programmed into the flash, an extra reset pulse is sent to the microcontroller to reset the part. Since, at this time, P0.14 will be HIGH, the part will execute code in flash after this reset. When the utility connects to the MCB2100 it will attempt to connect at the selected baud rate. The highest baud rate achievable will depend mostly on the frequency of the crystal. Using standard baud rate crystals (e.g. 14.7456 MHz) will increase the maximum baud rate achievable. 3.3 Flash buffer operations The flash buffer operation screen (accessible from the “buffer” pull-down menu) allows functions such as loading a HEX file, downloading from flash, uploading to flash, filling the buffer, saving the HEX file and calculation of the checksum “valid code” vector1. There is also the ability to fill the buffer with a particular value1 and program this buffer to flash. Fig 3. Flash Utility main screen. 1. The valid code vector at 0x14 is merely the two’s complement of the sum of the vector table. By assigning it this value the checksum for the entire vector table is 0x00 which indicates valid flash code. After reset the bootloader will examine this location and, if the value is correct (an indication of valid user code in flash), will execute code out of flash. If the value is not correct the bootloader will enter ISP mode. The Philips LPC2000 Flash Utility will automatically calculate and program this value during an upload to flash. Alternatively the vector calculation may be performed on the contents of flash buffer as shown in the screen-shot below. 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 7 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility 3.4 RAM buffer operations Ram buffer operations (accessible from the “buffer” pull-down menu) are similar to flash buffer operations including the uploading of HEX files etc. Fig 4. Flash buffer screen. 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 8 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility Fig 5. RAM buffer operations. 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 9 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility 4. Hardware 4.1 Keil MCB2100 evaluation board Figure 6 shows an overview of the Keil MCB2100 evaluation board. JTAG port — Connection to JTAG emulator (e.g. Keil ULink). This is a standard JTAG port as outlined in ARM documentation. ETM (Embedded Trace Macrocell) port — Provides interface to emulators with trace capability. P3 and P4, CAN ports — These provide access to the CAN ports (On boards that feature a microcontroller with CAN interfaces). P1 and P2, UARTs — Access to UART0 and UART1. S1 reset — Microcontroller reset. S2 ISP/INT1 — This button pulls the P0.14 pin of the microcontroller LOW, providing either an external interrupt or manual entry into ISP mode. Fig 6. Keil MCB2100 evaluation board overview. 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 10 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility LEDs — buffered with a 74LVC octal buffer, enabled by J6. Potentiometer — Configured as a voltage divider with its output connected to AIN0 via jumper J2. [1] These jumpers supply the voltages to the microcontroller and must be in for normal operation. [2] Remove this jumper when not using ISP. 4.1.1 Enabling ISP mode with the MCB2100 The Keil MCB2100 evaluation board was designed to utilize the RTS/DTR control of reset and P0.14 as featured in the Philips LPC2000 Flash utility. To setup the MCB2100 for ISP programming set the jumpers: J1, J3, J4, J5, J7 and J10. Connect the PC serial port to COM0 of the MCB2100 and start the LPC2000 Flash Utility. Check the “Use DTR/RTS……” box and continue. 4.2 The IAR/Philips LPC210x Kickstart card This evaluation board is populated with an LPC2106 microcontroller and features 2 serial ports, 2 user-defined buttons, 16 fully configurable LEDs, 20-pin JTAG interface connector as well as breakout headers for all pins. Table 1: Keil MCB2100 jumper functions Jumper Function J1 Configures P0.14 for DTR/RTS control of ISP (see ISP section below) J2 Potentiometer/ADC Connect J3[1] 3.3 V enable J4[1] 1.8 V enable J5 3.3 V analog voltage supply enable J6 LED enable J7 Configures P0.14 for external interrupt or manual ISP entry J8 ETM Pins Enable (Pulls TraceSync LOW) J9 JTAG Debug Pins Enable (Pulls RTCK LOW) J10[2] Configures RESET for DTR/RTS control of ISP (see ISP section below) 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 11 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility JTAG port — Connection to JTAG emulator (e.g. JLink). This is a standard JTAG port as outlined in ARM documentation. ETM (Embedded Trace Macrocell) port — Provides interface to emulators with trace capability. P0 and P1, UARTs — Access to UART0 and UART1. RESET — Microcontroller reset. Interrupt0 — This button provides a source for interrupt zero. Interrupt1 — This button pulls the P0.14 pin of the microcontroller LOW, providing either an external interrupt or manual entry into ISP mode. Interrupt2 — This button provides a source for interrupt two. LED jumper block — enables/disables individual LEDs. LEDs — buffered with a LVT16244. Fig 7. IAR/Philips LPC210x Kickstart card. 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 12 of 14 Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility [1] P0.14 and external interrupt one share the same pin; therefore this button may also be used for manual entry into ISP mode by pressing it during a reset. [2] This jumper, when in the JTAG1 position, will cause the microcontroller to enter JTAG debug mode after reset. Therefore, when using ISP, this jumper must be removed or placed in the JTAG2 position. 4.2.1 Enabling ISP mode with the IAR/Philips Kickstart card The Kickstart Card evaluation board was designed to utilize the RTS/DTR control of reset and P0.14 as featured in the Philips LPC2000 Flash utility. To setup the Kickstart Card for ISP programming set the jumpers: JP7, JP8, JP2 and JP4. Remove jumper JP6. Connect the PC serial port to P0 (UART0) of the Kickstart Card and start the LPC2000 Flash Utility. Check the “Use DTR/RTS……” box and continue. Table 2: IAR/Philips Kickstart card jumper functions Jumper Function JP1 Enables external interrupt zero via the push-button JP2 Enables ISP and external interrupt one[1] JP3 Connects P0.9/RxD1 (UART1) to the MAX3232 JP4 Connects P0.1/RxD0 (UART0) to the MAX3232 JP5 Enables external interrupt zero via the push-button JP6 Primary/Secondary JTAG select[2] JP7 Enable DTR/RTS control of P0.14 JP8 Enable DTR/RTS control of RESET Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility 9397 750 13354 © Koninklijke Philips Electronics N.V. 2004. All rights reserved. Application note Rev. 03 — 10 June 2004 13 of 14 5. Disclaimers Life support — These products are not designed for use in life support appliances, devices, or systems where malfunction of these products can reasonably be expected to result in personal injury. Philips Semiconductors customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify Philips Semiconductors for any damages resulting from such application. Right to make changes — Philips Semiconductors reserves the right to make changes in the products - including circuits, standard cells, and/or software - described or contained herein in order to improve design and/or performance. When the product is in full production (status ‘Production’), relevant changes will be communicated via a Customer Product/Process Change Notification (CPCN). Philips Semiconductors assumes no responsibility or liability for the use of any of these products, conveys no licence or title under any patent, copyright, or mask work right to these products, and makes no representations or warranties that these products are free from patent, copyright, or mask work right infringement, unless otherwise specified. © Koninklijke Philips Electronics N.V. 2004 All rights are reserved. Reproduction in whole or in part is prohibited without the prior written consent of the copyright owner. The information presented in this document does not form part of any quotation or contract, is believed to be accurate and reliable and may be changed without notice. No liability will be accepted by the publisher for any consequence of its use. Publication thereof does not convey nor imply any license under patent- or other industrial or intellectual property rights. Date of release: 10 June 2004 Document order number: 9397 750 13354 Published in U.S.A. Philips Semiconductors AN10302 Using the Philips LPC2000 Flash utility 6. Contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 LPC2000 ISP overview . . . . . . . . . . . . . . . . . . . 3 3 Details of the Philips LPC2000 Flash utility. . . 5 3.1 Manual entry into ISP mode . . . . . . . . . . . . . . . 5 3.2 ISP mode entry using DTR/RTS. . . . . . . . . . . . 5 3.3 Flash buffer operations. . . . . . . . . . . . . . . . . . . 6 3.4 RAM buffer operations . . . . . . . . . . . . . . . . . . . 7 4 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.1 Keil MCB2100 evaluation board . . . . . . . . . . . . 9 4.1.1 Enabling ISP mode with the MCB2100 . . . . . 10 4.2 The IAR/Philips LPC210x Kickstart card . . . . 10 4.2.1 Enabling ISP mode with the IAR/Philips Kickstart card . . . . . . . . . . . . . . . . . . . . . . . . . 12 5 Disclaimers. . . . . . . . . . . . . . . . . . . . . . . . . . . . 13*/
2026-03-10 09:02:42 2MB ARM LPC2000 FLASH烧录 可卸载官方版
1